This directory contains the "message_router" target which demonstrates how to create JavaScript bindings using CefMessageRouter.
See the shared library target for details common to all executable targets.
The "message_router" target is implemented as follows:
- Define the target-specific CMake build configuration in the CMakeLists.txt file.
- Call the shared entry point functions that initialize, run and shut down CEF.
- Uses the minimal target implementation.
- Implement the shared::Create*ProcessApp functions to create a CefApp instance appropriate to the process type.
- Browser process: app_browser_impl.cc implements the
shared::CreateBrowserProcessApp
method to return aCefApp
instance.- The
OnContextInitialized
method creates the initial CefBrowser instance using the shared::CreateBrowser helper function.
- The
- Renderer process: app_renderer_impl.cc implements the
shared::CreateRendererProcessApp
method to return aCefApp
instance.- Creates a
CefMessageRouterRendererSide
instance to handle the renderer side of message routing.
- Creates a
- Other sub-processes: Uses the minimal target implementation.
- Browser process: app_browser_impl.cc implements the
- Provide a concrete CefClient implementation in client_impl.cc and client_impl.h to handle CefBrowser callbacks.
- Creates a
CefMessageRouterBrowserSide
instance to handle the browser side of message routing. - Creates a
CefMessageRouterBrowserSide::Handler
instance to handle messages specific to the test code in message_router.html. - Implements the
GetResourceHandler
method to support loading of message_router.html via https://example.com/message_router.html.
- Creates a
- Windows resource loading implementation in resource_util_win_impl.cc and resource.rc.
- Implements the shared::GetResourceId method to map resource paths to BINARY ID values.
- Defines a BINARY resource to include message_router.html in the executable.
See the shared library target for configuration details.
See the shared library target for setup and build instructions.