Support chrome windows with CEF callbacks

Issue #2969 new
Marshall Greenblatt created an issue

The Chromium code base is composed of architectural layers, with the primary application layers being “content” and “chrome”. The “content” layer includes WebContents as the primary browser object and provides implementations for most of the generic web platform and application/process management functionality. The “chrome” layer includes Browser as the primary browser object and provides implementations for many advanced features including datalist/autofill (issue #906), extensions (issue #1947), gamepad (issue #1751), webhid (issue #2847), webmidi (issue #1028), async clipboard (issue #2921), input_type=color (issue #899), etc.

For historical reasons CEF browser windows are based on the “content” layer WebContents object. Adding support for additional “chrome” layer features is a serious effort because it involves careful understanding and cherry-picking of the related functionality from “chrome” into the CEF code base. Over time we have added dependencies on the “chrome” layer targets to support some features in CEF (extensions, print preview, etc) and to avoid code duplication. As a result, CEF binaries already contain most/all of the code that would be required to launch a stand-alone “chrome” Browser window.

If we could create a CEF browser window based on the “chrome” Browser object we would get much of the “chrome” layer functionality “for free”. To be usable in CEF the “chrome” window would need to support a subset of existing CEF callbacks/intercepts (e.g. loading progress, network requests, etc.), and be inserted into the existing Views framework structure (issue #1749). The “chrome” window would not support off-screen rendering, though parenting to a native (non-Views) window should be possible and likely required on macOS.

Given the above, the scope for this issue is to identify the subset of “chrome” initialization code that is required to launch and embed a Views-based Browser window object, and then hook up a TBD minimum subset of existing CEF callbacks to work with that object. MVP is an off-by-default option to create “chrome”-based browsers in cefclient/cefsimple. These browsers will initially contain many chrome-specific UI features (shortcut keys, dialogs, etc.) that might not be desired in release-quality client applications. Additional callback functionality and behavioral tweaks may be added over time as needed/appropriate.

Official response

  • Marshall Greenblatt reporter

    Chrome + Views is now testable on all platforms (Windows, Linux, MacOS) with builds of M90 and newer.

    To launch a fully-featured Chrome window using cefsimple:

    $ cefsimple --enable-chrome-runtime
    

    To launch a minimally-styled Views-hosted window using cefsimple:

    $ cefsimple --use-views --enable-chrome-runtime
    

    To launch a fully-styled Views-hosted window using cefclient:

    $ cefclient --use-views --enable-chrome-runtime
    

    Use open [name].app --args [arguments] when launching the app on MacOS.

    Remaining MVP work includes:

    • Test crash reporting.
    • Customizing singleton behavior when the same CEF-based application is launched multiple times.

    Other work includes:

    • TryCloseBrowser and DoClose support (needed for LifeSpanTest.*).
    • Remaining CefSettings configuration.
    • DevTools window control (ShowDevTools; needed for V8Test.OnUncaughtExceptionDevTools; currently accessible via the Chrome UI).
    • Auto resize (SetAutoResizeEnabled; needed for DisplayTest.AutoResize).
    • Zoom settings (SetZoomLevel; currently configurable via the Chrome UI).
    • File dialog runner (RunFileDialog; needed for DialogTest.*).
    • File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler; needed for DialogTest.*, JSDialogTest.*, LifeSpanTest.*; currently uses default Chrome dialogs).
    • Context menu custom runner (CefContextMenuHandler::RunContextMenu; currently uses default Chrome menu)
    • Extension loading (LoadExtension, etc; needed for ExtensionTest.*; currently installable via chrome://extensions/).
    • Audio capture (CefAudioHandler; needed for AudioOutputTest.*)
    • Download handling (CefDownloadHandler; needed for DownloadTest.*)
    • Tracing handling (CefBeginTracing; needed for TracingTest.*)
    • Add ability to disable the Chrome status bubble
    • Add ability to customize the Chrome “3 dots” settings menu

    The following ceftests are not yet supported with the "--enable-chrome-runtime" command-line flag:

    AudioOutputTest.*                   (missing functionality)
    DialogTest.*                        (missing functionality)
    DisplayTest.AutoResize              (missing functionality)
    DownloadTest.*                      (missing functionality)
    ExtensionTest.*                     (will not be supported at this time)
    JSDialogTest.*                      (missing functionality)
    LifeSpanTest.*                      (missing functionality)
    OSRTest.*                           (will not be supported at this time)
    TracingTest.*                       (missing functionality)
    V8Test.OnUncaughtExceptionDevTools  (missing functionality)
    

    All remaining (supported) tests can be run with this command-line:

    ceftests --enable-chrome-runtime --gtest_filter=-AudioOutputTest.*:DialogTest.*:DisplayTest.AutoResize:DownloadTest.*:ExtensionTest.*:JSDialogTest.*:LifeSpanTest.*:OSRTest.*:TracingTest.*:V8Test.OnUncaughtExceptionDevTools
    

Comments (92)

  1. Marshall Greenblatt reporter

    One important technical aspect of this change is the usage of BUILDFLAG(ENABLE_CEF) when patching Chromium code. We will need to introduce a runtime check for choosing between CEF and Chrome behaviors in these patches, instead of just compiling in the CEF-specific behaviors when building CEF.

  2. Marshall Greenblatt reporter

    GTK is required for the Chrome runtime on Linux (see here), so use_gtk=true must be specified via GN_DEFINES on that platform.

  3. Marshall Greenblatt reporter

    Refactor process execution logic (see issue #2969)

    CefContext implements the public CEF API functions and delegates the stages of content & service_manager process execution to CefMainRunner. CEF-specific runtime logic (which may be replaced with chrome-specific runtime logic) is then delegated to CefMainDelegate which implements content::ContentMainDelegate.

    → <<cset 049caf913106>>

  4. Marshall Greenblatt reporter

    Add initial chrome runtime support (see issue #2969)

    Running cefsimple --enable-chrome-runtime will create and run a Chrome browser window using the CEF app methods, and call CefApp::OnContextInitialized as expected. CEF task methods also work as expected in the main process. No browser-related methods or callbacks are currently supported for the Chrome window, and the application will exit when the last Chrome window closes.

    The Chrome runtime requires resources.pak, chrome_100_percent.pak and chrome_200_percent.pak files which were not previously built with CEF. It shares the existing locales pak files which have been updated to include additional Chrome-specific strings.

    On Linux, the Chrome runtime requires GTK so use_gtk=true must be specified via GN_DEFINES when building.

    This change also refactors the CEF runtime, which can be tested in the various supported modes by running: $ cefclient $ cefclient --multi-threaded-message-loop $ cefclient --external-message-pump

    → <<cset 117499421184>>

  5. Marshall Greenblatt reporter

    Set enable_background_mode=false by default (see issue #2969)

    This mode doesn't make sense with CEF, and it was causing strange shutdown crashes when running with Chrome mode enabled.

    → <<cset f5587b74f0aa>>

  6. Marshall Greenblatt reporter

    Rename the current CEF runtime to Alloy (see issue #2969)

    As part of introducing the Chrome runtime we now need to distinguish between the classes that implement the current CEF runtime and the classes the implement the shared CEF library/runtime structure and public API. We choose the name Alloy for the current CEF runtime because it describes a combination of Chrome and other elements.

    Shared CEF library/runtime classes will continue to use the Cef prefix. Classes that implement the Alloy or Chrome runtime will use the Alloy or Chrome prefixes respectively. Classes that extend an existing Chrome-prefixed class will add the Cef or Alloy suffix, thereby following the existing naming pattern of Chrome-derived classes.

    This change applies the new naming pattern to an initial set of runtime-related classes. Additional classes/files will be renamed and moved as the Chrome runtime implementation progresses.

    → <<cset 84f3ff2afda7>>

  7. Marshall Greenblatt reporter

    Add CefAppManager and remove global ContentClient accessors (see issue #2969)

    This is the first pass in removing direct dependencies on the Alloy runtime from code that can potentially be shared between runtimes.

    CefBrowserHost and CefRequestContext APIs (including CefCookieManager, CefURLRequest, etc.) are not yet implemented for the Chrome runtime. Assert early if these API methods are called while the Chrome runtime is enabled.

    → <<cset b3a8da9b25dc>>

  8. Marshall Greenblatt reporter

    Make CefBrowserContext an abstract base class (see issue #2969)

    Existing CefBrowserContext functionality is now split between CefBrowserContext and AlloyBrowserContext. Runtime implementations of CefBrowserContext will provide access to the content::BrowserContext and Profile types via different inheritance paths. For example, the Alloy runtime uses ChromeProfileAlloy and the Chrome runtime uses ProfileImpl.

    This change also renames CefResourceContext to CefIOThreadState to more accurately represent its purpose as it no longer needs to extend content::ResourceContext.

    → <<cset 48fc0bd2206d>>

  9. Marshall Greenblatt reporter

    Move browser runtime-specific logic to CefBrowserPlatformDelegate (see issue #2969)

    This change moves the runtime-specific implementations of CefBrowserHostImpl methods to CefBrowserPlatformDelegate. Some WebContentsDelegate methods implemented by CefBrowserHostImpl set state or trigger client callbacks. Those implementations will likely stay with CefBrowserHostImpl and will need to be called from the Browser equivalents when using the Chrome runtime.

    → <<cset 6cb9f0c695b9>>

  10. Marshall Greenblatt reporter

    Add initial Chrome runtime support for browser APIs (see issue #2969)

    This change adds basic Chrome runtime implementations for CefBrowserContext and CefBrowserPlatformDelegate. A Chrome browser window with default frame and styling can now be created using CefBrowserHost::CreateBrowser and some CefClient callbacks will be triggered via the WebContentsObserver implementation in CefBrowserHostImpl.

    Any additional browser windows created via the Chrome UI will be unmanaged by CEF. The application message loop will block until all browser windows have been closed by the user.

    → <<cset e9bf3cdb9852>>

  11. Marshall Greenblatt reporter

    Move Alloy-specific logic to CefBrowserPlatformDelegateAlloy (see issue #2969)

    Also remove OSR-related methods where the attributes can instead be passed to the OSR platform delegate constructor directly.

    → <<cset 02cdf05848ea>>

  12. Marshall Greenblatt reporter

    Fix build and initial Chrome runtime issues on macOS (see issue #2969)

    This change moves shared resource initialization to a common location and disables crash reporting initialization in chrome/ code via patch files.

    When using the Chrome runtime on macOS the Chrome application window will display, but web content is currently blank and the application does not exit cleanly. This will need to be debugged further in the future.

    → <<cset 03c9156c803c>>

  13. Marshall Greenblatt reporter

    The next step is supporting observers and delegates on the chrome Browser object.

  14. Marshall Greenblatt reporter

    Create a ChromeBrowserHostImpl for every Chrome tab (see issue #2969)

    The Browser object represents the top-level Chrome browser window. One or more tabs (WebContents) are then owned by the Browser object via TabStripModel. A new Browser object can be created programmatically using "new Browser" or Browser::Create, or as a result of user action such as dragging a tab out of an existing window. New or existing tabs can also be added to an already existing Browser object.

    The Browser object acts as the WebContentsDelegate for all attached tabs. CEF integration requires WebContentsDelegate callbacks and notification of tab attach/detach. To support this integration we add a cef::BrowserDelegate (ChromeBrowserDelegate) member that is created in the Browser constructor and receives delegation for the Browser callbacks. ChromeBrowserDelegate creates a new ChromeBrowserHostImpl when a tab is added to a Browser for the first time, and that ChromeBrowserHostImpl continues to exist until the tab's WebContents is destroyed. The associated WebContents object does not change, but the Browser object will change when the tab is dragged between windows.

    CEF callback logic is shared between the chrome and alloy runtimes where possible. This shared logic has been extracted from CefBrowserHostImpl to create new CefBrowserHostBase and CefBrowserContentsDelegate classes. The CefBrowserHostImpl class is now only used with the alloy runtime and will be renamed to AlloyBrowserHostImpl in a future commit.

    → <<cset 38d8acfa186c>>

  15. Marshall Greenblatt reporter

    Add chrome runtime support for more callbacks and ceftests (see issue #2969)

    This change adds support for:

    • Protocol and request handling.
    • Loading and navigation events.
    • Display and focus events.
    • Mouse/keyboard events.
    • Popup browsers.
    • Callbacks in the renderer process.
    • Misc. functionality required for ceftests.

    This change also adds a new CefBrowserProcessHandler::GetCookieableSchemes callback for configuring global state that will be applied to all CefCookieManagers by default. This global callback is currently required by the chrome runtime because the primary ProfileImpl is created via ChromeBrowserMainParts::PreMainMessageLoopRun (CreatePrimaryProfile) before OnContextCreated can be called.

    ProfileImpl will use the "C:\Users[user]\AppData\Local\CEF\User Data\Default" directory by default (on Windows). Cookies may persist in this directory when running ceftests and may need to be manually deleted if those tests fail.

    Remaining work includes:

    • Support for client-created request contexts.
    • Embedding the browser in a Views hierarchy (cefclient support).
    • TryCloseBrowser and DoClose support.
    • Most of the CefSettings configuration.
    • DevTools protocol and window control (ShowDevTools, ExecuteDevToolsMethod).
    • CEF-specific WebUI pages (about, license, webui-hosts).
    • Context menu customization (CefContextMenuHandler).
    • Auto resize (SetAutoResizeEnabled).
    • Zoom settings (SetZoomLevel).
    • File dialog runner (RunFileDialog).
    • File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler).
    • Extension loading (LoadExtension, etc).
    • Plugin loading (OnBeforePluginLoad).
    • Widevine loading (CefRegisterWidevineCdm).
    • PDF and print preview does not display.
    • Crash reporting is untested.
    • Mac: Web content loads but does not display.

    The following ceftests are now passing when run with the "--enable-chrome-runtime" command-line flag:

    CorsTest.*
    DOMTest.*
    DisplayTest.*:-DisplayTest.AutoResize
    DraggableRegionsTest.*
    ImageTest.*
    MessageRouterTest.*
    NavigationTest.*
    ParserTest.*
    RequestContextTest.*Global*
    RequestTest.*
    ResourceManagerTest.*
    ResourceRequestHandlerTest.*
    ResponseTest.*
    SchemeHandlerTest.*
    ServerTest.*
    StreamResourceHandlerTest.*
    StreamTest.*
    StringTest.*
    TaskTest.*
    TestServerTest.*
    ThreadTest.*
    URLRequestTest.*Global*
    V8Test.*:-V8Test.OnUncaughtExceptionDevTools
    ValuesTest.*
    WaitableEventTest.*
    XmlReaderTest.*
    ZipReaderTest.*
    

    They can be run with this command-line:

    ceftests --enable-chrome-runtime --gtest_filter=CorsTest.*:DisplayTest.*:DOMTest.*:DraggableRegionsTest.*:ImageTest.*:MessageRouterTest.*:NavigationTest.*:ParserTest.*:RequestContextTest.*Global*:RequestTest.*:ResourceManagerTest.*:ResourceRequestHandlerTest.*:ResponseTest.*:SchemeHandlerTest.*:ServerTest.*:StreamResourceHandlerTest.*:StreamTest.*:StringTest.*:TaskTest.*:TestServerTest.*:ThreadTest.*:URLRequestTest.*Global*:V8Test.*:ValuesTest.*:WaitableEventTest.*:XmlReaderTest.*:ZipReaderTest.*:-V8Test.OnUncaughtExceptionDevTools:DisplayTest.AutoResize
    

    → <<cset 4fbd2472310b>>

  16. Marshall Greenblatt reporter

    chrome: Fix callbacks for different Profile types (see issue #2969)

    • Only install network intercepts for Profiles that have an associated CefBrowserContext. For incognito windows the CefBrowserContext is associated with the OffTheRecordProfileImpl's original Profile.
    • cefsimple: Return the default CefClient instance for browser windows created via the Chrome UI, and allow Chrome to show error pages.

    → <<cset ec7067c55ee1>>

  17. Marshall Greenblatt reporter

    chrome: Add CEF-specific WebUI handling (see issue #2969)

    To avoid conflicting IDs between Alloy (which uses cef.pak) and Chrome (which uses chrome_100_percent.pak) the cef/LICENSE.txt file is now included in both cef/libcef/resources/cef_resources.grd and chrome/app/theme/chrome_unscaled_resources.grd with different ID values.

    The cef.pak file currently contains both CEF-specific resources and Chrome resources that are already included in the default .pak files distributed with Chrome. In the future we should remove this duplication and just distribute the same .pak files as Chrome for the majority of resources.

    → <<cset 8f5fdc1f9adb>>

  18. Marshall Greenblatt reporter

    Chrome + Views is now testable on all platforms (Windows, Linux, MacOS) with builds of M90 and newer.

    To launch a fully-featured Chrome window using cefsimple:

    $ cefsimple --enable-chrome-runtime
    

    To launch a minimally-styled Views-hosted window using cefsimple:

    $ cefsimple --use-views --enable-chrome-runtime
    

    To launch a fully-styled Views-hosted window using cefclient:

    $ cefclient --use-views --enable-chrome-runtime
    

    Use open [name].app --args [arguments] when launching the app on MacOS.

    Remaining MVP work includes:

    • Test crash reporting.
    • Customizing singleton behavior when the same CEF-based application is launched multiple times.

    Other work includes:

    • TryCloseBrowser and DoClose support (needed for LifeSpanTest.*).
    • Remaining CefSettings configuration.
    • DevTools window control (ShowDevTools; needed for V8Test.OnUncaughtExceptionDevTools; currently accessible via the Chrome UI).
    • Auto resize (SetAutoResizeEnabled; needed for DisplayTest.AutoResize).
    • Zoom settings (SetZoomLevel; currently configurable via the Chrome UI).
    • File dialog runner (RunFileDialog; needed for DialogTest.*).
    • File and JS dialog handlers (CefDialogHandler, CefJSDialogHandler; needed for DialogTest.*, JSDialogTest.*, LifeSpanTest.*; currently uses default Chrome dialogs).
    • Context menu custom runner (CefContextMenuHandler::RunContextMenu; currently uses default Chrome menu)
    • Extension loading (LoadExtension, etc; needed for ExtensionTest.*; currently installable via chrome://extensions/).
    • Audio capture (CefAudioHandler; needed for AudioOutputTest.*)
    • Download handling (CefDownloadHandler; needed for DownloadTest.*)
    • Tracing handling (CefBeginTracing; needed for TracingTest.*)
    • Add ability to disable the Chrome status bubble
    • Add ability to customize the Chrome “3 dots” settings menu

    The following ceftests are not yet supported with the "--enable-chrome-runtime" command-line flag:

    AudioOutputTest.*                   (missing functionality)
    DialogTest.*                        (missing functionality)
    DisplayTest.AutoResize              (missing functionality)
    DownloadTest.*                      (missing functionality)
    ExtensionTest.*                     (will not be supported at this time)
    JSDialogTest.*                      (missing functionality)
    LifeSpanTest.*                      (missing functionality)
    OSRTest.*                           (will not be supported at this time)
    TracingTest.*                       (missing functionality)
    V8Test.OnUncaughtExceptionDevTools  (missing functionality)
    

    All remaining (supported) tests can be run with this command-line:

    ceftests --enable-chrome-runtime --gtest_filter=-AudioOutputTest.*:DialogTest.*:DisplayTest.AutoResize:DownloadTest.*:ExtensionTest.*:JSDialogTest.*:LifeSpanTest.*:OSRTest.*:TracingTest.*:V8Test.OnUncaughtExceptionDevTools
    

  19. Marshall Greenblatt reporter

    chrome: Add Views API integration (see issue #2969)

    The Chrome browser can now be hosted in a Views-based application on Windows and Linux.

    To launch a fully-featured Chrome window using cefsimple: $ cefsimple --enable-chrome-runtime

    To launch a minimally-styled Views-hosted window using cefsimple: $ cefsimple --enable-chrome-runtime --use-views

    To launch a fully-styled Views-hosted window using cefclient: $ cefclient --enable-chrome-runtime --use-views

    Views unit tests also now pass with the Chrome runtime enabled: $ ceftests --gtest_filter=Views* --enable-chrome-runtime

    Known issues: - Popup browsers cannot be intercepted and reparented.

    → <<cset 8733cb89c74a>>

  20. Marshall Greenblatt reporter

    Mac: Add Views API support (see issue #1749)

    The Chrome browser can now be hosted in a Views-based application on Mac (see issue #2969).

    To launch a fully-featured Chrome window using cefsimple: $ open cefsimple.app --args --enable-chrome-runtime

    To launch a minimally-styled Views-hosted window using cefsimple: $ open cefsimple.app --args --use-views [--enable-chrome-runtime]

    To launch a fully-styled Views-hosted window using cefclient: $ open cefclient.app --args --use-views [--enable-chrome-runtime]

    Known issues: - Some Views unit tests are currently failing on Mac.

    → <<cset 1d39ff720e3e>>

  21. Marshall Greenblatt reporter

    chrome: Fix URL rewrite on new tab navigation (see issue #2969)

    This fixes an Unhandled chrome.send("getApps"); error when creating a new tab.

    Creating a new tab initially loads chrome://newtab which should then be rewritten to chrome://new-tab-page for normal profiles in HandleNewTabURLRewrite. Failure to rewrite the URL results in the loading of NewTabUI instead of the expected NewTabPageUI. NewTabUI loads different resources for normal vs incognito/guest profiles (new_tab.js vs incognito_tab.js), and new_tab.js calls chrome.send("getApps") via page_list_view.js. This then fails in WebUIImpl::ProcessWebUIMessage because the message is unhandled.

    → <<cset a6a8c0e845e8>>

  22. Marshall Greenblatt reporter

    Use the same pak files for the Alloy and Chrome runtimes (see issue #2969)

    Chrome currently uses chrome_100_percent.pak, chrome_200_percent.pak, resources.pak and locales/<locale>.pak files. This change adds CEF resources to those existing pak files and updates the Alloy runtime to use them instead of the previous CEF-specific pak files (cef.pak, cef_100_percent.pak, cef_200_percent.pak, cef_extensions.pak, devtools_resources.pak) which are no longer generated.

    The addition of Chrome resources results in an ~16% (~4.1MB) increase in total combined pak file size vs. the previous CEF-specific pak files. While a size increase is not ideal for the Alloy runtime, it seems preferable to the alternative of distributing separate (and partially duplicated) pak files for each runtime, which would have added ~9.8MB to the total binary distribution size.

    → <<cset 8424f166ccef>>

  23. Marshall Greenblatt reporter

    Linux: cefclient: Port to GTK3 (see issue #2969)

    GTK3 is required by the Chrome runtime. The cefclient off-screen rendering example no longer works with Ubuntu 16.04. With end-of-life in April 2021 we are dropping support for 16.04 in the near future in any case.

    → <<cset 020ac1b50972>>

  24. Marshall Greenblatt reporter

    Linux: Enable GTK3 by default (see issue #2969)

    GTK3 is required by the Chrome runtime. Client applications using GTK2 will now require a custom build of CEF with use_gtk=false set via GN_DEFINES.

    → <<cset c4baba880e0b>>

  25. Marshall Greenblatt reporter

    chrome: Add DevTools protocol support (see issue #2969)

    Testable with the following: $ ceftests --enable-chrome-runtime --gtest_filter=DevToolsMessageTest.*

    → <<cset 505bf24abb6a>>

  26. Marshall Greenblatt reporter

    chrome: Support client-created request contexts (see issue #2969)

    RequestContextTest and URLRequestTest suites now pass with the Chrome runtime enabled.

    → <<cset 09fa22898dfb>>

  27. Marshall Greenblatt reporter

    Avoid potential use-after-free of CefIOThreadState (see issue #2969)

    The problem occured while executing multiple URLRequestTest with the Chrome runtime.

    → <<cset 4188cc2f75dc>>

  28. Marshall Greenblatt reporter

    chrome: Support client-created request contexts (see issue #2969)

    RequestContextTest and URLRequestTest suites now pass with the Chrome runtime enabled.

    → <<cset 44829818b0cc>>

  29. Marshall Greenblatt reporter

    Avoid potential use-after-free of CefIOThreadState (see issue #2969)

    The problem occured while executing multiple URLRequestTest with the Chrome runtime.

    → <<cset c04a5788210c>>

  30. Dilip Kothamasu

    We are trying to build a CEF version for linux for 4430 and seeing the below error. Should we be setting use_gtk=true for GN_DEFINES to fix the error ? @Marshall Greenblatt

    /tests/cefclient/browser/browser_window_osr_gtk.h:121:30 error: ‘GdkEventTouch’ has not been declared
                                 ​GdkEventTouch* event,
                                 ​^
    

  31. Marshall Greenblatt reporter

    Fix server thread assertion on CEF shutdown (see issue #2969)

    The server thread was not guaranteed to be released in the correct scope on CEF shutdown. This resulted in occasional thread_restrictions assertions on ceftests shutdown after running the URLRequestTest suite with the Chrome runtime enabled.

    → <<cset c565d9b1e644>>

  32. Marshall Greenblatt reporter

    Move cookieable scheme configuration to settings (see issue #2969)

    The Chrome runtime requires that cookieable scheme information be available at Profile initialization time because it also triggers NetworkContext creation at the same time. To make this possible, and to avoid various race conditions when setting state, the cookieable scheme configuration has been added as |cookieable_schemes_list| and |cookieable_schemes_exclude_defaults| in CefSettings and CefBrowserContextSettings. The CefCookieManager:: SetSupportedSchemes and CefBrowserProcessHandler::GetCookieableSchemes methods are no longer required and have been removed.

    This change also modifies chrome to delay OffTheRecordProfileImpl initialization so that |ChromeBrowserContext::profile_| can be set before ChromeContentBrowserClientCef::ConfigureNetworkContextParams calls CefBrowserContext::FromBrowserContext to retrieve the ChromeBrowserContext and associated cookieable scheme information. Otherwise, the ChromeBrowserContext will not be matched and the NetworkContext will not be configured correctly.

    The CookieTest suite now passes with the Chrome runtime enabled.

    → <<cset 76642ccafaf4>>

  33. Marshall Greenblatt reporter

    Fix server thread assertion on CEF shutdown (see issue #2969)

    The server thread was not guaranteed to be released in the correct scope on CEF shutdown. This resulted in occasional thread_restrictions assertions on ceftests shutdown after running the URLRequestTest suite with the Chrome runtime enabled.

    → <<cset f048a5ddba53>>

  34. Marshall Greenblatt reporter

    Move cookieable scheme configuration to settings (see issue #2969)

    The Chrome runtime requires that cookieable scheme information be available at Profile initialization time because it also triggers NetworkContext creation at the same time. To make this possible, and to avoid various race conditions when setting state, the cookieable scheme configuration has been added as |cookieable_schemes_list| and |cookieable_schemes_exclude_defaults| in CefSettings and CefBrowserContextSettings. The CefCookieManager:: SetSupportedSchemes and CefBrowserProcessHandler::GetCookieableSchemes methods are no longer required and have been removed.

    This change also modifies chrome to delay OffTheRecordProfileImpl initialization so that |ChromeBrowserContext::profile_| can be set before ChromeContentBrowserClientCef::ConfigureNetworkContextParams calls CefBrowserContext::FromBrowserContext to retrieve the ChromeBrowserContext and associated cookieable scheme information. Otherwise, the ChromeBrowserContext will not be matched and the NetworkContext will not be configured correctly.

    The CookieTest suite now passes with the Chrome runtime enabled.

    → <<cset 5bfcfaab7376>>

  35. Marshall Greenblatt reporter

    chrome: Fix assertion when clicking the incognito profile button (see issue #2969)

    Profile::IsIncognitoProfile() currently returns false for CEF incognito profiles because they are not the primary OTR profile. At the same time, we don't necessarily want IsIncognitoProfile() to return true for CEF profiles because, among other things, that causes the BrowserView to apply the dark toolbar theme. Instead, this change updates ProfileMenu expectations to support the CEF incognito profiles without otherwise modifying the incognito behavior.

    Note that the IsIncognitoProfile() implementation has recently changed in https://crrev.com/7bf6eb2497 and the conclusions in this commit will likely need to be revisited in an upcoming Chromium update.

    → <<cset 9c827850778a>>

  36. Marshall Greenblatt reporter

    chrome: mac: Fix exception_port_.is_valid() failure (see issue #2969)

    Fixes the following startup error: FATAL:crashpad_client_mac.cc(499) Check failed: exception_port_.is_valid()

    → <<cset e1b6f5ad319a>>

  37. Marshall Greenblatt reporter

    chrome: Fix assertion when clicking the incognito profile button (see issue #2969)

    Profile::IsIncognitoProfile() currently returns false for CEF incognito profiles because they are not the primary OTR profile. At the same time, we don't necessarily want IsIncognitoProfile() to return true for CEF profiles because, among other things, that causes the BrowserView to apply the dark toolbar theme. Instead, this change updates ProfileMenu expectations to support the CEF incognito profiles without otherwise modifying the incognito behavior.

    Note that the IsIncognitoProfile() implementation has recently changed in https://crrev.com/7bf6eb2497 and the conclusions in this commit will likely need to be revisited in an upcoming Chromium update.

    → <<cset d98971fc9e1f>>

  38. Marshall Greenblatt reporter

    chrome: mac: Fix exception_port_.is_valid() failure (see issue #2969)

    Fixes the following startup error: FATAL:crashpad_client_mac.cc(499) Check failed: exception_port_.is_valid()

    → <<cset d4386da6c31e>>

  39. Alex Maitland

    @Marshall Greenblatt I'm seeing crashes when calling SetPreference and SetCookie, is this at a stage you’d like bug reports?

  40. Marshall Greenblatt reporter

    @amaitland Feel free to mention any problems here.

    Profile creation is asynchronous in some cases. You likely need to wait for CefRequestContextHandler::OnRequestContextInitialized to be called before using the Set methods. I’m not sure what we’ll do about this yet from an API perspective to avoid the crashes.

  41. Marshall Greenblatt reporter

    Wait for CefBrowserContext initialization (see issue #2969)

    With the Chrome runtime, Profile initialization may be asynchronous. Code that waited on CefBrowserContext creation now needs to wait on CefBrowserContext initialization instead.

    → <<cset 691c9c2dcc64>>

  42. Marshall Greenblatt reporter

    Wait for CefBrowserContext initialization (see issue #2969)

    With the Chrome runtime, Profile initialization may be asynchronous. Code that waited on CefBrowserContext creation now needs to wait on CefBrowserContext initialization instead.

    → <<cset 34c63a665d6b>>

  43. Marshall Greenblatt reporter

    chrome: Support configuration of user agent and locale (see issue #2969)

    This change adds support for CefSettings and command-line configuration of user_agent, user_agent_product (formerly product_version) and locale.

    → <<cset c03a6f43861e>>

  44. Marshall Greenblatt reporter

    chrome: Support configuration of user agent and locale (see issue #2969)

    This change adds support for CefSettings and command-line configuration of user_agent, user_agent_product (formerly product_version) and locale.

    → <<cset 351901861c1f>>

  45. Marshall Greenblatt reporter

    chrome: Support configuration of user agent and locale (see issue #2969)

    This change adds support for CefSettings and command-line configuration of user_agent, user_agent_product (formerly product_version) and locale.

    → <<cset 02ae4597d8b6>>

  46. Marshall Greenblatt reporter

    chrome: Support configuration of accept language (see issue #2969)

    This change adds support for CEF settings configuration of accept_language_list. If specified, this value will take precedence over the "intl.accept_languages" preference which is controlled by chrome://settings/languages.

    → <<cset 3ab91a45c993>>

  47. Marshall Greenblatt reporter

    chrome: Support configuration of accept language (see issue #2969)

    This change adds support for CEF settings configuration of accept_language_list. If specified, this value will take precedence over the "intl.accept_languages" preference which is controlled by chrome://settings/languages.

    → <<cset ddf5446588e8>>

  48. Marshall Greenblatt reporter

    chrome: Support configuration of accept language (see issue #2969)

    This change adds support for CEF settings configuration of accept_language_list. If specified, this value will take precedence over the "intl.accept_languages" preference which is controlled by chrome://settings/languages.

    → <<cset 044c82849e23>>

  49. Marshall Greenblatt reporter

    Restore support for CreateBrowserSync with NULL |request_context| (see issue #2969)

    This was unintentionally lost during the Chrome runtime refactoring effort.

    → <<cset 5ddd26e48370>>

  50. Marshall Greenblatt reporter

    Restore support for CreateBrowserSync with NULL |request_context| (see issue #2969)

    This was unintentionally lost during the Chrome runtime refactoring effort.

    → <<cset 719b66a9e543>>

  51. Marshall Greenblatt reporter

    Restore support for CreateBrowserSync with NULL |request_context| (see issue #2969)

    This was unintentionally lost during the Chrome runtime refactoring effort.

    → <<cset 3c44b04c4ebe>>

  52. Marshall Greenblatt reporter

    chrome: Show non-CefBrowserView browser windows on creation (see issue #2969)

    Browser windows created via CefBrowserHost::CreateBrowser should be shown at creation time. These windows receive default Chromium styling, unlike CefBrowserView windows which may contain other client-specified Views and where show state can be configured via CefWindowDelegate::GetInitialShowState or by calling CefWindow::Show.

    → <<cset 7f0c88b5da73>>

  53. Marshall Greenblatt reporter

    chrome: Fix DCHECK when a temporary CefFrame is destroyed (see issue #2969)

    The temporary CefFrame is created in NavigationOnUIThread during PDF loading.

    → <<cset f3cea7e7df51>>

  54. Marshall Greenblatt reporter

    chrome: Add support for PdfViewerTest ceftests (see issue #3047)

    We need to override ChromeMimeHandlerViewGuestDelegate to handle OnGuestAttached/Detached callbacks in order to account for the guest renderer process hosting the PDF extension.

    Additional work will be required to account for the renderer process hosting the PDF viewer when using --enable-features=PdfUnseasoned (see issue #2969).

    → <<cset 6eff48e9ff84>>

  55. Log in to comment