Repository navigation
Add CefPermissionHandler binding (GH #34) - #53
Merged
Merged
Conversation
| @Override | ||
| protected void finalize() throws Throwable { | ||
| Cancel(); | ||
| super.finalize(); |
| @Override | ||
| protected void finalize() throws Throwable { | ||
| Continue(CefPermissionHandler.PermissionRequestResult.IGNORE); | ||
| super.finalize(); |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #53 +/- ##
============================================
- Coverage 40.68% 40.48% -0.20%
- Complexity 823 826 +3
============================================
Files 256 263 +7
Lines 15349 15493 +144
Branches 2506 2520 +14
============================================
+ Hits 6244 6273 +29
- Misses 7831 7943 +112
- Partials 1274 1277 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Previously there was no way for a JCEF app to grant/deny camera, mic, or geolocation requests at all -- Alloy style silently denies everything. Adds CefPermissionHandler (onRequestMediaAccessPermission, onShowPermissionPrompt, onDismissPermissionPrompt), wired into client_handler.cpp/CefClient the same way as every other handler. Adds CefMediaAccessCallback and CefPermissionPromptCallback (new _N callback classes, following the existing CefJSDialogCallback_N pattern). Permission result/media-permission-type bit flags are passed as raw ints with a nested constants class (CefContextMenuParams.TypeFlags' existing convention), matching cef_media_access_permission_types_t/ cef_permission_request_result_t's declaration order exactly. Backport of coverage/phase1-value-objects-phase2-handlers's 17ba666 (the CefPermissionHandler half; CefFrameHandler landed separately in PR #52). JCEF_TRACE calls dropped (not on master). Not covered by an automated end-to-end test: getUserMedia() requires a secure context and this suite's test URLs are http://test.com, so the request would be rejected by Blink before ever reaching CEF's permission layer. Extended CefClientTest's existing addAndRemoveEveryHandlerType() wiring smoke test instead, the cheapest coverage that actually exercises this change (add/remove round-trip through the real native ref). New _N JNI classes registered in tools/make_all_jni_headers.{sh,bat} per this repo's convention for regenerating hand-edited JNI headers. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
Thrameos
force-pushed
the
backport/cef-permission-handler
branch
from
September 6, 2026 03:29
9b41218 to
d259ed7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CefPermissionHandler(onRequestMediaAccessPermission,onShowPermissionPrompt,onDismissPermissionPrompt), wired intoclient_handler.cpp/CefClientthe same way as every other handler.CefMediaAccessCallbackandCefPermissionPromptCallback(new_Ncallback classes, following the existingCefJSDialogCallback_Npattern). Permission result/media-permission-type bit flags are passed as raw ints with a nested constants class (CefContextMenuParams.TypeFlags' existing convention), matchingcef_media_access_permission_types_t/cef_permission_request_result_t's declaration order exactly.coverage/phase1-value-objects-phase2-handlers's17ba666-- theCefPermissionHandlerhalf;CefFrameHandlerfrom the same source commit landed separately in PR Add CefFrameHandler binding (GH #33) #52 for cheaper review.JCEF_TRACEcalls dropped (not on master).getUserMedia()requires a secure context and this suite's test URLs arehttp://test.com, so the request would be rejected by Blink before ever reaching CEF's permission layer (same limitation the source commit's own message documents). ExtendedCefClientTest's existingaddAndRemoveEveryHandlerType()wiring smoke test instead -- the cheapest coverage that actually exercises this change (add/remove round-trip through the real native ref)._NJNI classes registered intools/make_all_jni_headers.{sh,bat}per this repo's convention for regenerating hand-edited JNI headers.Test plan
cmakereconfigure to pick up the new native sources, +ninja -C jcef_build jcefunder-Werror, +tools/compile.sh linux64)CefClientTest.addAndRemoveEveryHandlerType()to add/remove aCefPermissionHandlerAdapterAborted (core dumped)after the JUnit summary is the already-tracked, pre-existing GH Release build: SIGSEGV in libc.so.6 during JVM shutdown after all tests pass #10 shutdown SIGSEGV, unrelated to this change🤖 Generated with Claude Code
https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq