1732 Commits

Author SHA1 Message Date
Marshall Greenblatt
81a5005bc0 Add NUM_VALUES for enums and size for structs (see #3836)
API versioning requires that enumerations end with a count value
(`*_NUM_VALUES`) and structs begin with a size value (`size_t size`).
Wrapper templates are updated to support structs with different size
values indicating different versions.

To test:
Run `ceftests --gtest_filter=ApiVersionTest.StructVersion*`
2025-01-14 12:56:21 -05:00
Marshall Greenblatt
ee5cec12d2 Move generated includes to the gen directory 2025-01-09 12:03:07 -05:00
Marshall Greenblatt
de5324ef05 Make feature target names more explicit 2025-01-09 11:30:17 -05:00
Marshall Greenblatt
7be2558291 Update to Chromium version 133.0.6943.0 (#1402768) 2025-01-08 17:19:43 -05:00
Marshall Greenblatt
7588c9dcbf Fix V8Test.OnUncaughtExceptionDevTools failure (see #3867)
Ignore multiple calls to OnContextCreated when the DevTools window
is open.

Simplify the related implementation in MessageListenerCallbackImpl
(should be a behavioral no-op).
2025-01-08 17:19:43 -05:00
Marshall Greenblatt
dd81904a2f Add initial support for API versioning (see #3836)
- Generated files are now created when running cef_create_projects or
  the new version_manager.py tool. These files are still created in the
  cef/ source tree (same location as before) but Git ignores them due to
  the generated .gitignore file.
- API hashes are committed to Git as a new cef_api_versions.json file.
  This file is used for both code generation and CEF version calculation
  (replacing the previous usage of cef_api_hash.h for this purpose).
  It will be updated by the CEF admin before merging breaking API
  changes upstream.
- As an added benefit to the above, contributor PRs will no longer
  contain generated code that is susceptible to frequent merge conflicts.
- From a code generation perspective, the main difference is that we now
  use versioned structs (e.g. cef_browser_0_t instead of cef_browser_t)
  on the libcef (dll/framework) side. Most of the make_*.py tool changes
  are related to supporting this.
- From the client perspective, you can now define CEF_API_VERSION in the
  project configuration (or get CEF_EXPERIMENTAL by default). This
  define will change the API exposed in CEF’s include/ and include/capi
  header files. All client-side targets including libcef_dll_wrapper
  will need be recompiled when changing this define.
- Examples of the new API-related define usage are provided in
  cef_api_version_test.h, api_version_test_impl.cc and
  api_version_unittest.cc.

To test:
- Run `ceftests --gtest_filter=ApiVersionTest.*`
- Add `cef_api_version=13300` to GN_DEFINES. Re-run configure, build and
  ceftests steps.
- Repeat with 13301, 13302, 13303 (all supported test versions).
2025-01-08 17:19:43 -05:00
Marshall Greenblatt
7dd2398be2 Update to Chromium version 133.0.6886.0 (#1393452) 2024-12-10 12:46:29 -05:00
Marshall Greenblatt
5fcb2d36e5 win: Disable crash metrics collection (fixes #3847) 2024-12-04 13:09:21 -05:00
Andrew Kurushin
2dd1d1f94b osr: win: Implement page scroll mode (fixes #3849) 2024-12-04 11:25:39 -05:00
reito
189b247282 osr: Add more info in accelerated callback (fixes #3730) 2024-12-04 10:44:33 -05:00
Marshall Greenblatt
35fc888c72 Improve timing of frame attach/detach (see #3664)
- Move frame attachment from RenderFrameCreated to
  DidCommitProvisionalLoad. This has a number of advantages:
  - Significantly reduces the frequency of disconnects by avoiding
    the GetInterface/DidCommitNavigation race condition.
  - Stops connecting temporary frames (created during cross-origin
    navigation), making callback behavior more consistent.
- Split frame detach and destruction notifications into separate
  callbacks. OnFrameDetached now reflects a potentially recoverable
  state. Add a new OnFrameDestroyed callback for the unrecoverable
  destruction state.
2024-12-04 10:44:33 -05:00
Marshall Greenblatt
7f253f83a2 Reduce the frequency of connection-related renderer crashes (see #3664)
- Use ResetWithReason to report intentional browser side disconnects of
  existing Mojo connections. Don't retry for those disconnects.
- Add set_disconnect_with_reason_and_result_handler in Chromium/Mojo to
  expose the MojoResult code for failed connections, allowing
  identification of connections that are intentionally unbound on the
  browser side.
- Optimize initial reconnect delay for known disconnect cases such as
  navigation-related and bfcache changes.
- Remove connection timeout and increase total connection deadline by
  100% to further reduce crash rates on slower machines.
- Only fail fatally for main frames (not sub-frames) in cases where the
  connection fails or disconnects for unknown reasons.
- Improve connection debug logging when running with
  `--enable-logging --vmodule=*frame*=1 --log-file=C:\temp\log.txt`
2024-12-02 16:16:42 -05:00
Marshall Greenblatt
179cb8bedb Disable prerendering (see #3664)
This is not currently supported by CEF's frame tracking model.
2024-11-21 15:39:10 -05:00
Marshall Greenblatt
3acb352bc7 Improve logging of fatal renderer connection errors (see #3664) 2024-11-21 15:38:33 -05:00
Marshall Greenblatt
89ab864065 tests: Fix HSTS-related test failures 2024-11-15 13:57:38 -05:00
Marshall Greenblatt
34dbad30db Update to Chromium version 132.0.6834.0 2024-11-15 11:38:37 -05:00
Marshall Greenblatt
e513077eac Add notification for aborted popups (fixes #3776)
Pass a new |popup_id| parameter to OnBeforePopup and call a new
OnBeforePopupAborted callback if the popup is aborted before
OnAfterCreated is called for the popup browser. Add new
CefBrowserHost::GetBrowserByIdentifier and GetOpenerIdentifier
methods to assist with retrieval of associated browsers.

In cefclient, clean up state when a popup is aborted and close
any associated popup browsers when the opener browser is closed.
This also works when running with `--use-default-popup`.
2024-11-13 14:13:29 -05:00
Marshall Greenblatt
b660522983 views: Fix Chrome style browser RequestFocus behavior (fixes #3819)
Fix implementation of CefBrowserView::RequestFocus for Chrome style
browsers. Match Alloy style behavior of requesting browser focus
(calling OnSetFocus) after initial navigation. Add CefView::HasFocus
and CefWindow::GetFocusedView that can be used in combination with
CefWindow::IsActive to determine global keyboard focus.

Update sample applications for the new behavior.

In cefclient:
- Browser receives initial focus via ViewsWindow::RequestBrowserFocus.
- When running with `--show-overlay-browser` (see #3790):
  - Give initial focus to the overlay browser.
  - Change the overlay popout shortcut to CTRL+SHIFT+O to avoid
    assigning focus to the menu in the main window.
  - Switching from overlay in the main window to popout browser
    window will give focus to the popout browser.
  - Switching from popout browser to overlay will leave current focus
    unchanged (e.g. in the overlay browser, or somewhere else). User
    gesture to activate the main window may be required on Mac/Linux.
- When running with `--no-active` don't give initial focus to either
  browser.

In cefsimple:
- Browser receives initial focus via default handling.
2024-11-06 13:20:02 -05:00
Marshall Greenblatt
be11f21131 Free CefMenuRunnerViews on BrowserView destruction (see #3790)
CefMenuRunnerViews holds a raw_ptr<CefBrowserViewImpl> that must be
cleared during CefBrowserViewImpl destruction.
2024-11-04 17:09:01 -05:00
Marshall Greenblatt
43fc50a89e mac: Fix accelerators in overlay BrowserView (see #3188)
CefWindowImpl::CanHandleAccelerators was returning false for
accelerators triggered in the overlay BrowserView due to
IsWindowKey (called from NativeWidgetMac::IsActive) returning
false. View::CanHandleAccelerators, on the other hand, only
checks IsActive for Aura (non-MacOS) windows. We therefore
delegate to the View implementation for consistent handling.
2024-11-04 14:17:37 -05:00
Marshall Greenblatt
0255c2e7ac Execute HandleExternalProtocolHelper on the UI thread (fixes #3821) 2024-11-04 11:44:48 -05:00
Marshall Greenblatt
a05b959543 win: Disable TcpSocketIoCompletionPortWin feature
This feature breaks embedded test servers. See
https://crbug.com/40287434#comment36 for background.
2024-10-25 13:15:34 -04:00
Marshall Greenblatt
173a2f4a58 Update to Chromium version 131.0.6778.0 (#1368529) 2024-10-24 14:50:11 -04:00
Nik Pavlov
5d817b20a6 Update to Chromium version 131.0.6768.0 (#1366576)
mac: Switch to Xcode 16.0 16A242d with macOS SDK 15.0 24A336
2024-10-24 11:24:17 -04:00
Michael Bragg
a787036a8a Add CefFrame::PasteAndMatchStyle 2024-10-23 13:24:10 -04:00
Hunter Laux
fc20e76d3b Implement OnSelectClientCertificate (fixes #3789) 2024-10-23 13:09:32 -04:00
Marshall Greenblatt
00e9b561f8 Fix raw_ptr leak of main frame RFH during WebContents close (see #3660) 2024-10-22 16:08:55 -04:00
Mike Bragg
02fec23bc8 Implement PrintCrossProcessSubframe for AlloyBrowserHostImpl (fixes #3768) 2024-10-22 20:05:16 +00:00
Marshall Greenblatt
6f44cfcb65 linux: Fix callbacks to CefPrintHandler (fixes #3729)
Out-of-process printing must also be disabled by passing
`--disable-features=EnableOopPrintDrivers`.
2024-10-18 11:51:08 -04:00
Marshall Greenblatt
da7e19d0ea cefclient: views: Add ability to pop out the overlay Browser (see #3790)
When running with the overlay Browser enabled (`--show-overlay-browser`),
pressing Alt+O will move the overlay Browser to a new top-level Window.
Pressing Alt+O again or closing the new Window via the close button will
return the Browser to the overlay. Closing the Browser via `window.close()`
(in the new Window or overlay) will dismiss the overlay completely as
required to maintain consistent internal state. Detection of this state is
supported by the new CefBrowserHost::IsReadyToBeClosed method.

Draggable regions in the main Browser are updated to account for the
presence or absence of the overlay Browser. Support for draggable regions
in the overlay Browser in not implemented in cefclient.

Behavior with multiple overlays, `window.close()` and draggable regions
can be tested by adding `--hide-frame --hide-controls`.
2024-10-17 12:21:07 -04:00
Marshall Greenblatt
6e05c14db2 chrome: Support unload handlers with TryCloseBrowser
TryCloseBrowser should potentially trigger JavaScript unload handlers
and return false. Add CefBrowserHost::IsReadyToBeClosed for detecting
mandatory close state. Enable, for Chrome style browsers, LifeSpanTest
that don't require DoClose(). Update related documentation.
2024-10-17 11:06:08 -04:00
Marshall Greenblatt
265a733807 views: Fix dangling raw_ptr on CefToolbarViewView destruction 2024-10-15 17:53:39 -04:00
Marshall Greenblatt
884b582789 views: Trigger CefBrowser destruction on CefBrowserView release (see #3790)
Avoid a circular ownership dependency between CefBrowserViewImpl and
CefBrowserPlatformDelegate[Chrome]Views (owned by CefBrowserHostBase).
Trigger CefBrowserHostBase destruction when the last CefBrowserViewImpl
reference is released.

This fixes a number of shutdown crashes related to overlay CefBrowsers
still existing at CefShutdown.
2024-10-15 15:44:13 -04:00
Marshall Greenblatt
b974438cfc Fix DiscardableSharedMemoryManager destruction timing
Move DiscardableSharedMemoryManager destruction to the end of UI thread
shutdown, after Mojo messages have stopped arriving. See related comments
at https://chromium-review.googlesource.com/c/chromium/src/+/5925441
2024-10-15 14:30:26 -04:00
Marshall Greenblatt
1bc1ca15d5 cefclient: views: Add overlay BrowserView demo (see #3790)
Adds new `--show-overlay-browser` command-line flag that creates an
overlay containing an Alloy-style BrowserView.  The main BrowserView
may be Chrome- (default) or Alloy-style (add `--use-alloy-style`).
This overlay will only be added to standalone (non-popup) windows.

Popups triggered via the overlay will receive standard Alloy-style
handling in cefclient (e.g. Views-hosted window). Add
`--use-default-popup` for default popup handling.
2024-10-15 14:30:26 -04:00
Marshall Greenblatt
e23bf31bf4 views: Fix style calculation for popup BrowserViews (fixes #3499)
Don't depend on a CefBrowserViewDelegate for popup BrowserView style.
Popup style must always match the opener style.
2024-10-15 14:30:26 -04:00
Nik Pavlov
0a627230ac views: Fix overlay bounds outside of window (fixes #3457) 2024-10-15 18:28:13 +00:00
Nik Pavlov
29ef97d6b5 mac: views: Always initialize CommandDispatcher (see #3188)
ChromeCommandDispatcherDelegate forwards accelerator events to
the FocusManager through NativeWidgetMacNSWindowHost::
HandleAccelerator. Always initialize it so that accelerators also
work in a CefWindow without a BrowserView.
2024-10-15 17:58:23 +00:00
Marshall Greenblatt
cd052ec7c3 Update to Chromium version 130.0.6723.0 (#1356013) 2024-09-27 14:15:44 +00:00
Jacobo Aragunde Pérez
6459917c0a Fix index out of bounds with dialog accept_types description (fixes #3779) 2024-09-16 09:08:22 +00:00
Nik Pavlov
b90f0048da Account for overlay host Widget in CefWidget::GetForWidget (fixes #3784) 2024-09-16 09:05:42 +00:00
Nik Pavlov
af1f40a2d3 Update to Chromium version 129.0.6668.0
- Mac: Minimum system version is now 11.0.
- Win: Windows SDK version is now 10.0.22621.2428.
2024-08-26 12:44:25 +00:00
Marshall Greenblatt
701c9470f2 Route Download bubble file open to OnOpenURLFromTab (fixes #3750)
Some downloaded file types [1] default to opening in a Browser. Open
requests for these file types originating from the Download bubble UI
should route to the source Browser (call OnOpenURLFromTab). If
OnOpenURLFromTab is unhandled proceed with the default Chrome behavior
of opening the URL in a new default Browser.

[1] PDF, html, etc. For the complete list of file types see
ChromeDownloadManagerDelegate::IsOpenInBrowserPreferredForFile.
2024-08-09 12:07:00 -04:00
Marshall Greenblatt
889cfcf8d1 Fix path override ordering (fixes #3749)
The chrome::DIR_RESOURCES and ui::DIR_LOCALES overrides need to be
configured before calling ChromeMainDelegate::PreSandboxStartup.
2024-08-08 13:39:22 -04:00
Marshall Greenblatt
ebb3c962da Add WebUI allowlist for Alloy-style browsers (fixes #3763) 2024-08-07 14:12:31 -04:00
JC Yang
bed7f420aa Fix dangling ptr in ReadResponseCallbackWrapper (fixes #3760) 2024-08-05 12:36:28 -04:00
Loic Frasse-Mathon
785713c4cc posix: Added option to disable signal handlers
See https://github.com/chromiumembedded/java-cef/issues/477
2024-08-05 12:36:28 -04:00
Pedro de Carvalho Gomes
b61c106b6b linux: Add CefWindowDelegate::GetLinuxWindowProperties (fixes #3383) 2024-08-05 12:36:28 -04:00
Nik Pavlov
295ea1f715 Enable V8 sandbox by default (fixes #3332)
When the V8 sandbox is enabled, ArrayBuffer backing stores must be
allocated inside the sandbox address space. This change introduces a new
CefV8Value::CreateArrayBufferWithCopy method that copies the memory
contents into the sandbox address space.

Enabling the V8 sandbox can have a performance impact, especially when
passing large ArrayBuffers from C++ code to the JS side. We have therefore
retained the old CefV8Value::CreateArrayBuffer method that references
external memory. However, this method can only be used if the V8 sandbox is
disabled at CEF/Chromium build time.

To disable the V8 sandbox add `v8_enable_sandbox=false` to
`GN_DEFINES` when building CEF/Chromium.
2024-08-05 16:00:58 +00:00
Marshall Greenblatt
446b7d6535 Update to Chromium version 128.0.6613.0 (#1331488) 2024-07-30 11:10:09 -04:00