Repository navigation
Add CefFrameHandler binding (GH #33) - #52
Merged
Merged
Conversation
4 of 5 tasks
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #52 +/- ##
============================================
+ Coverage 39.82% 40.50% +0.67%
- Complexity 781 817 +36
============================================
Files 249 255 +6
Lines 15045 15309 +264
Branches 2468 2503 +35
============================================
+ Hits 5992 6201 +209
- Misses 7814 7837 +23
- Partials 1239 1271 +32 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CEF exposes frame lifecycle events (onFrameCreated/Destroyed/Attached/
Detached, onMainFrameChanged) that JCEF had no Java binding for at all --
no way to observe when a sub-frame (e.g. an iframe) is created, attached
to its renderer process, or torn down.
Adds native/frame_handler.{h,cpp} + org.cef.handler.CefFrameHandler/
CefFrameHandlerAdapter, wired into client_handler.cpp/CefClient the same
way CefFindHandler was (this branch's existing GetHandler<T>() template
pattern).
Backport of coverage/phase1-value-objects-phase2-handlers's 17ba666
(frame-handler half only; CefPermissionHandler is a separate, larger
follow-up), with JCEF_TRACE calls dropped (not on master) and a fresh
CefFrameHandlerTest built directly on TestFrame instead of
CefFrameHandlerCoverageTest (which depends on SharedBrowserExtension,
not present on master).
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
Thrameos
force-pushed
the
backport/cef-frame-handler
branch
from
September 6, 2026 03:11
1f6adcb to
05c047b
Compare
Thrameos
added a commit
that referenced
this pull request
Sep 6, 2026
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
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
onFrameCreated/onFrameDestroyed/onFrameAttached/onFrameDetached,onMainFrameChanged) that JCEF had no Java binding for at all -- no way for an app to observe when a sub-frame (e.g. an iframe) is created, attaches to its renderer process, or is torn down.native/frame_handler.{h,cpp}+org.cef.handler.CefFrameHandler/CefFrameHandlerAdapter, wired intoclient_handler.cpp/CefClientthe same wayCefFindHandler(PR Add CefFindHandler binding (GH #32) #51) was -- this branch's existingGetHandler<T>()template pattern.coverage/phase1-value-objects-phase2-handlers's17ba666-- theCefFrameHandlerhalf only. That commit also addsCefPermissionHandler, a separate, larger, independent handler; splitting it into its own follow-up PR for cheaper review (per this repo's review-cost-ordering convention).JCEF_TRACEcalls dropped (not on master). FreshCefFrameHandlerTestbuilt directly onTestFrameinstead of portingCefFrameHandlerCoverageTest, which depends onSharedBrowserExtension(not present on master).Test plan
cmakereconfigure to pick up the newframe_handler.cpp/.hsources, +ninja -C jcef_build jcefunder-Werror, +tools/compile.sh linux64)CefFrameHandlerTest.subFrameLifecycleCallbacksFire(): loads a page with adata:URL iframe and asserts bothonFrameCreatedandonFrameAttachedfire for the non-main sub-frameAborted (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