Repository navigation
Add missing OnDevToolsAgentAttached/OnDevToolsAgentDetached API surface - #50
Merged
Merged
Conversation
Our Java CefDevToolsMessageObserver only exposed onDevToolsMethodResult/ onDevToolsEvent, missing the two attach/detach callbacks the real C++ CefDevToolsMessageObserver interface has. Added both to the native bridge (devtools_message_observer.h/.cpp, JNI_CALL_VOID_METHOD already safely no-ops against older/other implementers, though CefDevToolsClient is currently the only one) and to the Java interface, wired into CefDevToolsClient's internal observer with a new public isAgentAttached() accessor. Per CEF's own header docs, attachment "will generally occur in response to the first message sent while the agent is detached" -- so this is diagnostic/observable state, not a precondition we can gate executeDevToolsMethod() on. Backport of coverage/phase1-value-objects-phase2-handlers' 7b73b62, applied verbatim (this branch's files matched that commit's pre-fix state exactly). Adds a smoke test verifying isAgentAttached()'s safe default (false, before any message is sent) to the existing CefDevToolsRegistrationTest.java -- doesn't exercise an actual attach/detach transition since executeDevToolsMethod() is a confirmed unrecoverable hang in this environment (issue #12). Verified: full clean rebuild (native + Java), CefDevToolsRegistrationTest (both tests) pass. A post-summary "Aborted (core dumped)" crash after the JUnit run reported 0 failures is the already-tracked, pre-existing GH #10 shutdown-race SIGSEGV (plan/tasks/20260903-01-gh10-shutdown- sigsegv.md), unrelated to this change. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq
| * | ||
| * @param browser the originating browser instance | ||
| */ | ||
| void onDevToolsAgentAttached(CefBrowser browser); |
| * | ||
| * @param browser the originating browser instance | ||
| */ | ||
| void onDevToolsAgentDetached(CefBrowser browser); |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #50 +/- ##
============================================
- Coverage 38.01% 38.01% -0.01%
+ Complexity 735 734 -1
============================================
Files 243 243
Lines 14863 14901 +38
Branches 2449 2454 +5
============================================
+ Hits 5650 5664 +14
- Misses 8011 8030 +19
- Partials 1202 1207 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
CefDevToolsMessageObserveronly exposedonDevToolsMethodResult/onDevToolsEvent, missing the two attach/detach callbacks the real C++CefDevToolsMessageObserverinterface has.devtools_message_observer.h/.cpp) and to the Java interface, wired intoCefDevToolsClient's internal observer with a new publicisAgentAttached()accessor.executeDevToolsMethod()on.coverage/phase1-value-objects-phase2-handlers'7b73b62, applied verbatim (this branch's files matched that commit's pre-fix state exactly).Test plan
CefDevToolsRegistrationTest.javaverifyingisAgentAttached()'s safe default (false, before any message is sent). Doesn't exercise an actual attach/detach transition --executeDevToolsMethod()is a confirmed unrecoverable hang in this environment (issue CefBrowser.getDevToolsClient()/executeDevToolsMethod() and browser.print() can hang indefinitely, unrecoverable #12), documented in that same test file.CefDevToolsRegistrationTestpass, 2/2🤖 Generated with Claude Code
https://claude.ai/code/session_01HBFmQs6JDypYP5qdC99yDq