Skip to content

In-process CDP bridge for the command gateway (#57) - #12

Open
pplupo wants to merge 1 commit into
Euro-Office:mainfrom
pplupo:feature/cdp-gateway-cli
Open

In-process CDP bridge for the command gateway (#57)#12
pplupo wants to merge 1 commit into
Euro-Office:mainfrom
pplupo:feature/cdp-gateway-cli

Conversation

@pplupo

@pplupo pplupo commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

In-process CDP bridge for the command gateway

Implements the SDK-side piece of #57 (Local API / Daemon Mode): adds
CCefView::SendGatewayDevToolsMessage, driving CDP's Runtime.evaluate in-process via
CefBrowserHost::SendDevToolsMessage — no external --remote-debugging-port, no
WebSocket client. Since the gateway (implemented in the companion desktop-apps PR)
already holds the exact CefBrowser for a target document through the app's own
view-tracking, there is no CDP-target-correlation problem to solve; this method is
purely a thin bridge from that already-resolved view to CDP.

What's here

  • CCefView::SendGatewayDevToolsMessage(jsonMessage, messageId, callback) — takes a
    complete UTF8-encoded DevTools Protocol request, fires callback exactly once on the
    browser process UI thread with the matching raw JSON response (or an error if the
    view no longer exists). No CEF types appear in the signature, keeping CCefView's
    public surface CEF-detail-free like the rest of the class.
  • CGatewayDevToolsObserver / CCefView_Private::EnsureGatewayDevToolsObserver()
    internal plumbing for correlating DevTools responses back to the caller by message id.

Testing

Single self-contained addition to CCefView; validated by building and exercising it
through the actual gateway command suite in the companion desktop-apps PR (46
automated tests covering Word/Cell/Slide/PDF commands plus the CLI, all passing against
this bridge).


Companion PRs: desktop-apps#40 · DesktopEditors#72

CCefView::SendGatewayDevToolsMessage sends a raw UTF8-JSON DevTools
Protocol message to this view's browser via
CefBrowserHost::SendDevToolsMessage/AddDevToolsMessageObserver --
no external --remote-debugging-port, no websocket, no CDP-target
correlation problem, since we already hold the exact CefBrowser via
the view.

Replaces the earlier SetGatewaySupport/GetGatewaySupport +
--remote-debugging-port=0 design (that commit has been dropped from
this branch, not left in history as dead code) after investigation
showed CefBrowserHost already exposes SendDevToolsMessage/
ExecuteDevToolsMethod/AddDevToolsMessageObserver, unconditionally
available and explicitly documented as not requiring any external
DevTools/remote-debugging session (cef/linux/include/cef_browser.h).
See cdp-gateway-cli-plan.md.

Signed-off-by: Peter P. Lupo <pplupo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant