Compare commits

..

83 Commits
3904 ... 3945

Author SHA1 Message Date
Marshall Greenblatt
ecefb59aa8 Add missing current_view_bounds_ member (see issue #2733) 2020-02-22 12:31:41 -05:00
Marshall Greenblatt
b05ffc446b Fix OSR surface sizing on browser resize (fixes issue #2733).
This includes the following changes:
- Update usage of surface IDs to match the Aura implementation from the
  RWHVAura/Window classes.
- Batch CefBrowserHost::WasResized calls to avoid excessive/unnecessary calls
  to SynchronizeVisualProperties.
- Cache the results of CefRenderHandler::GetViewRect after resize and make
  RWHVOSR::GetViewBounds the source of truth for all size calculations.
- Fix bounds calculations in CefVideoConsumerOSR with GPU enabled.

Known issues:
- The size passed to OnPaint may be off by 1 pixel in cases where the device
  scale factor is not 1 and does not divide evenly into the pixel size. This is
  due to the inexact conversion from integer pixel size to integer logical size
  for GetViewRect.
2020-02-21 15:03:26 -05:00
Marshall Greenblatt
90301bdb7f Fix race between OpenInputStreamWrapper Open and Cancel (fixes issue #2843) 2020-01-29 17:37:53 -05:00
Marshall Greenblatt
febbb4adb7 cefsimple: Fix sizing of popup windows with --use-views (see issue #2854) 2020-01-27 20:39:16 -05:00
Marshall Greenblatt
5dd41fd1c1 Update to Chromium version 79.0.3945.130 2020-01-27 18:47:49 -05:00
Marshall Greenblatt
5ee40133ac Linux: Fix crashes on main window close (fixes issue #2831)
Call DesktopWindowTreeHostPlatform::Close after destroying CEF's X11 window
so that objects owned by the WindowTreeHost (Compositor, X11Window, etc) are
properly cleaned up.
2020-01-27 17:43:35 -05:00
Marshall Greenblatt
1d805e5357 macOS: Disable toolchain prompt for tests (see issue #2692) 2020-01-27 17:43:09 -05:00
Marshall Greenblatt
fc9ef34529 Linux: Add CEF_INSTALL_SYSROOT env variable for calling install-sysroot.py (see issue #1990) 2020-01-16 15:22:03 +01:00
Marshall Greenblatt
f3796e2964 Fix crash due to NULL frame during navigation (fixes issue #2772) 2020-01-16 11:21:29 +01:00
Marshall Greenblatt
a5bf6d5484 Fix potential crash in OpenInputStreamWrapper::Open (fixes issue #2808) 2020-01-15 16:47:16 +01:00
Marshall Greenblatt
f272726527 Windows: cmake: Add VS2019 version 16.4 2020-01-14 16:22:56 +01:00
Marshall Greenblatt
d2449e563c Fix tarfile issues by using GNU_FORMAT with Python 3.8 (see issue #2856) 2020-01-14 11:19:45 +01:00
Marshall Greenblatt
50b44dcfea fix_style: Add Python 3 support (see issue #2856) 2020-01-13 21:45:22 +01:00
Marshall Greenblatt
cb2b46f6d7 crash_server: Add Python 3 support (see issue #2856) 2020-01-13 21:45:14 +01:00
Marshall Greenblatt
1dbdf7b9cb gn_args: Fix representation of int-type GN_DEFINES values (see issue #2856) 2020-01-13 17:02:15 +01:00
Marshall Greenblatt
71efeca335 gn_args: Fix Python 3 AttributeError: 'module' object has no attribute 'exc_clear' (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
cc2fc7eaff Use explicit check for python version (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
f527bf312c build: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
f24e1caec9 gclient_hook: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
6dbe2b782f Fix Python 2 TypeError: write() argument 1 must be unicode, not str (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
716121c74a make_distrib: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
29cbaf7e21 Fix incorrectly translated types in capi header comments (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
ca65ff02c4 translator: Add Python 3 support (see issue #2856)
This also fixes incorrect translation of types in capi header comments.
2020-01-13 17:02:14 +01:00
Marshall Greenblatt
b06a408e7f cef_version: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
5eeb26cb76 patch_updater: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
70c5db44d1 patcher: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
d2de1468d8 gn_args: Add Python 3 support (see issue #2856) 2020-01-13 17:02:14 +01:00
Marshall Greenblatt
497033bd8a cefbuilds: Add Python 3 support (see issue #2856) 2020-01-13 17:02:10 +01:00
Yong Li
7ec49fabd5 Remove possibly incorrect CHECK in ProxyURLLoaderFactory::MaybeDestroySelf()
See also commit #81064faa.
2020-01-08 17:11:24 +02:00
Andrei Kurushin
8c1ac9dc42 Fix OSR popup view mouse wheel double event (fixes issue #2547) 2020-01-08 17:02:22 +02:00
Marshall Greenblatt
b3bb1273fe Update to Chromium version 79.0.3945.117 2020-01-08 16:36:27 +02:00
Riku Palomäki
fae3bd1f16 Ignore OSR paint events on hidden views (fixes issue #2817) 2020-01-08 14:41:27 +02:00
Riku Palomäki
a86d586b9f Fix routing of OSR input events inside iframes (fixes issue #2789)
Mouse events need to be routed to the correct view and
CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView needs to be
properly implemented for
RenderWidgetHostInputEventRouter::DispatchTouchscreenGestureEvent to
transform event position in the target widget.
2020-01-08 14:41:20 +02:00
elad bahar
767a901be2 Fix OSR rendering recovery after GPU process crash (fixes issue #2827) 2020-01-08 12:33:57 +00:00
Marshall Greenblatt
d3604dea82 Windows: Build the double_conversion target as C++17 (fixes issue #2819)
This works around a bug in the Visual C++ standard library where the
std::is_integral templates are exported instead of inlined when building
with C++14. See also https://bugs.llvm.org/show_bug.cgi?id=42027.
2020-01-07 15:11:25 +02:00
Marshall Greenblatt
a5342ed51c Only create Documents\Downloads dir if necessary (fixes issue #2841) 2020-01-06 17:00:01 +02:00
Marshall Greenblatt
de7b51479e Fix crash when loading a file URL if using CefCookieAccessFilter (fixes issue #2818) 2020-01-06 14:48:11 +02:00
Marshall Greenblatt
3455686ac7 Fix crash when running with --disable-extensions (fixes issue #2852) 2020-01-06 14:21:30 +02:00
Marshall Greenblatt
cded9f4db3 Update copyright year 2020-01-06 12:05:16 +02:00
Marshall Greenblatt
e866a07123 Update to Chromium version 79.0.3945.88 2019-12-31 19:50:39 +02:00
Marshall Greenblatt
ba025c621c Windows: Fix ImportError: No module named win32file (see https://crbug.com/1033106) 2019-12-31 18:50:40 +02:00
Andy Tzeng
6ef19fd061 Check for non-empty string before writing to logger (fixes issue #2825) 2019-12-31 17:49:27 +02:00
Marshall Greenblatt
e8680c0482 Convert usage and tests to the new CefResourceHandler API (see issue #2622)
Limited test coverage for the old API is still available by passing the
`--test-old-resource-api` command-line flag to ceftests.
2019-12-31 16:52:52 +02:00
Marshall Greenblatt
c10886dc25 Fix shutdown crash in InitNetworkContext with multi-threaded message loop (fixes issue #2703) 2019-11-26 16:30:53 -05:00
Riku Palomäki
76da0744f0 Fix OSR scrolling by passing our compositor to the fling scheduler (fixes issue #2745) 2019-11-26 14:05:53 -05:00
Riku Palomäki
d12e990737 Fix crash when resizing an OSR browser window (fixes issue #2614)
(cherry picked from commit feffedbae9)
2019-11-26 14:05:47 -05:00
Masako Toda
0b5365f822 Pass the raw size of pixel data instead of valid area (fixes issue #2733) 2019-11-26 13:30:50 -05:00
Marshall Greenblatt
f4d74643b0 Fix potential OSR crash due to uninitialized host_display_client_ (see issue #2811) 2019-11-26 13:30:44 -05:00
Marshall Greenblatt
eb5fe4ee13 Update to Chromium version 79.0.3945.36 2019-11-19 19:17:53 -05:00
Marshall Greenblatt
f9706f260a Windows: cefclient: Fix assertions with --use-views --multi-threaded-message-loop 2019-11-19 13:29:41 -05:00
Marshall Greenblatt
319de22d89 Allow CefImage usage from any thread 2019-11-19 13:29:33 -05:00
Daniel Nitsche
115f760821 Update to Chromium version 79.0.3945.1 (#706915) 2019-11-19 13:22:13 -05:00
Marshall Greenblatt
b9fc93955c Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded message loop (fixes issue #2798) 2019-11-06 16:29:34 -05:00
Marshall Greenblatt
f2756b5318 Update API hashes for changes in commit 65f97a6 2019-11-06 15:44:19 -05:00
Marshall Greenblatt
3a8778e2f8 Remove NOTREACHED in CefPostDataElementImpl::Set (fixes issue #2765) 2019-11-06 14:00:38 -05:00
Marshall Greenblatt
58e17b3cdc Fix crash in RemoveFrame on unknown frame_tree_node_id (fixes issue #2799) 2019-11-06 13:17:18 -05:00
Marshall Greenblatt
cc6f285abd Fix GN undefined identifier error on non-Linux platforms 2019-11-05 16:17:10 -05:00
Thomas Preston
04c9bcd802 Linux: Add cef_use_gtk GN variable to optionally disable GTK configuration.
GTK is required to build the cefclient sample application but is not otherwise
required by CEF. This option allows builders to avoid configuring GTK when
building outside of the sysroot environment (with use_sysroot=false). It defaults to false when building inside the sysroot environment.
2019-11-05 21:12:20 +00:00
Marshall Greenblatt
c8d0813669 Restore expected Accept-Language request header order (fixes issue #2796) 2019-11-05 15:29:32 -05:00
Riku Palomäki
9b9a9f359e Linux: Load *.bin files from DIR_ASSETS (see issue #1936) 2019-11-01 14:19:48 +00:00
Marshall Greenblatt
b51a4de540 Windows: Fix cef_sandbox.lib link errors (fixes issue #2792) 2019-10-29 17:31:17 -04:00
Marshall Greenblatt
65f97a60ad Remove the enable-net-security-expiration option (see issue #2622)
The implementation of this option was removed in commit 67b61c4. Certificate
transparency is disabled by default for Chromium embedders. Details at:

https://chromium.googlesource.com/chromium/src/+/master/net/docs/certificate-transparency.md#Supporting-Certificate-Transparency-for-Embedders
2019-10-29 11:36:29 -04:00
Marshall Greenblatt
4f07cba011 Windows: Fix type conversion warning with 64-bit MSVC.
request_handler_unittest.cc(448,55): warning C4267: 'argument':
conversion from 'size_t' to 'int', possible loss of data
2019-10-21 15:34:50 +02:00
Marshall Greenblatt
aad4bf2464 cefclient: Move StringResourceMap to ClientHandler (see issue #2586)
Fixes a DCHECK when creating multiple windows in cefclient due to the creation
of multiple StringResourceProvider objects.
2019-10-18 15:30:56 +02:00
Marshall Greenblatt
329facfbdf cefclient: Fix crash when removing extension resource path prefix.
To test: Run `cefclient.exe --use-views --load-extension=set_page_color`
2019-10-18 15:08:32 +02:00
Marshall Greenblatt
a4b6ef577e Don't set "always on top" style for child CefWindows.
As of https://crrev.com/9e653328e3 the Views framework will apply the "always
on top" (WS_EX_TOPMOST) style by default to widgets created with TYPE_MENU. CEF
uses this type in CefWindowView::CreateWidget to support child windows that are
not clipped to the parent window bounds (currently indicated by returning a
parent window from CefWindowDelegate::GetParentWindow and setting |is_menu| to
true).

Not setting "always on top" shouldn't be a problem except in cases where some
other window is already "always on top" and the child CefWindow is expected to
overlay that window. For this reason any menus created using ShowMenu will
continue to have the "always on top" style.
2019-10-18 15:08:23 +02:00
Marshall Greenblatt
01e75761d3 Remove incorrect DCHECK
There are valid cases where |frame_tree_node_id| may not match the node ID
reported by the selected RenderFrameHost.
2019-10-18 15:08:16 +02:00
Marshall Greenblatt
737ff18498 Remove CefFrame::LoadString method (fixes issue #2586)
This method has not behaved as expected for some time.
2019-10-15 17:34:16 +02:00
Marshall Greenblatt
d28efe8797 Add warning to LoadRequest about INVALID_INITIATOR_ORIGIN (213) failure condition (see issue #2586) 2019-10-15 15:11:46 +02:00
Marshall Greenblatt
b560f04046 Fix printing from iframes (fixes issue #2753) 2019-10-15 13:52:26 +02:00
Marshall Greenblatt
066762217f Add picture-in-picture support for video (fixes issue #2776) 2019-10-15 11:11:59 +00:00
Marshall Greenblatt
1a661a2d15 macOS: cefsimple: Add missing AppKit.framework dependency to GN config 2019-10-14 17:46:54 +02:00
Marshall Greenblatt
aefe9a4195 macOS: Fix Jumbo/component build dependency issue.
Fixes the following error:

In file included from gen/chrome/browser/safe_browsing/safe_browsing_jumbo_1.cc:34:
In file included from ./../../chrome/browser/safe_browsing/download_protection/binary_fcm_service.cc:15:
../../components/gcm_driver/gcm_profile_service.h:18:10: fatal error: 'components/gcm_driver/gcm_buildflags.h' file not found
2019-10-14 17:46:54 +02:00
Mike Wiedenbauer
1d515adc22 Modify CefResponse header methods to match CefRequest API (fixes issue #2770) 2019-10-14 13:49:05 +02:00
Marshall Greenblatt
9cdda243a1 cefsimple: Use data URI instead of LoadString for error messages (see issue #2586) 2019-10-10 11:10:28 +03:00
Marshall Greenblatt
22746985f2 Fix crashes with --disable-extensions (fixes issue #2777) 2019-10-07 11:22:46 +03:00
Marshall Greenblatt
76368bda60 Remove WebUITest.credits because it always times out 2019-10-04 17:59:18 +03:00
Marshall Greenblatt
88ecf49549 Windows: Fix ViewsWindowTest failures due to incorrect client area size (fixes issue #2775)
These tests expect the window's client area size to be (kWSize, kWSize). Use
::AdjustWindowRect to offset TestWindowDelegate's preferred size so that the
client area size is correct after the OS internally applies frame insets during
::CreateWindow.

To test: Run `ceftests.exe --gtest_filter=ViewsWindowTest.Window*`.
All tests should pass.
2019-10-04 17:24:01 +03:00
Marshall Greenblatt
e7b66aa43a Increase URLRequestTest CloseBrowser timeout to reduce flakes (fixes issue #2756)
Tests for incomplete request behavior use a timeout to trigger CloseBrowser
and terminate the test case. Recent architectural changes in Chromium have
likely increased the minimum delay required to spin up a working browser
instance and initiate the request. Consequently we need to wait longer before
closing the browser.

To test:
Run `ceftests --gtest_filter=URLRequestTest.*Incomplete* --gtest_repeat=5`.
All test runs should succeed.
2019-10-04 15:46:27 +03:00
Maksim Sisov
152141d7f4 Remove NOTREACHED that triggers on ozone platforms.
Native frames are not guaranteed to be supported on Ozone/Wayland.
2019-10-04 10:57:29 +00:00
Marshall Greenblatt
466f5e23db Add chrome://process-internals support (see issue #2498) 2019-10-04 13:29:35 +03:00
Marshall Greenblatt
eea1f6be63 Enable strict site isolation by default (see issue #2498)
This restores the default site isolation mode for Chromium on desktop
platforms. Unit tests have been updated to reflect the new behavior
expectations.

Known behavior changes in CEF are as follows:
- A spare renderer process may be created on initial browser creation or cross-
  origin navigation. This spare process may be used with a future cross-origin
  navigation or discarded on application shutdown. As a result
  CefRenderProcessHandler::OnRenderThreadCreated, which is called shortly after
  renderer process creation, can no longer be used to reliably transfer state
  for the currently in-progress navigation. Unit tests have been updated to use
  the CreateBrowser/OnBeforePopup |extra_info| value for transferring test state
  to CefRenderProcessHandler::OnBrowserCreated which will be called in the
  correct/expected renderer process.
- Cross-origin navigations will again receive a new renderer process, as
  expected. This behavior had briefly regressed in M78 due to the
  ProcessSharingWithDefaultSiteInstances feature becoming enabled by default.
- Cross-origin navigations initiated by calling LoadURL in the renderer process
  will now crash that process with "bad IPC message" reason
  INVALID_INITIATOR_ORIGIN (213). This is a security feature implemented in
  Chromium.
- A DevTools browser created using CefBrowserHost::ShowDevTools will receive
  the same CefRenderProcessHandler::OnBrowserCreated |extra_info| value that was
  set via CreateBrowser/OnBeforePopup for the parent browser.
2019-10-03 17:18:01 +03:00
Marshall Greenblatt
5da1649653 macOS: cmake: Prevent Xcode 11 from doing automatic codesigning. 2019-10-03 11:26:55 +03:00
191 changed files with 3297 additions and 1840 deletions

View File

@@ -1462,9 +1462,9 @@ make_pack_header("strings") {
"$root_gen_dir/chrome/grit/locale_settings.h",
"$root_gen_dir/chrome/grit/platform_locale_settings.h",
"$root_gen_dir/components/strings/grit/components_strings.h",
"$root_gen_dir/content/app/strings/grit/content_strings.h",
"$root_gen_dir/extensions/strings/grit/extensions_strings.h",
"$root_gen_dir/services/strings/grit/services_strings.h",
"$root_gen_dir/third_party/blink/public/strings/grit/blink_strings.h",
"$root_gen_dir/ui/strings/grit/ui_strings.h",
]
}

View File

@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'refs/tags/78.0.3904.108'
'chromium_checkout': 'refs/tags/79.0.3945.130'
}

View File

@@ -58,6 +58,7 @@
'content/shell/utility/shell_*',
'extensions/shell/*',
'net/cookies/cookie_store.h',
'ui/base/ui_base_features.cc',
],
# Patterns that should not be found in the chromium/src directory after
# applying patch files.

View File

@@ -36,9 +36,9 @@ template("_repack_one_locale") {
"${root_gen_dir}/chrome/platform_locale_settings_${locale}.pak",
"${root_gen_dir}/components/strings/components_locale_settings_${locale}.pak",
"${root_gen_dir}/components/strings/components_strings_${locale}.pak",
"${root_gen_dir}/content/app/strings/content_strings_${locale}.pak",
"${root_gen_dir}/extensions/strings/extensions_strings_${locale}.pak",
"${root_gen_dir}/services/strings/services_strings_${locale}.pak",
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_${locale}.pak",
"${root_gen_dir}/ui/strings/app_locale_settings_${locale}.pak",
"${root_gen_dir}/ui/strings/ui_strings_${locale}.pak",
]
@@ -54,9 +54,9 @@ template("_repack_one_locale") {
"//chrome/app/resources:platform_locale_settings",
"//components/strings:components_locale_settings",
"//components/strings:components_strings",
"//content/app/strings",
"//extensions/strings",
"//services/strings",
"//third_party/blink/public/strings",
"//ui/strings:app_locale_settings",
"//ui/strings:ui_strings",
]

View File

@@ -391,6 +391,7 @@ if(OS_WINDOWS)
1921 # VS2019 version 16.1
1922 # VS2019 version 16.2
1923 # VS2019 version 16.3
1924 # VS2019 version 16.4
)
list(FIND supported_msvc_versions ${MSVC_VERSION} _index)
if (${_index} EQUAL -1)

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=85c1114638668d2b663a74844840ef50e2efa9f6$
// $hash=ba4033eaf40a8ee24408b89b78496bf1381e7e6b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@@ -829,7 +829,7 @@ typedef struct _cef_browser_host_t {
///
// Returns the extension hosted in this browser or NULL if no extension is
// hosted. See cef_request_tContext::LoadExtension for details.
// hosted. See cef_request_context_t::LoadExtension for details.
///
struct _cef_extension_t*(CEF_CALLBACK* get_extension)(
struct _cef_browser_host_t* self);
@@ -837,7 +837,7 @@ typedef struct _cef_browser_host_t {
///
// Returns true (1) if this browser is hosting an extension background script.
// Background hosts do not have a window and are not displayable. See
// cef_request_tContext::LoadExtension for details.
// cef_request_context_t::LoadExtension for details.
///
int(CEF_CALLBACK* is_background_host)(struct _cef_browser_host_t* self);

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=c18e084ad06a04096b1ce50e488cf2276211a66c$
// $hash=2f5721138da26a9d7cce300a635b58dae9f51a4a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
@@ -141,8 +141,8 @@ typedef struct _cef_cookie_manager_t {
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
// non-NULL it will be executed asnychronously on the UI thread after the
// manager's storage has been initialized. Using this function is equivalent to
// calling cef_request_tContext::cef_request_context_get_global_context()->GetDe
// faultCookieManager().
// calling cef_request_context_t::cef_request_context_get_global_context()->GetD
// efaultCookieManager().
///
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
struct _cef_completion_callback_t* callback);

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=36cf362d97cf6f68692f9d8e060cc9306b1d64b1$
// $hash=b50087959cb679e4132f0fccfd23f01f76079018$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_CAPI_H_
@@ -72,7 +72,7 @@ typedef struct _cef_extension_t {
///
// Returns the absolute path to the extension directory on disk. This value
// will be prefixed with PK_DIR_RESOURCES if a relative path was passed to
// cef_request_tContext::LoadExtension.
// cef_request_context_t::LoadExtension.
///
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_path)(struct _cef_extension_t* self);
@@ -95,7 +95,7 @@ typedef struct _cef_extension_t {
///
// Returns the handler for this extension. Will return NULL for internal
// extensions or if no handler was passed to
// cef_request_tContext::LoadExtension.
// cef_request_context_t::LoadExtension.
///
struct _cef_extension_handler_t*(CEF_CALLBACK* get_handler)(
struct _cef_extension_t* self);
@@ -103,7 +103,7 @@ typedef struct _cef_extension_t {
///
// Returns the request context that loaded this extension. Will return NULL
// for internal extensions or if the extension has been unloaded. See the
// cef_request_tContext::LoadExtension documentation for more information
// cef_request_context_t::LoadExtension documentation for more information
// about loader contexts. Must be called on the browser process UI thread.
///
struct _cef_request_context_t*(CEF_CALLBACK* get_loader_context)(
@@ -118,7 +118,7 @@ typedef struct _cef_extension_t {
///
// Unload this extension if it is not an internal extension and is currently
// loaded. Will result in a call to
// cef_extension_tHandler::OnExtensionUnloaded on success.
// cef_extension_handler_t::OnExtensionUnloaded on success.
///
void(CEF_CALLBACK* unload)(struct _cef_extension_t* self);
} cef_extension_t;

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=af959ada2c76d9868fa43b1b61a299a90b205949$
// $hash=a13b5b607d5a2108fac5fe75f5ebd2ede7eaef6a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_EXTENSION_HANDLER_CAPI_H_
@@ -53,7 +53,7 @@ struct _cef_client_t;
///
// Callback structure used for asynchronous continuation of
// cef_extension_tHandler::GetExtensionResource.
// cef_extension_handler_t::GetExtensionResource.
///
typedef struct _cef_get_extension_resource_callback_t {
///
@@ -77,7 +77,7 @@ typedef struct _cef_get_extension_resource_callback_t {
///
// Implement this structure to handle events related to browser extensions. The
// functions of this structure will be called on the UI thread. See
// cef_request_tContext::LoadExtension for information about extension loading.
// cef_request_context_t::LoadExtension for information about extension loading.
///
typedef struct _cef_extension_handler_t {
///
@@ -86,7 +86,7 @@ typedef struct _cef_extension_handler_t {
cef_base_ref_counted_t base;
///
// Called if the cef_request_tContext::LoadExtension request fails. |result|
// Called if the cef_request_context_t::LoadExtension request fails. |result|
// will be the error code.
///
void(CEF_CALLBACK* on_extension_load_failed)(
@@ -94,7 +94,7 @@ typedef struct _cef_extension_handler_t {
cef_errorcode_t result);
///
// Called if the cef_request_tContext::LoadExtension request succeeds.
// Called if the cef_request_context_t::LoadExtension request succeeds.
// |extension| is the loaded extension.
///
void(CEF_CALLBACK* on_extension_loaded)(struct _cef_extension_handler_t* self,
@@ -161,7 +161,7 @@ typedef struct _cef_extension_handler_t {
// tabId parameter (e.g. chrome.tabs.*). |extension| and |browser| are the
// source of the API call. Return the browser that will be acted on by the API
// call or return NULL to act on |browser|. The returned browser must share
// the same cef_request_tContext as |browser|. Incognito browsers should not
// the same cef_request_context_t as |browser|. Incognito browsers should not
// be considered unless the source extension has incognito access enabled, in
// which case |include_incognito| will be true (1).
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=451a33c751f88091d9421fd499f2e32d4a227fcc$
// $hash=2b01472d9b9a8cc9d1b2e669c91c2849bdb162e9$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
@@ -54,7 +54,7 @@ struct _cef_request_context_handler_t;
struct _cef_scheme_handler_factory_t;
///
// Callback structure for cef_request_tContext::ResolveHost.
// Callback structure for cef_request_context_t::ResolveHost.
///
typedef struct _cef_resolve_callback_t {
///
@@ -168,7 +168,7 @@ typedef struct _cef_request_context_t {
// Tells all renderer processes associated with this context to throw away
// their plugin list cache. If |reload_pages| is true (1) they will also
// reload all pages with plugins.
// cef_request_tContextHandler::OnBeforePluginLoad may be called to rebuild
// cef_request_context_handler_t::OnBeforePluginLoad may be called to rebuild
// the plugin list cache.
///
void(CEF_CALLBACK* purge_plugin_list_cache)(
@@ -228,7 +228,7 @@ typedef struct _cef_request_context_t {
///
// Clears all certificate exceptions that were added as part of handling
// cef_request_tHandler::on_certificate_error(). If you call this it is
// cef_request_handler_t::on_certificate_error(). If you call this it is
// recommended that you also call close_all_connections() or you risk not
// being prompted again for server certificates if you reconnect quickly. If
// |callback| is non-NULL it will be executed on the UI thread after
@@ -250,7 +250,7 @@ typedef struct _cef_request_context_t {
///
// Clears all active and idle connections that Chromium currently has. This is
// only recommended if you have released all other CEF objects but don't yet
// want to call Cefshutdown(). If |callback| is non-NULL it will be executed
// want to call cef_shutdown(). If |callback| is non-NULL it will be executed
// on the UI thread after completion.
///
void(CEF_CALLBACK* close_all_connections)(
@@ -271,8 +271,8 @@ typedef struct _cef_request_context_t {
// If extension resources will be read from disk using the default load
// implementation then |root_directory| should be the absolute path to the
// extension resources directory and |manifest| should be NULL. If extension
// resources will be provided by the client (e.g. via cef_request_tHandler
// and/or cef_extension_tHandler) then |root_directory| should be a path
// resources will be provided by the client (e.g. via cef_request_handler_t
// and/or cef_extension_handler_t) then |root_directory| should be a path
// component unique to the extension (if not absolute this will be internally
// prefixed with the PK_DIR_RESOURCES path) and |manifest| should contain the
// contents that would otherwise be read from the "manifest.json" file on
@@ -281,17 +281,17 @@ typedef struct _cef_request_context_t {
// The loaded extension will be accessible in all contexts sharing the same
// storage (HasExtension returns true (1)). However, only the context on which
// this function was called is considered the loader (DidLoadExtension returns
// true (1)) and only the loader will receive cef_request_tContextHandler
// true (1)) and only the loader will receive cef_request_context_handler_t
// callbacks for the extension.
//
// cef_extension_tHandler::OnExtensionLoaded will be called on load success or
// cef_extension_tHandler::OnExtensionLoadFailed will be called on load
// cef_extension_handler_t::OnExtensionLoaded will be called on load success
// or cef_extension_handler_t::OnExtensionLoadFailed will be called on load
// failure.
//
// If the extension specifies a background script via the "background"
// manifest key then cef_extension_tHandler::OnBeforeBackgroundBrowser will be
// called to create the background browser. See that function for additional
// information about background scripts.
// manifest key then cef_extension_handler_t::OnBeforeBackgroundBrowser will
// be called to create the background browser. See that function for
// additional information about background scripts.
//
// For visible extension views the client application should evaluate the
// manifest to determine the correct extension URL to load and then pass that

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=fe927e3bff2650b45332e053b63fb61d712313db$
// $hash=e758d8c53334b91bce818cc6e9f84915778d7827$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
@@ -87,7 +87,7 @@ typedef struct _cef_request_context_handler_t {
// |plugin_policy| to PLUGIN_POLICY_DISABLED may be cached when
// |top_origin_url| is NULL. To purge the plugin list cache and potentially
// trigger new calls to this function call
// cef_request_tContext::PurgePluginListCache.
// cef_request_context_t::PurgePluginListCache.
///
int(CEF_CALLBACK* on_before_plugin_load)(
struct _cef_request_context_handler_t* self,
@@ -113,7 +113,7 @@ typedef struct _cef_request_context_handler_t {
// handling return NULL. To specify a handler for the resource return a
// cef_resource_request_handler_t object. This function will not be called if
// the client associated with |browser| returns a non-NULL value from
// cef_request_tHandler::GetResourceRequestHandler for the same request
// cef_request_handler_t::GetResourceRequestHandler for the same request
// (identified by cef_request_t::GetIdentifier).
///
struct _cef_resource_request_handler_t*(

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f0543a081b43ad33a0e02bdf8b59207d4352ef36$
// $hash=a28219cc8c1cb53faacaf236374c3cf2c0c45bef$
//
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_HANDLER_CAPI_H_
@@ -138,8 +138,8 @@ typedef struct _cef_request_handler_t {
// be canceled. To allow the resource load to proceed with default handling
// return NULL. To specify a handler for the resource return a
// cef_resource_request_handler_t object. If this callback returns NULL the
// same function will be called on the associated cef_request_tContextHandler,
// if any.
// same function will be called on the associated
// cef_request_context_handler_t, if any.
///
struct _cef_resource_request_handler_t*(
CEF_CALLBACK* get_resource_request_handler)(
@@ -180,8 +180,8 @@ typedef struct _cef_request_handler_t {
// size via the webkitStorageInfo.requestQuota function. |origin_url| is the
// origin of the page making the request. |new_size| is the requested quota
// size in bytes. Return true (1) to continue the request and call
// cef_request_tCallback::cont() either in this function or at a later time to
// grant or deny the request. Return false (0) to cancel the request
// cef_request_callback_t::cont() either in this function or at a later time
// to grant or deny the request. Return false (0) to cancel the request
// immediately.
///
int(CEF_CALLBACK* on_quota_request)(struct _cef_request_handler_t* self,
@@ -192,7 +192,7 @@ typedef struct _cef_request_handler_t {
///
// Called on the UI thread to handle requests for URLs with an invalid SSL
// certificate. Return true (1) and call cef_request_tCallback::cont() either
// certificate. Return true (1) and call cef_request_callback_t::cont() either
// in this function or at a later time to continue or cancel the request.
// Return false (0) to cancel the request immediately. If
// CefSettings.ignore_certificate_errors is set all invalid certificates will

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=a2203cb5bfab20cd4128a11557915c22f21033b8$
// $hash=b9577b495df3990284d4e4a3db2824196175dc91$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_BUNDLE_CAPI_H_
@@ -48,7 +48,7 @@ extern "C" {
///
// Structure used for retrieving resources from the resource bundle (*.pak)
// files loaded by CEF during startup or via the cef_resource_bundle_tHandler
// files loaded by CEF during startup or via the cef_resource_bundle_handler_t
// returned from cef_app_t::GetResourceBundleHandler. See CefSettings for
// additional options related to resource bundle loading. The functions of this
// structure may be called on any thread unless otherwise indicated.

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=67463808f6bacde8afd0c0af6c4459a8981adfa2$
// $hash=afc96f188710bd336d09ce479a650aaa3a55357a$
//
#ifndef CEF_INCLUDE_CAPI_CEF_RESOURCE_REQUEST_HANDLER_CAPI_H_
@@ -87,7 +87,7 @@ typedef struct _cef_resource_request_handler_t {
// or change the resource load optionally modify |request|. Modification of
// the request URL will be treated as a redirect. Return RV_CONTINUE to
// continue the request immediately. Return RV_CONTINUE_ASYNC and call
// cef_request_tCallback:: cont() at a later time to continue or cancel the
// cef_request_callback_t:: cont() at a later time to continue or cancel the
// request asynchronously. Return RV_CANCEL to cancel the request immediately.
//
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=324e2fd030633115fb8f788da1d07496821a6f58$
// $hash=d93b4ad0b71ffe0a05326b39c3ed0bdb26a73fac$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
@@ -115,9 +115,9 @@ typedef struct _cef_scheme_handler_factory_t {
// function may be called multiple times to change or remove the factory that
// matches the specified |scheme_name| and optional |domain_name|. Returns false
// (0) if an error occurs. This function may be called on any thread in the
// browser process. Using this function is equivalent to calling cef_request_tCo
// ntext::cef_request_context_get_global_context()->register_scheme_handler_fact
// ory().
// browser process. Using this function is equivalent to calling cef_request_con
// text_t::cef_request_context_get_global_context()->register_scheme_handler_fac
// tory().
///
CEF_EXPORT int cef_register_scheme_handler_factory(
const cef_string_t* scheme_name,
@@ -128,8 +128,8 @@ CEF_EXPORT int cef_register_scheme_handler_factory(
// Clear all scheme handler factories registered with the global request
// context. Returns false (0) on error. This function may be called on any
// thread in the browser process. Using this function is equivalent to calling c
// ef_request_tContext::cef_request_context_get_global_context()->clear_scheme_h
// andler_factories().
// ef_request_context_t::cef_request_context_get_global_context()->clear_scheme_
// handler_factories().
///
CEF_EXPORT int cef_clear_scheme_handler_factories();

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=3ecfe39286ee3579eb38415ab36d3fec83712abc$
// $hash=025daa5db3bf16029953da7703e3e5968bd97fe2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_TASK_CAPI_H_
@@ -132,19 +132,19 @@ CEF_EXPORT cef_task_runner_t* cef_task_runner_get_for_thread(
///
// Returns true (1) if called on the specified thread. Equivalent to using
// cef_task_tRunner::GetForThread(threadId)->belongs_to_current_thread().
// cef_task_runner_t::GetForThread(threadId)->belongs_to_current_thread().
///
CEF_EXPORT int cef_currently_on(cef_thread_id_t threadId);
///
// Post a task for execution on the specified thread. Equivalent to using
// cef_task_tRunner::GetForThread(threadId)->PostTask(task).
// cef_task_runner_t::GetForThread(threadId)->PostTask(task).
///
CEF_EXPORT int cef_post_task(cef_thread_id_t threadId, cef_task_t* task);
///
// Post a task for delayed execution on the specified thread. Equivalent to
// using cef_task_tRunner::GetForThread(threadId)->PostDelayedTask(task,
// using cef_task_runner_t::GetForThread(threadId)->PostDelayedTask(task,
// delay_ms).
///
CEF_EXPORT int cef_post_delayed_task(cef_thread_id_t threadId,

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=1f462f42bf69d259b876c1ad8245a3e0484b3804$
// $hash=370cdeaa3252a9ed0e1a627d858dcab23af24ee1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_THREAD_CAPI_H_
@@ -49,7 +49,7 @@ extern "C" {
///
// A simple thread abstraction that establishes a message loop on a new thread.
// The consumer uses cef_task_tRunner to execute code on the thread's message
// The consumer uses cef_task_runner_t to execute code on the thread's message
// loop. The thread is terminated when the cef_thread_t object is destroyed or
// stop() is called. All pending tasks queued on the thread's message loop will
// run to completion before the thread is terminated. cef_thread_create() can be
@@ -65,7 +65,7 @@ typedef struct _cef_thread_t {
cef_base_ref_counted_t base;
///
// Returns the cef_task_tRunner that will execute code on this thread's
// Returns the cef_task_runner_t that will execute code on this thread's
// message loop. This function is safe to call from any thread.
///
struct _cef_task_runner_t*(CEF_CALLBACK* get_task_runner)(

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=e40cee272e6edd3789896bef6b43e05cc517c424$
// $hash=63d875f5a922dd2c2e1efaaf0ddaa20475f79ef8$
//
#ifndef CEF_INCLUDE_CAPI_CEF_URLREQUEST_CAPI_H_
@@ -195,7 +195,7 @@ typedef struct _cef_urlrequest_client_t {
// the request and call cef_auth_callback_t::cont() when the authentication
// information is available. If the request has an associated browser/frame
// then returning false (0) will result in a call to GetAuthCredentials on the
// cef_request_tHandler associated with that browser, if any. Otherwise,
// cef_request_handler_t associated with that browser, if any. Otherwise,
// returning false (0) will cancel the request immediately. This function will
// only be called for requests initiated from the browser process.
///

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=deae5180f995f35ff2db04b2c5396577300c315b$
// $hash=a5d8033127cf2d21f1cb0c87f76d2d59ec3eace0$
//
#ifndef CEF_INCLUDE_CAPI_TEST_CEF_TRANSLATOR_TEST_CAPI_H_
@@ -323,7 +323,7 @@ typedef struct _cef_translator_test_t {
///
// Set an object. Returns the value from
// cef_translator_test_tRefPtrClient::get_value(). This tests input and
// cef_translator_test_ref_ptr_client_t::get_value(). This tests input and
// execution of a client-side object type.
///
int(CEF_CALLBACK* set_ref_ptr_client)(
@@ -341,7 +341,7 @@ typedef struct _cef_translator_test_t {
///
// Set a child object. Returns the value from
// cef_translator_test_tRefPtrClient::get_value(). This tests input of a
// cef_translator_test_ref_ptr_client_t::get_value(). This tests input of a
// client- side child object type and execution as the parent type.
///
int(CEF_CALLBACK* set_child_ref_ptr_client)(

View File

@@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=72d10c0974ced675d89aa54db60de845978f6319$
// $hash=3b9789f2149c3e6d6a2e671e5427c19654442ede$
//
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_SCROLL_VIEW_CAPI_H_
@@ -59,7 +59,7 @@ typedef struct _cef_scroll_view_t {
///
// Set the content View. The content View must have a specified size (e.g. via
// cef_view_t::SetBounds or cef_view_tDelegate::GetPreferredSize).
// cef_view_t::SetBounds or cef_view_delegate_t::GetPreferredSize).
///
void(CEF_CALLBACK* set_content_view)(struct _cef_scroll_view_t* self,
struct _cef_view_t* view);

View File

@@ -37,14 +37,10 @@
#define CEF_INCLUDE_WRAPPER_CEF_STREAM_RESOURCE_HANDLER_H_
#pragma once
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/base/cef_scoped_ptr.h"
#include "include/cef_base.h"
#include "include/cef_resource_handler.h"
#include "include/cef_response.h"
class CefStreamReader;
#include "include/cef_stream.h"
///
// Implementation of the CefResourceHandler class for reading from a CefStream.
@@ -65,37 +61,25 @@ class CefStreamResourceHandler : public CefResourceHandler {
CefResponse::HeaderMap header_map,
CefRefPtr<CefStreamReader> stream);
virtual ~CefStreamResourceHandler();
// CefResourceHandler methods.
virtual bool ProcessRequest(CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback) OVERRIDE;
virtual void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
CefString& redirectUrl) OVERRIDE;
virtual bool ReadResponse(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefCallback> callback) OVERRIDE;
virtual void Cancel() OVERRIDE;
bool Open(CefRefPtr<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> callback) OVERRIDE;
void GetResponseHeaders(CefRefPtr<CefResponse> response,
int64& response_length,
CefString& redirectUrl) OVERRIDE;
bool Read(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefResourceReadCallback> callback) OVERRIDE;
void Cancel() OVERRIDE;
private:
void ReadOnFileThread(int bytes_to_read, CefRefPtr<CefCallback> callback);
const int status_code_;
const CefString status_text_;
const CefString mime_type_;
const CefResponse::HeaderMap header_map_;
const CefRefPtr<CefStreamReader> stream_;
bool read_on_file_thread_;
class Buffer;
scoped_ptr<Buffer> buffer_;
#if DCHECK_IS_ON()
// Used in debug builds to verify that |buffer_| isn't being accessed on
// multiple threads at the same time.
bool buffer_owned_by_file_thread_;
#endif
IMPLEMENT_REFCOUNTING(CefStreamResourceHandler);
DISALLOW_COPY_AND_ASSIGN(CefStreamResourceHandler);

View File

@@ -25,6 +25,7 @@
#include "base/strings/string_util.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
#include "chrome/common/pref_names.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
@@ -47,6 +48,7 @@
#include "extensions/common/constants.h"
#include "net/proxy_resolution/proxy_config_service.h"
#include "net/proxy_resolution/proxy_resolution_service.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
using content::BrowserThread;
@@ -485,6 +487,11 @@ content::PushMessagingService* CefBrowserContext::GetPushMessagingService() {
return nullptr;
}
content::StorageNotificationService*
CefBrowserContext::GetStorageNotificationService() {
return nullptr;
}
content::SSLHostStateDelegate* CefBrowserContext::GetSSLHostStateDelegate() {
if (!ssl_host_state_delegate_.get())
ssl_host_state_delegate_.reset(new CefSSLHostStateDelegate());

View File

@@ -149,6 +149,7 @@ class CefBrowserContext : public ChromeProfileStub,
content::BrowserPluginGuestManager* GetGuestManager() override;
storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override;
content::PushMessagingService* GetPushMessagingService() override;
content::StorageNotificationService* GetStorageNotificationService() override;
content::SSLHostStateDelegate* GetSSLHostStateDelegate() override;
content::PermissionControllerDelegate* GetPermissionControllerDelegate()
override;

View File

@@ -1077,7 +1077,7 @@ void CefBrowserHostImpl::WasResized() {
if (!web_contents() || !platform_delegate_)
return;
platform_delegate_->SynchronizeVisualProperties();
platform_delegate_->WasResized();
}
void CefBrowserHostImpl::WasHidden(bool hidden) {
@@ -1755,7 +1755,7 @@ bool CefBrowserHostImpl::EmbedsFullscreenWidget() {
void CefBrowserHostImpl::EnterFullscreenModeForTab(
content::WebContents* web_contents,
const GURL& origin,
const blink::WebFullscreenOptions& options) {
const blink::mojom::FullscreenOptions& options) {
OnFullscreenModeChange(true);
}
@@ -1769,10 +1769,10 @@ bool CefBrowserHostImpl::IsFullscreenForTabOrPending(
return is_fullscreen_;
}
blink::WebDisplayMode CefBrowserHostImpl::GetDisplayMode(
blink::mojom::DisplayMode CefBrowserHostImpl::GetDisplayMode(
const content::WebContents* web_contents) {
return is_fullscreen_ ? blink::kWebDisplayModeFullscreen
: blink::kWebDisplayModeBrowser;
return is_fullscreen_ ? blink::mojom::DisplayMode::kFullscreen
: blink::mojom::DisplayMode::kBrowser;
}
void CefBrowserHostImpl::FindReply(content::WebContents* web_contents,
@@ -2621,8 +2621,18 @@ void CefBrowserHostImpl::DidFinishNavigation(
const GURL& url =
(error_code == net::OK ? navigation_handle->GetURL() : GURL());
// May return NULL when starting a new navigation if the previous navigation
// caused the renderer process to crash during load.
CefRefPtr<CefFrameHostImpl> frame = browser_info_->GetFrameForFrameTreeNode(
navigation_handle->GetFrameTreeNodeId());
if (!frame) {
if (is_main_frame) {
frame = browser_info_->GetMainFrame();
} else {
frame =
browser_info_->CreateTempSubFrame(CefFrameHostImpl::kInvalidFrameId);
}
}
frame->RefreshAttributes();
if (error_code == net::OK) {

View File

@@ -437,11 +437,11 @@ class CefBrowserHostImpl : public CefBrowserHost,
void EnterFullscreenModeForTab(
content::WebContents* web_contents,
const GURL& origin,
const blink::WebFullscreenOptions& options) override;
const blink::mojom::FullscreenOptions& options) override;
void ExitFullscreenModeForTab(content::WebContents* web_contents) override;
bool IsFullscreenForTabOrPending(
const content::WebContents* web_contents) override;
blink::WebDisplayMode GetDisplayMode(
blink::mojom::DisplayMode GetDisplayMode(
const content::WebContents* web_contents) override;
void FindReply(content::WebContents* web_contents,
int request_id,

View File

@@ -145,7 +145,7 @@ class CefBrowserPlatformDelegate {
virtual bool CanUseExternalBeginFrame() const = 0;
// Notify the window that it was resized.
virtual void SynchronizeVisualProperties() = 0;
virtual void WasResized() = 0;
// Send input events.
virtual void SendKeyEvent(const content::NativeWebKeyboardEvent& event) = 0;

View File

@@ -360,12 +360,6 @@ gcm::GCMDriver* ChromeBrowserProcessStub::gcm_driver() {
return NULL;
}
shell_integration::DefaultWebClientState
ChromeBrowserProcessStub::CachedDefaultWebClientState() {
NOTREACHED();
return shell_integration::UNKNOWN_DEFAULT;
}
resource_coordinator::TabManager* ChromeBrowserProcessStub::GetTabManager() {
NOTREACHED();
return NULL;

View File

@@ -95,8 +95,6 @@ class ChromeBrowserProcessStub : public BrowserProcess {
WebRtcLogUploader* webrtc_log_uploader() override;
network_time::NetworkTimeTracker* network_time_tracker() override;
gcm::GCMDriver* gcm_driver() override;
shell_integration::DefaultWebClientState CachedDefaultWebClientState()
override;
resource_coordinator::TabManager* GetTabManager() override;
resource_coordinator::ResourceCoordinatorParts* resource_coordinator_parts()
override;

View File

@@ -73,7 +73,6 @@
#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/variations/variations_http_header_provider.h"
#include "components/version_info/version_info.h"
#include "content/browser/frame_host/navigation_handle_impl.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/plugin_service_impl.h"
#include "content/public/browser/browser_context.h"
@@ -82,6 +81,7 @@
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/overlay_window.h"
#include "content/public/browser/page_navigator.h"
#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/render_frame_host.h"
@@ -107,7 +107,7 @@
#include "extensions/common/constants.h"
#include "extensions/common/switches.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/strong_associated_binding.h"
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
#include "net/base/auth.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
@@ -486,7 +486,7 @@ bool NavigationOnUIThread(
// From chrome/browser/plugins/chrome_content_browser_client_plugins_part.cc.
void BindPluginInfoHost(
int render_process_id,
chrome::mojom::PluginInfoHostAssociatedRequest request) {
mojo::PendingAssociatedReceiver<chrome::mojom::PluginInfoHost> receiver) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::RenderProcessHost* host =
content::RenderProcessHost::FromID(render_process_id);
@@ -494,9 +494,9 @@ void BindPluginInfoHost(
return;
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
mojo::MakeStrongAssociatedBinding(
mojo::MakeSelfOwnedAssociatedReceiver(
std::make_unique<PluginInfoHostImpl>(render_process_id, profile),
std::move(request));
std::move(receiver));
}
} // namespace
@@ -884,7 +884,7 @@ CefContentBrowserClient::CreateQuotaPermissionContext() {
void CefContentBrowserClient::GetQuotaSettings(
content::BrowserContext* context,
content::StoragePartition* partition,
storage::OptionalQuotaSettingsCallback callback) {
base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback) {
const base::FilePath& cache_path = partition->GetPath();
storage::GetNominalDynamicSettings(
cache_path, cache_path.empty() /* is_incognito */,
@@ -1283,14 +1283,15 @@ void CefContentBrowserClient::OnNetworkServiceCreated(
network_service);
}
network::mojom::NetworkContextPtr CefContentBrowserClient::CreateNetworkContext(
mojo::Remote<network::mojom::NetworkContext>
CefContentBrowserClient::CreateNetworkContext(
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path) {
// This method may be called during shutdown when using multi-threaded
// message loop mode. In that case exit early to avoid crashes.
if (!SystemNetworkContextManager::GetInstance())
return network::mojom::NetworkContextPtr();
return mojo::Remote<network::mojom::NetworkContext>();
Profile* profile = Profile::FromBrowserContext(context);
return profile->CreateNetworkContext(in_memory, relative_partition_path);
@@ -1320,12 +1321,13 @@ CefContentBrowserClient::GetNetworkContextsParentDirectory() {
bool CefContentBrowserClient::HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
base::Callback<content::WebContents*(void)> web_contents_getter,
int child_id,
content::NavigationUIData* navigation_data,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture,
const base::Optional<url::Origin>& initiating_origin,
network::mojom::URLLoaderFactoryPtr* out_factory) {
// Call the other HandleExternalProtocol variant.
return false;
@@ -1336,7 +1338,6 @@ bool CefContentBrowserClient::HandleExternalProtocol(
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
const network::ResourceRequest& resource_request,
network::mojom::URLLoaderFactoryRequest* factory_request,
network::mojom::URLLoaderFactoryPtr* out_factory) {
auto request = mojo::MakeRequest(out_factory);
// CefBrowserPlatformDelegate::HandleExternalProtocol may be called if

View File

@@ -75,7 +75,8 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
void GetQuotaSettings(
content::BrowserContext* context,
content::StoragePartition* partition,
storage::OptionalQuotaSettingsCallback callback) override;
base::OnceCallback<void(base::Optional<storage::QuotaSettings>)> callback)
override;
content::MediaObserver* GetMediaObserver() override;
content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override;
@@ -172,26 +173,26 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
bool* bypass_redirect_checks) override;
void OnNetworkServiceCreated(
network::mojom::NetworkService* network_service) override;
network::mojom::NetworkContextPtr CreateNetworkContext(
mojo::Remote<network::mojom::NetworkContext> CreateNetworkContext(
content::BrowserContext* context,
bool in_memory,
const base::FilePath& relative_partition_path) override;
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
bool HandleExternalProtocol(
const GURL& url,
content::WebContents::Getter web_contents_getter,
base::Callback<content::WebContents*(void)> web_contents_getter,
int child_id,
content::NavigationUIData* navigation_data,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture,
const base::Optional<url::Origin>& initiating_origin,
network::mojom::URLLoaderFactoryPtr* out_factory) override;
bool HandleExternalProtocol(
content::WebContents::Getter web_contents_getter,
int frame_tree_node_id,
content::NavigationUIData* navigation_data,
const network::ResourceRequest& request,
network::mojom::URLLoaderFactoryRequest* factory_request,
network::mojom::URLLoaderFactoryPtr* out_factory) override;
std::unique_ptr<content::OverlayWindow> CreateWindowForPictureInPicture(
content::PictureInPictureWindowController* controller) override;

View File

@@ -45,8 +45,10 @@
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/cpp/simple_url_loader_stream_consumer.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
namespace {
@@ -95,7 +97,7 @@ class CefDevToolsFrontend::NetworkResourceLoader
private:
void OnResponseStarted(const GURL& final_url,
const network::ResourceResponseHead& response_head) {
const network::mojom::URLResponseHead& response_head) {
response_headers_ = response_head.headers;
}

View File

@@ -10,12 +10,12 @@
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "components/zoom/zoom_controller.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/common/page_zoom.h"
#include "extensions/browser/extension_api_frame_id_map.h"
#include "extensions/browser/extension_zoom_request_client.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/permissions_data.h"
#include "third_party/blink/public/common/page/page_zoom.h"
namespace extensions {
namespace cef {
@@ -283,7 +283,7 @@ bool TabsSetZoomFunction::RunAsync() {
zoom::ZoomController* zoom_controller =
zoom::ZoomController::FromWebContents(web_contents);
double zoom_level = params->zoom_factor > 0
? content::ZoomFactorToZoomLevel(params->zoom_factor)
? blink::PageZoomFactorToZoomLevel(params->zoom_factor)
: zoom_controller->GetDefaultZoomLevel();
scoped_refptr<extensions::ExtensionZoomRequestClient> client(
@@ -310,7 +310,7 @@ bool TabsGetZoomFunction::RunAsync() {
double zoom_level =
zoom::ZoomController::FromWebContents(web_contents)->GetZoomLevel();
double zoom_factor = content::ZoomLevelToZoomFactor(zoom_level);
double zoom_factor = blink::PageZoomLevelToZoomFactor(zoom_level);
results_ = tabs::GetZoom::Results::Create(zoom_factor);
SendResponse(true);
return true;
@@ -385,7 +385,7 @@ bool TabsGetZoomSettingsFunction::RunAsync() {
api::tabs::ZoomSettings zoom_settings;
ZoomModeToZoomSettings(zoom_mode, &zoom_settings);
zoom_settings.default_zoom_factor.reset(new double(
content::ZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel())));
blink::PageZoomLevelToZoomFactor(zoom_controller->GetDefaultZoomLevel())));
results_ = api::tabs::GetZoomSettings::Results::Create(zoom_settings);
SendResponse(true);

View File

@@ -47,7 +47,7 @@ SkColor CefBrowserPlatformDelegateBackground::GetBackgroundColor() const {
return native_delegate_->GetBackgroundColor();
}
void CefBrowserPlatformDelegateBackground::SynchronizeVisualProperties() {
void CefBrowserPlatformDelegateBackground::WasResized() {
// Nothing to do here.
}

View File

@@ -24,7 +24,7 @@ class CefBrowserPlatformDelegateBackground
SkColor GetBackgroundColor() const override;
bool CanUseSharedTexture() const override;
bool CanUseExternalBeginFrame() const override;
void SynchronizeVisualProperties() override;
void WasResized() override;
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
void SendMouseEvent(const blink::WebMouseEvent& event) override;
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;

View File

@@ -408,11 +408,8 @@ base::DictionaryValue* CefExtensionFunctionDetails::OpenTab(
auto scrub_tab_behavior = ExtensionTabUtil::GetScrubTabBehavior(
extension, extensions::Feature::Context::UNSPECIFIED_CONTEXT,
web_contents);
if (scrub_tab_behavior != ExtensionTabUtil::kDontScrubTab) {
ExtensionTabUtil::ScrubTabForExtension(extension, web_contents,
result.get(), scrub_tab_behavior);
}
ExtensionTabUtil::ScrubTabForExtension(extension, web_contents, result.get(),
scrub_tab_behavior);
return result->ToValue().release();
}

View File

@@ -32,7 +32,7 @@ bool CefBrowserPlatformDelegateNative::CanUseExternalBeginFrame() const {
return use_external_begin_frame_;
}
void CefBrowserPlatformDelegateNative::SynchronizeVisualProperties() {
void CefBrowserPlatformDelegateNative::WasResized() {
content::RenderViewHost* host = browser_->web_contents()->GetRenderViewHost();
if (host)
host->GetWidget()->SynchronizeVisualProperties();

View File

@@ -28,7 +28,7 @@ class CefBrowserPlatformDelegateNative : public CefBrowserPlatformDelegate {
bool CanUseSharedTexture() const override;
bool CanUseExternalBeginFrame() const override;
SkColor GetBackgroundColor() const override;
void SynchronizeVisualProperties() override;
void WasResized() override;
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
void SendMouseEvent(const blink::WebMouseEvent& event) override;
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;

View File

@@ -121,7 +121,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
prefs->use_bitmaps = params->use_bitmaps;
prefs->subpixel_rendering = params->subpixel_rendering;
browser_->web_contents()->GetRenderViewHost()->SyncRendererPrefs();
browser_->web_contents()->SyncRendererPrefs();
return true;
}
@@ -366,7 +366,8 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateWheelEvent(
result.delta_y = deltaY;
result.wheel_ticks_x = deltaX / scrollbarPixelsPerGtkTick;
result.wheel_ticks_y = deltaY / scrollbarPixelsPerGtkTick;
result.has_precise_scrolling_deltas = true;
result.delta_units =
ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::kLeft;
@@ -421,4 +422,4 @@ gfx::Point CefBrowserPlatformDelegateNativeLinux::GetDialogPosition(
gfx::Size CefBrowserPlatformDelegateNativeLinux::GetMaximumDialogSize() {
return GetWindowWidget()->GetWindowBoundsInScreen().size();
}
}

View File

@@ -429,7 +429,7 @@ void CefBrowserPlatformDelegateNativeMac::TranslateWheelEvent(
result.delta_y = deltaY;
result.wheel_ticks_x = deltaX / scrollbarPixelsPerCocoaTick;
result.wheel_ticks_y = deltaY / scrollbarPixelsPerCocoaTick;
result.has_precise_scrolling_deltas = true;
result.delta_units = ui::input_types::ScrollGranularity::kScrollByPrecisePixel;
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::kLeft;

View File

@@ -535,8 +535,8 @@ void CefBrowserPlatformDelegateNativeWin::TranslateWheelEvent(
ULONG scrollLines = defaultScrollLinesPerWheelDelta;
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0, &scrollLines, 0);
if (scrollLines == WHEEL_PAGESCROLL)
result.scroll_by_page = true;
if (!result.scroll_by_page)
result.delta_units = ui::input_types::ScrollGranularity::kScrollByPage;
if (result.delta_units != ui::input_types::ScrollGranularity::kScrollByPage)
scrollDelta *= static_cast<FLOAT>(scrollLines) * scrollbarPixelsPerLine;
}

View File

@@ -161,6 +161,10 @@ void CefWindowX11::Close() {
ev.xclient.data.l[0] = gfx::GetAtom(kWMDeleteWindow);
ev.xclient.data.l[1] = x11::CurrentTime;
XSendEvent(xdisplay_, xwindow_, false, NoEventMask, &ev);
auto host = GetHost();
if (host)
host->Close();
}
void CefWindowX11::Show() {
@@ -275,8 +279,10 @@ gfx::Rect CefWindowX11::GetBoundsInScreen() {
views::DesktopWindowTreeHostX11* CefWindowX11::GetHost() {
if (browser_.get()) {
::Window child = FindChild(xdisplay_, xwindow_);
if (child)
return views::DesktopWindowTreeHostX11::GetHostForXID(child);
if (child) {
return static_cast<views::DesktopWindowTreeHostX11*>(
views::DesktopWindowTreeHostLinux::GetHostForWidget(child));
}
}
return NULL;
}

View File

@@ -52,9 +52,11 @@ class RedirectHandler : public CefResourceHandler {
public:
explicit RedirectHandler(const GURL& url) : url_(url) {}
bool ProcessRequest(CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback) override {
callback->Continue();
bool Open(CefRefPtr<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> callback) override {
// Continue immediately.
handle_request = true;
return true;
}
@@ -65,10 +67,11 @@ class RedirectHandler : public CefResourceHandler {
redirectUrl = url_.spec();
}
bool ReadResponse(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefCallback> callback) override {
bool Read(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefResourceReadCallback> callback) override {
NOTREACHED();
return false;
}
@@ -78,6 +81,7 @@ class RedirectHandler : public CefResourceHandler {
GURL url_;
IMPLEMENT_REFCOUNTING(RedirectHandler);
DISALLOW_COPY_AND_ASSIGN(RedirectHandler);
};
class InternalHandler : public CefResourceHandler {
@@ -87,9 +91,11 @@ class InternalHandler : public CefResourceHandler {
int size)
: mime_type_(mime_type), reader_(reader), size_(size) {}
bool ProcessRequest(CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback) override {
callback->Continue();
bool Open(CefRefPtr<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> callback) override {
// Continue immediately.
handle_request = true;
return true;
}
@@ -102,11 +108,21 @@ class InternalHandler : public CefResourceHandler {
response->SetStatus(200);
}
bool ReadResponse(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefCallback> callback) override {
bytes_read = reader_->Read(data_out, 1, bytes_to_read);
bool Read(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefResourceReadCallback> callback) override {
// Read until the buffer is full or until Read() returns 0 to indicate no
// more data.
bytes_read = 0;
int read = 0;
do {
read = static_cast<int>(
reader_->Read(static_cast<char*>(data_out) + bytes_read, 1,
bytes_to_read - bytes_read));
bytes_read += read;
} while (read != 0 && bytes_read < bytes_to_read);
return (bytes_read > 0);
}
@@ -118,6 +134,7 @@ class InternalHandler : public CefResourceHandler {
int size_;
IMPLEMENT_REFCOUNTING(InternalHandler);
DISALLOW_COPY_AND_ASSIGN(InternalHandler);
};
class InternalHandlerFactory : public CefSchemeHandlerFactory {
@@ -170,6 +187,7 @@ class InternalHandlerFactory : public CefSchemeHandlerFactory {
std::unique_ptr<InternalHandlerDelegate> delegate_;
IMPLEMENT_REFCOUNTING(InternalHandlerFactory);
DISALLOW_COPY_AND_ASSIGN(InternalHandlerFactory);
};
} // namespace

View File

@@ -18,12 +18,14 @@
#include "libcef/common/response_impl.h"
#include "libcef/common/task_runner_impl.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_util.h"
#include "content/public/browser/global_request_id.h"
#include "content/public/browser/render_frame_host.h"
#include "net/base/mime_util.h"
#include "net/base/net_errors.h"
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
@@ -379,7 +381,7 @@ class CefBrowserURLRequest::Context
}
void OnRedirect(const net::RedirectInfo& redirect_info,
const network::ResourceResponseHead& response_head,
const network::mojom::URLResponseHead& response_head,
std::vector<std::string>* removed_headers) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(status_, UR_IO_PENDING);
@@ -396,7 +398,7 @@ class CefBrowserURLRequest::Context
}
void OnResponseStarted(const GURL& final_url,
const network::ResourceResponseHead& response_head) {
const network::mojom::URLResponseHead& response_head) {
DCHECK(CalledOnValidThread());
DCHECK_EQ(status_, UR_IO_PENDING);

View File

@@ -174,6 +174,7 @@ void SaveCookies(content::BrowserContext* browser_context,
CEF_REQUIRE_IOT();
if (request.credentials_mode == network::mojom::CredentialsMode::kOmit ||
!head.headers ||
!head.headers->HasHeader(net_service::kHTTPSetCookieHeaderName)) {
// Continue immediately without saving cookies.
std::move(done_callback).Run(0, {});

View File

@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/storage_partition.h"
#include "services/network/public/mojom/cookie_manager.mojom.h"
#include "url/gurl.h"
using network::mojom::CookieManager;

View File

@@ -141,6 +141,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
void OnBeforeSendHeaders(const net::HttpRequestHeaders& headers,
OnBeforeSendHeadersCallback callback) override;
void OnHeadersReceived(const std::string& headers,
const net::IPEndPoint& remote_endpoint,
OnHeadersReceivedCallback callback) override;
// mojom::URLLoaderClient methods:
@@ -416,8 +417,10 @@ void InterceptedRequest::OnBeforeSendHeaders(
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
}
void InterceptedRequest::OnHeadersReceived(const std::string& headers,
OnHeadersReceivedCallback callback) {
void InterceptedRequest::OnHeadersReceived(
const std::string& headers,
const net::IPEndPoint& remote_endpoint,
OnHeadersReceivedCallback callback) {
if (!current_request_uses_header_client_) {
std::move(callback).Run(net::OK, base::nullopt, GURL());
return;
@@ -1165,9 +1168,9 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart(
}
void ProxyURLLoaderFactory::Clone(
network::mojom::URLLoaderFactoryRequest loader_request) {
mojo::PendingReceiver<network::mojom::URLLoaderFactory> factory) {
CEF_REQUIRE_IOT();
proxy_bindings_.AddBinding(this, std::move(loader_request));
proxy_bindings_.AddBinding(this, std::move(factory));
}
void ProxyURLLoaderFactory::OnLoaderCreated(
@@ -1179,6 +1182,13 @@ void ProxyURLLoaderFactory::OnLoaderCreated(
request_it->second->OnLoaderCreated(std::move(receiver));
}
void ProxyURLLoaderFactory::OnLoaderForCorsPreflightCreated(
const ::network::ResourceRequest& request,
mojo::PendingReceiver<network::mojom::TrustedHeaderClient> header_client) {
CEF_REQUIRE_IOT();
// TODO(cef): Should we do something here?
}
void ProxyURLLoaderFactory::OnTargetFactoryError() {
// Stop calls to CreateLoaderAndStart() when |target_factory_| is invalid.
target_factory_.reset();
@@ -1208,7 +1218,6 @@ void ProxyURLLoaderFactory::MaybeDestroySelf() {
if (target_factory_.is_bound() || !requests_.empty())
return;
CHECK(!destroyed_);
destroyed_ = true;
// In some cases we may be destroyed before SetDisconnectCallback is called.

View File

@@ -160,13 +160,18 @@ class ProxyURLLoaderFactory
network::mojom::URLLoaderClientPtr client,
const net::MutableNetworkTrafficAnnotationTag&
traffic_annotation) override;
void Clone(network::mojom::URLLoaderFactoryRequest loader_request) override;
void Clone(
mojo::PendingReceiver<network::mojom::URLLoaderFactory> factory) override;
// network::mojom::TrustedURLLoaderHeaderClient:
void OnLoaderCreated(
int32_t request_id,
mojo::PendingReceiver<network::mojom::TrustedHeaderClient> receiver)
override;
void OnLoaderForCorsPreflightCreated(
const ::network::ResourceRequest& request,
mojo::PendingReceiver<network::mojom::TrustedHeaderClient> header_client)
override;
private:
friend class InterceptedRequest;

View File

@@ -41,17 +41,9 @@ class OpenInputStreamWrapper
const network::ResourceRequest& request,
OnInputStreamOpenedCallback callback) WARN_UNUSED_RESULT {
scoped_refptr<OpenInputStreamWrapper> wrapper = new OpenInputStreamWrapper(
std::move(delegate), base::ThreadTaskRunnerHandle::Get(),
std::move(callback));
work_thread_task_runner->PostTask(
FROM_HERE,
base::BindOnce(OpenInputStreamWrapper::OpenOnWorkThread,
// This is intentional - the loader could be deleted
// while the callback is executing on the background
// thread. The delegate will be "returned" to the loader
// once the InputStream open attempt is completed.
wrapper, request_id, request));
std::move(delegate), work_thread_task_runner,
base::ThreadTaskRunnerHandle::Get(), std::move(callback));
wrapper->Start(request_id, request);
return wrapper->GetCancelCallback();
}
@@ -61,39 +53,61 @@ class OpenInputStreamWrapper
OpenInputStreamWrapper(
std::unique_ptr<StreamReaderURLLoader::Delegate> delegate,
scoped_refptr<base::SequencedTaskRunner> work_thread_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> job_thread_task_runner,
OnInputStreamOpenedCallback callback)
: delegate_(std::move(delegate)),
work_thread_task_runner_(work_thread_task_runner),
job_thread_task_runner_(job_thread_task_runner),
callback_(std::move(callback)) {}
virtual ~OpenInputStreamWrapper() {}
static void OpenOnWorkThread(scoped_refptr<OpenInputStreamWrapper> wrapper,
const RequestId& request_id,
const network::ResourceRequest& request) {
DCHECK(!CEF_CURRENTLY_ON_IOT());
DCHECK(!CEF_CURRENTLY_ON_UIT());
wrapper->Open(request_id, request);
void Start(const RequestId& request_id,
const network::ResourceRequest& request) {
work_thread_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(&OpenInputStreamWrapper::OpenOnWorkThread,
base::WrapRefCounted(this), request_id, request));
}
base::OnceClosure GetCancelCallback() {
return base::BindOnce(&OpenInputStreamWrapper::Cancel,
return base::BindOnce(&OpenInputStreamWrapper::CancelOnJobThread,
base::WrapRefCounted(this));
}
void Cancel() {
void CancelOnJobThread() {
DCHECK(job_thread_task_runner_->RunsTasksInCurrentSequence());
delegate_.reset();
if (callback_.is_null())
return;
callback_.Reset();
work_thread_task_runner_->PostTask(
FROM_HERE, base::BindOnce(&OpenInputStreamWrapper::CancelOnWorkThread,
base::WrapRefCounted(this)));
}
void Open(const RequestId& request_id,
const network::ResourceRequest& request) {
void CancelOnWorkThread() {
DCHECK(work_thread_task_runner_->RunsTasksInCurrentSequence());
if (is_canceled_)
return;
is_canceled_ = true;
OnCallback(nullptr);
}
void OpenOnWorkThread(const RequestId& request_id,
const network::ResourceRequest& request) {
DCHECK(work_thread_task_runner_->RunsTasksInCurrentSequence());
if (is_canceled_)
return;
// |delegate_| will remain valid until OnCallback() is executed on
// |job_thread_task_runner_|.
if (!delegate_->OpenInputStream(
request_id, request,
base::BindOnce(&OpenInputStreamWrapper::OnCallback,
base::WrapRefCounted(this)))) {
is_canceled_ = true;
OnCallback(nullptr);
}
}
@@ -107,17 +121,28 @@ class OpenInputStreamWrapper
return;
}
// May be null if we were canceled.
if (callback_.is_null())
// May be null if CancelOnJobThread() was called on
// |job_thread_task_runner_| while OpenOnWorkThread() was pending on
// |work_thread_task_runner_|.
if (callback_.is_null()) {
delegate_.reset();
return;
}
std::move(callback_).Run(std::move(delegate_), std::move(input_stream));
}
std::unique_ptr<StreamReaderURLLoader::Delegate> delegate_;
scoped_refptr<base::SequencedTaskRunner> work_thread_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> job_thread_task_runner_;
// Only accessed on |job_thread_task_runner_|.
OnInputStreamOpenedCallback callback_;
// Only accessed on |work_thread_task_runner_|.
bool is_canceled_ = false;
DISALLOW_COPY_AND_ASSIGN(OpenInputStreamWrapper);
};
@@ -632,7 +657,7 @@ void StreamReaderURLLoader::HeadersComplete(int orig_status_code,
if (header_client_.is_bound()) {
header_client_->OnHeadersReceived(
pending_response_.headers->raw_headers(),
pending_response_.headers->raw_headers(), net::IPEndPoint(),
base::BindOnce(&StreamReaderURLLoader::ContinueWithResponseHeaders,
weak_factory_.GetWeakPtr()));
} else {

View File

@@ -85,10 +85,10 @@ SkColor CefBrowserPlatformDelegateOsr::GetBackgroundColor() const {
return native_delegate_->GetBackgroundColor();
}
void CefBrowserPlatformDelegateOsr::SynchronizeVisualProperties() {
void CefBrowserPlatformDelegateOsr::WasResized() {
CefRenderWidgetHostViewOSR* view = GetOSRHostView();
if (view)
view->SynchronizeVisualProperties();
view->WasResized();
}
void CefBrowserPlatformDelegateOsr::SendKeyEvent(

View File

@@ -30,7 +30,7 @@ class CefBrowserPlatformDelegateOsr
SkColor GetBackgroundColor() const override;
bool CanUseSharedTexture() const override;
bool CanUseExternalBeginFrame() const override;
void SynchronizeVisualProperties() override;
void WasResized() override;
void SendExternalBeginFrame() override;
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
void SendMouseEvent(const blink::WebMouseEvent& event) override;

View File

@@ -26,8 +26,9 @@
class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater {
public:
CefLayeredWindowUpdaterOSR(CefRenderWidgetHostViewOSR* const view,
viz::mojom::LayeredWindowUpdaterRequest request);
CefLayeredWindowUpdaterOSR(
CefRenderWidgetHostViewOSR* const view,
mojo::PendingReceiver<viz::mojom::LayeredWindowUpdater> receiver);
~CefLayeredWindowUpdaterOSR() override;
void SetActive(bool active);
@@ -41,7 +42,7 @@ class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater {
private:
CefRenderWidgetHostViewOSR* const view_;
mojo::Binding<viz::mojom::LayeredWindowUpdater> binding_;
mojo::Receiver<viz::mojom::LayeredWindowUpdater> receiver_;
bool active_ = false;
base::WritableSharedMemoryMapping shared_memory_;
gfx::Size pixel_size_;
@@ -51,8 +52,8 @@ class CefLayeredWindowUpdaterOSR : public viz::mojom::LayeredWindowUpdater {
CefLayeredWindowUpdaterOSR::CefLayeredWindowUpdaterOSR(
CefRenderWidgetHostViewOSR* const view,
viz::mojom::LayeredWindowUpdaterRequest request)
: view_(view), binding_(this, std::move(request)) {}
mojo::PendingReceiver<viz::mojom::LayeredWindowUpdater> receiver)
: view_(view), receiver_(this, std::move(receiver)) {}
CefLayeredWindowUpdaterOSR::~CefLayeredWindowUpdaterOSR() = default;
@@ -127,8 +128,13 @@ void CefHostDisplayClientOSR::UseProxyOutputDevice(
}
void CefHostDisplayClientOSR::CreateLayeredWindowUpdater(
viz::mojom::LayeredWindowUpdaterRequest request) {
mojo::PendingReceiver<viz::mojom::LayeredWindowUpdater> receiver) {
layered_window_updater_ =
std::make_unique<CefLayeredWindowUpdaterOSR>(view_, std::move(request));
std::make_unique<CefLayeredWindowUpdaterOSR>(view_, std::move(receiver));
layered_window_updater_->SetActive(active_);
}
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
void CefHostDisplayClientOSR::DidCompleteSwapWithNewSize(
const gfx::Size& size) {}
#endif

View File

@@ -30,7 +30,12 @@ class CefHostDisplayClientOSR : public viz::HostDisplayClient {
void UseProxyOutputDevice(UseProxyOutputDeviceCallback callback) override;
void CreateLayeredWindowUpdater(
viz::mojom::LayeredWindowUpdaterRequest request) override;
mojo::PendingReceiver<viz::mojom::LayeredWindowUpdater> receiver)
override;
#if defined(OS_LINUX) && !defined(OS_CHROMEOS)
void DidCompleteSwapWithNewSize(const gfx::Size& size) override;
#endif
CefRenderWidgetHostViewOSR* const view_;
std::unique_ptr<CefLayeredWindowUpdaterOSR> layered_window_updater_;

View File

@@ -22,6 +22,7 @@
#include "base/task/post_task.h"
#include "cc/base/switches.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/begin_frame_args.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/delay_based_time_source.h"
#include "components/viz/common/gl_helper.h"
@@ -149,6 +150,36 @@ ui::LatencyInfo CreateLatencyInfo(const blink::WebInputEvent& event) {
return latency_info;
}
gfx::Rect GetViewBounds(CefBrowserHostImpl* browser) {
if (!browser)
return gfx::Rect();
CefRect rc;
CefRefPtr<CefRenderHandler> handler =
browser->GetClient()->GetRenderHandler();
CHECK(handler);
handler->GetViewRect(browser, rc);
CHECK_GT(rc.width, 0);
CHECK_GT(rc.height, 0);
return gfx::Rect(rc.x, rc.y, rc.width, rc.height);
}
float GetDeviceScaleFactor(CefBrowserHostImpl* browser) {
if (!browser)
return kDefaultScaleFactor;
CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(),
CefRect());
CefRefPtr<CefRenderHandler> handler = browser->client()->GetRenderHandler();
CHECK(handler);
if (!handler->GetScreenInfo(browser, screen_info))
return kDefaultScaleFactor;
return screen_info.device_scale_factor;
}
} // namespace
CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
@@ -160,23 +191,12 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
bool is_guest_view_hack)
: content::RenderWidgetHostViewBase(widget),
background_color_(background_color),
frame_rate_threshold_us_(0),
host_display_client_(nullptr),
hold_resize_(false),
pending_resize_(false),
pending_resize_force_(false),
render_widget_host_(content::RenderWidgetHostImpl::From(widget)),
has_parent_(parent_host_view != NULL),
parent_host_view_(parent_host_view),
popup_host_view_(NULL),
child_host_view_(NULL),
is_showing_(false),
is_destroyed_(false),
pinch_zoom_enabled_(content::IsPinchToZoomEnabled()),
is_scroll_offset_changed_pending_(false),
mouse_wheel_phase_handler_(this),
gesture_provider_(CreateGestureProviderConfig(), this),
forward_touch_to_popup_(false),
weak_ptr_factory_(this) {
DCHECK(render_widget_host_);
DCHECK(!render_widget_host_->GetView());
@@ -192,9 +212,6 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
content::RenderViewHost::From(render_widget_host_));
}
local_surface_id_allocator_.GenerateId();
local_surface_id_allocation_ =
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
delegated_frame_host_client_.reset(new CefDelegatedFrameHostClient(this));
// Matching the attributes from BrowserCompositorMac.
@@ -221,7 +238,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(), context_factory_private,
base::ThreadTaskRunnerHandle::Get(), false /* enable_pixel_canvas */,
use_external_begin_frame ? this : nullptr));
use_external_begin_frame));
compositor_->SetAcceleratedWidget(gfx::kNullAcceleratedWidget);
compositor_->SetDelegate(this);
@@ -233,12 +250,9 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
if (render_widget_host_impl)
render_widget_host_impl->SetCompositorForFlingScheduler(compositor_.get());
if (browser_impl_.get())
ResizeRootLayer(false);
cursor_manager_.reset(new content::CursorManager(this));
// Do this last because it may result in a call to SetNeedsBeginFrames.
// This may result in a call to GetFrameSinkId().
render_widget_host_->SetView(this);
if (GetTextInputManager())
@@ -250,15 +264,12 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
GetFrameSinkId(), this);
}
if (!render_widget_host_->is_hidden()) {
Show();
}
if (!content::GpuDataManagerImpl::GetInstance()->IsGpuCompositingDisabled()) {
video_consumer_.reset(new CefVideoConsumerOSR(this));
video_consumer_->SetActive(true);
video_consumer_->SetFrameRate(
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
if (browser_impl_ && !parent_host_view_) {
// For child/popup views this will be called from the associated InitAs*()
// method.
SetRootLayerSize(false /* force */);
if (!render_widget_host_->is_hidden())
Show();
}
}
@@ -299,7 +310,7 @@ void CefRenderWidgetHostViewOSR::InitAsChild(gfx::NativeView parent_view) {
// The parent view should not render while the full-screen view exists.
parent_host_view_->Hide();
ResizeRootLayer(false);
SetRootLayerSize(false /* force */);
Show();
}
@@ -323,7 +334,7 @@ bool CefRenderWidgetHostViewOSR::HasFocus() {
}
bool CefRenderWidgetHostViewOSR::IsSurfaceAvailableForCopy() {
return GetDelegatedFrameHost()->CanCopyFromCompositingSurface();
return delegated_frame_host_->CanCopyFromCompositingSurface();
}
void CefRenderWidgetHostViewOSR::Show() {
@@ -332,16 +343,40 @@ void CefRenderWidgetHostViewOSR::Show() {
is_showing_ = true;
delegated_frame_host_->AttachToCompositor(compositor_.get());
delegated_frame_host_->WasShown(
GetLocalSurfaceIdAllocation().local_surface_id(),
GetRootLayer()->bounds().size(), base::nullopt);
// If the viz::LocalSurfaceIdAllocation is invalid, we may have been evicted,
// and no other visual properties have since been changed. Allocate a new id
// and start synchronizing.
if (!GetLocalSurfaceIdAllocation().IsValid()) {
AllocateLocalSurfaceId();
SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(),
GetLocalSurfaceIdAllocation());
}
// Note that |render_widget_host_| will retrieve size parameters from the
// DelegatedFrameHost, so it must have WasShown called after.
if (render_widget_host_)
if (render_widget_host_) {
render_widget_host_->WasShown(
base::nullopt /* record_tab_switch_time_request */);
}
delegated_frame_host_->AttachToCompositor(compositor_.get());
delegated_frame_host_->WasShown(
GetLocalSurfaceIdAllocation().local_surface_id(), GetViewBounds().size(),
base::nullopt);
if (!content::GpuDataManagerImpl::GetInstance()->IsGpuCompositingDisabled()) {
// Start generating frames when we're visible and at the correct size.
if (!video_consumer_) {
video_consumer_.reset(new CefVideoConsumerOSR(this));
UpdateFrameRate();
// Call OnRenderFrameMetadataChangedAfterActivation for every frame.
content::RenderFrameMetadataProviderImpl* provider =
content::RenderWidgetHostImpl::From(render_widget_host_)
->render_frame_metadata_provider();
provider->ReportAllFrameSubmissionsForTesting(true);
} else {
video_consumer_->SetActive(true);
}
}
}
void CefRenderWidgetHostViewOSR::Hide() {
@@ -353,12 +388,16 @@ void CefRenderWidgetHostViewOSR::Hide() {
if (browser_impl_.get())
browser_impl_->CancelContextMenu();
if (video_consumer_) {
video_consumer_->SetActive(false);
}
if (render_widget_host_)
render_widget_host_->WasHidden();
GetDelegatedFrameHost()->WasHidden(
delegated_frame_host_->WasHidden(
content::DelegatedFrameHost::HiddenCause::kOther);
GetDelegatedFrameHost()->DetachFromCompositor();
delegated_frame_host_->DetachFromCompositor();
}
bool CefRenderWidgetHostViewOSR::IsShowing() {
@@ -367,26 +406,15 @@ bool CefRenderWidgetHostViewOSR::IsShowing() {
void CefRenderWidgetHostViewOSR::EnsureSurfaceSynchronizedForWebTest() {
++latest_capture_sequence_number_;
SynchronizeVisualProperties();
SynchronizeVisualProperties(cc::DeadlinePolicy::UseInfiniteDeadline(),
base::nullopt);
}
gfx::Rect CefRenderWidgetHostViewOSR::GetViewBounds() {
if (IsPopupWidget())
return popup_position_;
if (!browser_impl_.get())
return gfx::Rect();
CefRect rc;
CefRefPtr<CefRenderHandler> handler =
browser_impl_->GetClient()->GetRenderHandler();
CHECK(handler);
handler->GetViewRect(browser_impl_.get(), rc);
CHECK_GT(rc.width, 0);
CHECK_GT(rc.height, 0);
return gfx::Rect(rc.x, rc.y, rc.width, rc.height);
return current_view_bounds_;
}
void CefRenderWidgetHostViewOSR::SetBackgroundColor(SkColor color) {
@@ -420,9 +448,9 @@ void CefRenderWidgetHostViewOSR::TakeFallbackContentFrom(
CefRenderWidgetHostViewOSR* view_cef =
static_cast<CefRenderWidgetHostViewOSR*>(view);
SetBackgroundColor(view_cef->background_color_);
if (GetDelegatedFrameHost() && view_cef->GetDelegatedFrameHost()) {
GetDelegatedFrameHost()->TakeFallbackContentFrom(
view_cef->GetDelegatedFrameHost());
if (delegated_frame_host_ && view_cef->delegated_frame_host_) {
delegated_frame_host_->TakeFallbackContentFrom(
view_cef->delegated_frame_host_.get());
}
host()->GetContentRenderingTimeoutFrom(view_cef->host());
}
@@ -434,6 +462,59 @@ void CefRenderWidgetHostViewOSR::DidCreateNewRendererCompositorFrameSink(
void CefRenderWidgetHostViewOSR::OnPresentCompositorFrame() {}
void CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete(
const cc::RenderFrameMetadata& metadata) {
if (host()->is_hidden()) {
// When an embedded child responds, we want to accept its changes to the
// viz::LocalSurfaceId. However we do not want to embed surfaces while
// hidden. Nor do we want to embed invalid ids when we are evicted. Becoming
// visible will generate a new id, if necessary, and begin embedding.
UpdateLocalSurfaceIdFromEmbeddedClient(
metadata.local_surface_id_allocation);
} else {
SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(),
metadata.local_surface_id_allocation);
}
}
void CefRenderWidgetHostViewOSR::AllocateLocalSurfaceId() {
if (!parent_local_surface_id_allocator_) {
parent_local_surface_id_allocator_ =
std::make_unique<viz::ParentLocalSurfaceIdAllocator>();
}
parent_local_surface_id_allocator_->GenerateId();
}
const viz::LocalSurfaceIdAllocation&
CefRenderWidgetHostViewOSR::GetCurrentLocalSurfaceIdAllocation() const {
return parent_local_surface_id_allocator_
->GetCurrentLocalSurfaceIdAllocation();
}
void CefRenderWidgetHostViewOSR::UpdateLocalSurfaceIdFromEmbeddedClient(
const base::Optional<viz::LocalSurfaceIdAllocation>&
embedded_client_local_surface_id_allocation) {
if (embedded_client_local_surface_id_allocation) {
parent_local_surface_id_allocator_->UpdateFromChild(
*embedded_client_local_surface_id_allocation);
} else {
AllocateLocalSurfaceId();
}
}
const viz::LocalSurfaceIdAllocation&
CefRenderWidgetHostViewOSR::GetOrCreateLocalSurfaceIdAllocation() {
if (!parent_local_surface_id_allocator_)
AllocateLocalSurfaceId();
return GetCurrentLocalSurfaceIdAllocation();
}
void CefRenderWidgetHostViewOSR::InvalidateLocalSurfaceId() {
if (!parent_local_surface_id_allocator_)
return;
parent_local_surface_id_allocator_->Invalidate();
}
void CefRenderWidgetHostViewOSR::AddDamageRect(uint32_t sequence,
const gfx::Rect& rect) {
// Associate the given damage rect with the presentation token.
@@ -458,7 +539,7 @@ void CefRenderWidgetHostViewOSR::SubmitCompositorFrame(
}
void CefRenderWidgetHostViewOSR::ResetFallbackToFirstNavigationSurface() {
GetDelegatedFrameHost()->ResetFallbackToFirstNavigationSurface();
delegated_frame_host_->ResetFallbackToFirstNavigationSurface();
}
void CefRenderWidgetHostViewOSR::InitAsPopup(
@@ -486,12 +567,9 @@ void CefRenderWidgetHostViewOSR::InitAsPopup(
if (handler.get())
handler->OnPopupSize(browser_impl_.get(), widget_pos);
if (video_consumer_) {
video_consumer_->SizeChanged();
}
ResizeRootLayer(false);
// The size doesn't change for popups so we need to force the
// initialization.
SetRootLayerSize(true /* force */);
Show();
}
@@ -640,8 +718,8 @@ void CefRenderWidgetHostViewOSR::CopyFromSurface(
const gfx::Rect& src_rect,
const gfx::Size& output_size,
base::OnceCallback<void(const SkBitmap&)> callback) {
GetDelegatedFrameHost()->CopyFromCompositingSurface(src_rect, output_size,
std::move(callback));
delegated_frame_host_->CopyFromCompositingSurface(src_rect, output_size,
std::move(callback));
}
void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) {
@@ -699,17 +777,16 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
viz::ScopedSurfaceIdAllocator
CefRenderWidgetHostViewOSR::DidUpdateVisualProperties(
const cc::RenderFrameMetadata& metadata) {
base::OnceCallback<void()> allocation_task =
base::BindOnce(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr(), false);
base::OnceCallback<void()> allocation_task = base::BindOnce(
&CefRenderWidgetHostViewOSR::OnDidUpdateVisualPropertiesComplete,
weak_ptr_factory_.GetWeakPtr(), metadata);
return viz::ScopedSurfaceIdAllocator(std::move(allocation_task));
}
#endif
viz::SurfaceId CefRenderWidgetHostViewOSR::GetCurrentSurfaceId() const {
return GetDelegatedFrameHost()
? GetDelegatedFrameHost()->GetCurrentSurfaceId()
: viz::SurfaceId();
return delegated_frame_host_ ? delegated_frame_host_->GetCurrentSurfaceId()
: viz::SurfaceId();
}
content::BrowserAccessibilityManager*
@@ -811,17 +888,28 @@ void CefRenderWidgetHostViewOSR::SelectionChanged(const base::string16& text,
const viz::LocalSurfaceIdAllocation&
CefRenderWidgetHostViewOSR::GetLocalSurfaceIdAllocation() const {
return local_surface_id_allocation_;
return const_cast<CefRenderWidgetHostViewOSR*>(this)
->GetOrCreateLocalSurfaceIdAllocation();
}
const viz::FrameSinkId& CefRenderWidgetHostViewOSR::GetFrameSinkId() const {
return GetDelegatedFrameHost()->frame_sink_id();
return delegated_frame_host_->frame_sink_id();
}
viz::FrameSinkId CefRenderWidgetHostViewOSR::GetRootFrameSinkId() {
return compositor_->frame_sink_id();
}
void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation() {
if (video_consumer_) {
// Need to wait for the first frame of the new size before calling
// SizeChanged. Otherwise, the video frame will be letterboxed.
auto metadata =
host_->render_frame_metadata_provider()->LastRenderFrameMetadata();
video_consumer_->SizeChanged(metadata.viewport_size_in_pixels);
}
}
std::unique_ptr<content::SyntheticGestureTarget>
CefRenderWidgetHostViewOSR::CreateSyntheticGestureTarget() {
return std::make_unique<CefSyntheticGestureTargetOSR>(host());
@@ -836,8 +924,8 @@ void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) {
}
void CefRenderWidgetHostViewOSR::SetWantsAnimateOnlyBeginFrames() {
if (GetDelegatedFrameHost()) {
GetDelegatedFrameHost()->SetWantsAnimateOnlyBeginFrames();
if (delegated_frame_host_) {
delegated_frame_host_->SetWantsAnimateOnlyBeginFrames();
}
}
@@ -850,28 +938,37 @@ bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView(
return true;
}
return false;
return target_view->TransformPointToLocalCoordSpace(
point, GetCurrentSurfaceId(), transformed_point);
}
void CefRenderWidgetHostViewOSR::DidNavigate() {
// With surface synchronization enabled we need to force synchronization on
// first navigation.
ResizeRootLayer(true);
if (!IsShowing()) {
// Navigating while hidden should not allocate a new LocalSurfaceID. Once
// sizes are ready, or we begin to Show, we can then allocate the new
// LocalSurfaceId.
InvalidateLocalSurfaceId();
} else {
if (is_first_navigation_) {
// The first navigation does not need a new LocalSurfaceID. The renderer
// can use the ID that was already provided.
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
GetLocalSurfaceIdAllocation());
} else {
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
base::nullopt);
}
}
if (delegated_frame_host_)
delegated_frame_host_->DidNavigate();
is_first_navigation_ = false;
}
void CefRenderWidgetHostViewOSR::OnDisplayDidFinishFrame(
const viz::BeginFrameAck& /*ack*/) {
void CefRenderWidgetHostViewOSR::OnFrameComplete(
const viz::BeginFrameAck& ack) {
// TODO(cef): is there something we need to track with this notification?
}
void CefRenderWidgetHostViewOSR::OnNeedsExternalBeginFrames(
bool needs_begin_frames) {
SetFrameRate();
needs_external_begin_frames_ = needs_begin_frames;
}
std::unique_ptr<viz::HostDisplayClient>
CefRenderWidgetHostViewOSR::CreateHostDisplayClient() {
host_display_client_ =
@@ -891,16 +988,53 @@ bool CefRenderWidgetHostViewOSR::InstallTransparency() {
return false;
}
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties(bool force) {
void CefRenderWidgetHostViewOSR::WasResized() {
// Only one resize will be in-flight at a time.
if (hold_resize_) {
if (!pending_resize_)
pending_resize_ = true;
if (force)
pending_resize_force_ = true;
return;
}
ResizeRootLayer(force);
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
base::nullopt);
}
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties(
const cc::DeadlinePolicy& deadline_policy,
const base::Optional<viz::LocalSurfaceIdAllocation>&
child_local_surface_id_allocation) {
SetFrameRate();
const bool resized = ResizeRootLayer();
bool surface_id_updated = false;
if (!resized && child_local_surface_id_allocation) {
// Update the current surface ID.
parent_local_surface_id_allocator_->UpdateFromChild(
*child_local_surface_id_allocation);
surface_id_updated = true;
}
// Allocate a new surface ID if the surface has been resized or if the current
// ID is invalid (meaning we may have been evicted).
if (resized || !GetCurrentLocalSurfaceIdAllocation().IsValid()) {
AllocateLocalSurfaceId();
surface_id_updated = true;
}
if (surface_id_updated) {
delegated_frame_host_->EmbedSurface(
GetCurrentLocalSurfaceIdAllocation().local_surface_id(),
GetViewBounds().size(), deadline_policy);
// |render_widget_host_| will retrieve resize parameters from the
// DelegatedFrameHost and this view, so SynchronizeVisualProperties must be
// called last.
if (render_widget_host_) {
render_widget_host_->SynchronizeVisualProperties();
}
}
}
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
@@ -908,7 +1042,8 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
if (!render_widget_host_)
return;
SynchronizeVisualProperties();
SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(),
base::nullopt);
if (render_widget_host_->delegate())
render_widget_host_->delegate()->SendScreenRects();
@@ -956,7 +1091,9 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
render_widget_host_->ProgressFlingIfNeeded(frame_time);
compositor_->context_factory_private()->IssueExternalBeginFrame(
compositor_.get(), begin_frame_args);
compositor_.get(), begin_frame_args, /* force= */ true,
base::BindOnce(&CefRenderWidgetHostViewOSR::OnFrameComplete,
weak_ptr_factory_.GetWeakPtr()));
if (!IsPopupWidget() && popup_host_view_) {
popup_host_view_->SendExternalBeginFrame();
@@ -1024,9 +1161,17 @@ void CefRenderWidgetHostViewOSR::SendMouseEvent(
}
if (render_widget_host_ && render_widget_host_->GetView()) {
// Direct routing requires that mouse events go directly to the View.
render_widget_host_->GetView()->ProcessMouseEvent(
event, ui::LatencyInfo(ui::SourceEventType::OTHER));
if (ShouldRouteEvents()) {
// RouteMouseEvent wants non-const pointer to WebMouseEvent, but it only
// forwards it to RenderWidgetTargeter::FindTargetAndDispatch as a const
// reference, so const_cast here is safe.
render_widget_host_->delegate()->GetInputEventRouter()->RouteMouseEvent(
this, const_cast<blink::WebMouseEvent*>(&event),
ui::LatencyInfo(ui::SourceEventType::OTHER));
} else {
render_widget_host_->GetView()->ProcessMouseEvent(
event, ui::LatencyInfo(ui::SourceEventType::OTHER));
}
}
}
@@ -1034,26 +1179,17 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
const blink::WebMouseWheelEvent& event) {
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendMouseWheelEvent");
blink::WebMouseWheelEvent mouse_wheel_event(event);
mouse_wheel_phase_handler_.SendWheelEndForTouchpadScrollingIfNeeded(false);
mouse_wheel_phase_handler_.AddPhaseIfNeededAndScheduleEndEvent(
mouse_wheel_event, false);
if (!IsPopupWidget()) {
if (browser_impl_.get())
browser_impl_->CancelContextMenu();
if (popup_host_view_) {
if (popup_host_view_->popup_position_.Contains(
mouse_wheel_event.PositionInWidget().x,
mouse_wheel_event.PositionInWidget().y)) {
blink::WebMouseWheelEvent popup_mouse_wheel_event(mouse_wheel_event);
event.PositionInWidget().x, event.PositionInWidget().y)) {
blink::WebMouseWheelEvent popup_mouse_wheel_event(event);
popup_mouse_wheel_event.SetPositionInWidget(
mouse_wheel_event.PositionInWidget().x -
popup_host_view_->popup_position_.x(),
mouse_wheel_event.PositionInWidget().y -
popup_host_view_->popup_position_.y());
event.PositionInWidget().x - popup_host_view_->popup_position_.x(),
event.PositionInWidget().y - popup_host_view_->popup_position_.y());
popup_mouse_wheel_event.SetPositionInScreen(
popup_mouse_wheel_event.PositionInWidget().x,
popup_mouse_wheel_event.PositionInWidget().y);
@@ -1077,12 +1213,12 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
}
const gfx::Rect& guest_bounds =
guest_host_view->render_widget_host_->GetView()->GetViewBounds();
if (guest_bounds.Contains(mouse_wheel_event.PositionInWidget().x,
mouse_wheel_event.PositionInWidget().y)) {
blink::WebMouseWheelEvent guest_mouse_wheel_event(mouse_wheel_event);
if (guest_bounds.Contains(event.PositionInWidget().x,
event.PositionInWidget().y)) {
blink::WebMouseWheelEvent guest_mouse_wheel_event(event);
guest_mouse_wheel_event.SetPositionInWidget(
mouse_wheel_event.PositionInWidget().x - guest_bounds.x(),
mouse_wheel_event.PositionInWidget().y - guest_bounds.y());
event.PositionInWidget().x - guest_bounds.x(),
event.PositionInWidget().y - guest_bounds.y());
guest_mouse_wheel_event.SetPositionInScreen(
guest_mouse_wheel_event.PositionInWidget().x,
guest_mouse_wheel_event.PositionInWidget().y);
@@ -1095,9 +1231,22 @@ void CefRenderWidgetHostViewOSR::SendMouseWheelEvent(
}
if (render_widget_host_ && render_widget_host_->GetView()) {
// Direct routing requires that mouse events go directly to the View.
render_widget_host_->GetView()->ProcessMouseWheelEvent(
mouse_wheel_event, ui::LatencyInfo(ui::SourceEventType::WHEEL));
blink::WebMouseWheelEvent mouse_wheel_event(event);
mouse_wheel_phase_handler_.SendWheelEndForTouchpadScrollingIfNeeded(false);
mouse_wheel_phase_handler_.AddPhaseIfNeededAndScheduleEndEvent(
mouse_wheel_event, false);
if (ShouldRouteEvents()) {
render_widget_host_->delegate()
->GetInputEventRouter()
->RouteMouseWheelEvent(
this, const_cast<blink::WebMouseWheelEvent*>(&mouse_wheel_event),
ui::LatencyInfo(ui::SourceEventType::WHEEL));
} else {
render_widget_host_->GetView()->ProcessMouseWheelEvent(
mouse_wheel_event, ui::LatencyInfo(ui::SourceEventType::WHEEL));
}
}
}
@@ -1255,32 +1404,16 @@ void CefRenderWidgetHostViewOSR::UpdateFrameRate() {
frame_rate_threshold_us_ = 0;
SetFrameRate();
if (video_consumer_) {
video_consumer_->SetFrameRate(
base::TimeDelta::FromMicroseconds(frame_rate_threshold_us_));
}
// Notify the guest hosts if any.
for (auto guest_host_view : guest_host_views_)
guest_host_view->UpdateFrameRate();
}
void CefRenderWidgetHostViewOSR::HoldResize() {
if (!hold_resize_)
hold_resize_ = true;
}
void CefRenderWidgetHostViewOSR::ReleaseResize() {
if (!hold_resize_)
return;
hold_resize_ = false;
if (pending_resize_) {
bool force = pending_resize_force_;
pending_resize_ = false;
pending_resize_force_ = false;
CEF_POST_TASK(
CEF_UIT,
base::Bind(&CefRenderWidgetHostViewOSR::SynchronizeVisualProperties,
weak_ptr_factory_.GetWeakPtr(), force));
}
}
gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() {
return gfx::ConvertSizeToPixel(current_device_scale_factor_,
GetViewBounds().size());
@@ -1299,6 +1432,11 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
const void* pixels) {
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnPaint");
// Workaround for https://bitbucket.org/chromiumembedded/cef/issues/2817
if (!is_showing_) {
return;
}
if (!pixels) {
return;
}
@@ -1307,10 +1445,6 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
browser_impl_->client()->GetRenderHandler();
CHECK(handler);
// Don't execute SynchronizeVisualProperties while the OnPaint callback is
// pending.
HoldResize();
gfx::Rect rect_in_pixels(0, 0, pixel_size.width(), pixel_size.height());
rect_in_pixels.Intersect(damage_rect);
@@ -1321,18 +1455,15 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
handler->OnPaint(browser_impl_.get(), IsPopupWidget() ? PET_POPUP : PET_VIEW,
rcList, pixels, pixel_size.width(), pixel_size.height());
ReleaseResize();
// Release the resize hold when we reach the desired size.
if (hold_resize_ && pixel_size == SizeInPixels())
ReleaseResizeHold();
}
ui::Layer* CefRenderWidgetHostViewOSR::GetRootLayer() const {
return root_layer_.get();
}
content::DelegatedFrameHost* CefRenderWidgetHostViewOSR::GetDelegatedFrameHost()
const {
return delegated_frame_host_.get();
}
void CefRenderWidgetHostViewOSR::SetFrameRate() {
CefRefPtr<CefBrowserHostImpl> browser;
if (parent_host_view_) {
@@ -1364,19 +1495,13 @@ void CefRenderWidgetHostViewOSR::SetFrameRate() {
}
}
void CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() {
float new_scale_factor = kDefaultScaleFactor;
bool CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() {
// This method should not be called while the resize hold is active.
DCHECK(!hold_resize_);
if (browser_impl_.get()) {
CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(),
CefRect());
CefRefPtr<CefRenderHandler> handler =
browser_impl_->client()->GetRenderHandler();
CHECK(handler);
if (handler->GetScreenInfo(browser_impl_.get(), screen_info)) {
new_scale_factor = screen_info.device_scale_factor;
}
}
const float new_scale_factor = ::GetDeviceScaleFactor(browser_impl_.get());
if (new_scale_factor == current_device_scale_factor_)
return false;
current_device_scale_factor_ = new_scale_factor;
@@ -1388,52 +1513,69 @@ void CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() {
if (rwhi->GetView())
rwhi->GetView()->set_current_device_scale_factor(new_scale_factor);
}
return true;
}
void CefRenderWidgetHostViewOSR::ResizeRootLayer(bool force) {
SetFrameRate();
bool CefRenderWidgetHostViewOSR::SetViewBounds() {
// This method should not be called while the resize hold is active.
DCHECK(!hold_resize_);
const float orgScaleFactor = current_device_scale_factor_;
SetDeviceScaleFactor();
const bool scaleFactorDidChange =
(orgScaleFactor != current_device_scale_factor_);
// Popup bounds are set in InitAsPopup.
if (IsPopupWidget())
return false;
gfx::Size size;
if (!IsPopupWidget())
size = GetViewBounds().size();
else
size = popup_position_.size();
const gfx::Rect& new_bounds = ::GetViewBounds(browser_impl_.get());
if (new_bounds == current_view_bounds_)
return false;
if (!force && !scaleFactorDidChange &&
size == GetRootLayer()->bounds().size()) {
return;
}
current_view_bounds_ = new_bounds;
return true;
}
GetRootLayer()->SetBounds(gfx::Rect(size));
bool CefRenderWidgetHostViewOSR::SetRootLayerSize(bool force) {
const bool scale_factor_changed = SetDeviceScaleFactor();
const bool view_bounds_changed = SetViewBounds();
if (!force && !scale_factor_changed && !view_bounds_changed)
return false;
const gfx::Size& size_in_pixels =
gfx::ConvertSizeToPixel(current_device_scale_factor_, size);
local_surface_id_allocator_.GenerateId();
local_surface_id_allocation_ =
local_surface_id_allocator_.GetCurrentLocalSurfaceIdAllocation();
GetRootLayer()->SetBounds(gfx::Rect(GetViewBounds().size()));
if (compositor_) {
compositor_local_surface_id_allocator_.GenerateId();
compositor_->SetScaleAndSize(current_device_scale_factor_, size_in_pixels,
compositor_->SetScaleAndSize(current_device_scale_factor_, SizeInPixels(),
compositor_local_surface_id_allocator_
.GetCurrentLocalSurfaceIdAllocation());
}
GetDelegatedFrameHost()->EmbedSurface(
local_surface_id_allocation_.local_surface_id(), size,
cc::DeadlinePolicy::UseDefaultDeadline());
return (scale_factor_changed || view_bounds_changed);
}
// Note that |render_widget_host_| will retrieve resize parameters from the
// DelegatedFrameHost, so it must have SynchronizeVisualProperties called
// after.
if (render_widget_host_)
render_widget_host_->SynchronizeVisualProperties();
bool CefRenderWidgetHostViewOSR::ResizeRootLayer() {
if (!hold_resize_) {
// The resize hold is not currently active.
if (SetRootLayerSize(false /* force */)) {
// The size has changed. Avoid resizing again until ReleaseResizeHold() is
// called.
hold_resize_ = true;
return true;
}
} else if (!pending_resize_) {
// The resize hold is currently active. Another resize will be triggered
// from ReleaseResizeHold().
pending_resize_ = true;
}
return false;
}
void CefRenderWidgetHostViewOSR::ReleaseResizeHold() {
DCHECK(hold_resize_);
hold_resize_ = false;
if (pending_resize_) {
pending_resize_ = false;
CEF_POST_TASK(CEF_UIT, base::Bind(&CefRenderWidgetHostViewOSR::WasResized,
weak_ptr_factory_.GetWeakPtr()));
}
}
void CefRenderWidgetHostViewOSR::CancelWidget() {
@@ -1517,7 +1659,7 @@ void CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped(
void CefRenderWidgetHostViewOSR::InvalidateInternal(
const gfx::Rect& bounds_in_pixels) {
if (video_consumer_) {
video_consumer_->SizeChanged();
video_consumer_->RequestRefreshFrame(bounds_in_pixels);
} else if (host_display_client_) {
OnPaint(bounds_in_pixels, host_display_client_->GetPixelSize(),
host_display_client_->GetPixelMemory());

View File

@@ -21,6 +21,7 @@
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "build/build_config.h"
#include "cc/layers/deadline_policy.h"
#include "components/viz/common/frame_sinks/begin_frame_source.h"
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
@@ -29,7 +30,6 @@
#include "content/public/common/widget_type.h"
#include "ui/base/cursor/types/cursor_types.h"
#include "ui/compositor/compositor.h"
#include "ui/compositor/external_begin_frame_client.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/gesture_detection/filtered_gesture_provider.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
@@ -95,7 +95,6 @@ class MacHelper;
#endif
class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
public ui::ExternalBeginFrameClient,
public ui::CompositorDelegate,
public content::TextInputManager::Observer,
public ui::GestureProviderClient {
@@ -194,10 +193,9 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
const override;
const viz::FrameSinkId& GetFrameSinkId() const override;
viz::FrameSinkId GetRootFrameSinkId() override;
void OnRenderFrameMetadataChangedAfterActivation() override;
// ui::ExternalBeginFrameClient implementation.
void OnDisplayDidFinishFrame(const viz::BeginFrameAck& ack) override;
void OnNeedsExternalBeginFrames(bool needs_begin_frames) override;
void OnFrameComplete(const viz::BeginFrameAck& ack);
// ui::CompositorDelegate implementation.
std::unique_ptr<viz::HostDisplayClient> CreateHostDisplayClient() override;
@@ -215,7 +213,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool InstallTransparency();
void SynchronizeVisualProperties(bool force = false);
void WasResized();
void SynchronizeVisualProperties(
const cc::DeadlinePolicy& deadline_policy,
const base::Optional<viz::LocalSurfaceIdAllocation>&
child_local_surface_id_allocation);
void OnScreenInfoChanged();
void Invalidate(CefBrowserHost::PaintElementType type);
void SendExternalBeginFrame();
@@ -227,9 +229,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void SendFocusEvent(bool focus);
void UpdateFrameRate();
void HoldResize();
void ReleaseResize();
gfx::Size SizeInPixels();
void OnPaint(const gfx::Rect& damage_rect,
const gfx::Size& pixel_size,
@@ -272,12 +271,18 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void OnPresentCompositorFrame();
private:
content::DelegatedFrameHost* GetDelegatedFrameHost() const;
void OnDidUpdateVisualPropertiesComplete(
const cc::RenderFrameMetadata& metadata);
private:
void SetFrameRate();
void SetDeviceScaleFactor();
void ResizeRootLayer(bool force);
bool SetDeviceScaleFactor();
bool SetViewBounds();
bool SetRootLayerSize(bool force);
// Manages resizing so that only one resize request is in-flight at a time.
bool ResizeRootLayer();
void ReleaseResizeHold();
void CancelWidget();
@@ -300,6 +305,27 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
viz::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack);
// Forces the view to allocate a new viz::LocalSurfaceId for the next
// CompositorFrame submission in anticipation of a synchronization operation
// that does not involve a resize or a device scale factor change.
void AllocateLocalSurfaceId();
const viz::LocalSurfaceIdAllocation& GetCurrentLocalSurfaceIdAllocation()
const;
// Sets the current viz::LocalSurfaceId, in cases where the embedded client
// has allocated one. Also sets child sequence number component of the
// viz::LocalSurfaceId allocator.
void UpdateLocalSurfaceIdFromEmbeddedClient(
const base::Optional<viz::LocalSurfaceIdAllocation>&
local_surface_id_allocation);
// Returns the current viz::LocalSurfaceIdAllocation.
const viz::LocalSurfaceIdAllocation& GetOrCreateLocalSurfaceIdAllocation();
// Marks the current viz::LocalSurfaceId as invalid. AllocateLocalSurfaceId
// must be called before submitting new CompositorFrames.
void InvalidateLocalSurfaceId();
void AddDamageRect(uint32_t sequence, const gfx::Rect& rect);
// Applies background color without notifying the RenderWidget about
@@ -313,15 +339,17 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
// The background color of the web content.
SkColor background_color_;
int frame_rate_threshold_us_;
int frame_rate_threshold_us_ = 0;
std::unique_ptr<ui::Compositor> compositor_;
std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_;
std::unique_ptr<content::DelegatedFrameHostClient>
delegated_frame_host_client_;
std::unique_ptr<ui::Layer> root_layer_;
viz::LocalSurfaceIdAllocation local_surface_id_allocation_;
viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
// Used to allocate LocalSurfaceIds when this is embedding external content.
std::unique_ptr<viz::ParentLocalSurfaceIdAllocator>
parent_local_surface_id_allocator_;
viz::ParentLocalSurfaceIdAllocator compositor_local_surface_id_allocator_;
#if defined(USE_X11)
@@ -338,12 +366,11 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool external_begin_frame_enabled_ = false;
bool needs_external_begin_frames_ = false;
CefHostDisplayClientOSR* host_display_client_;
CefHostDisplayClientOSR* host_display_client_ = nullptr;
std::unique_ptr<CefVideoConsumerOSR> video_consumer_;
bool hold_resize_;
bool pending_resize_;
bool pending_resize_force_;
bool hold_resize_ = false;
bool pending_resize_ = false;
// The associated Model. While |this| is being Destroyed,
// |render_widget_host_| is NULL and the message loop is run one last time
@@ -352,14 +379,16 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool has_parent_;
CefRenderWidgetHostViewOSR* parent_host_view_;
CefRenderWidgetHostViewOSR* popup_host_view_;
CefRenderWidgetHostViewOSR* child_host_view_;
CefRenderWidgetHostViewOSR* popup_host_view_ = nullptr;
CefRenderWidgetHostViewOSR* child_host_view_ = nullptr;
std::set<CefRenderWidgetHostViewOSR*> guest_host_views_;
CefRefPtr<CefBrowserHostImpl> browser_impl_;
bool is_showing_;
bool is_destroyed_;
bool is_showing_ = false;
bool is_destroyed_ = false;
bool is_first_navigation_ = true;
gfx::Rect current_view_bounds_;
gfx::Rect popup_position_;
base::Lock damage_rect_lock_;
std::map<uint32_t, gfx::Rect> damage_rects_;
@@ -370,7 +399,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
// The last scroll offset of the view.
gfx::Vector2dF last_scroll_offset_;
bool is_scroll_offset_changed_pending_;
bool is_scroll_offset_changed_pending_ = false;
content::MouseWheelPhaseHandler mouse_wheel_phase_handler_;
@@ -386,7 +415,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
ui::FilteredGestureProvider gesture_provider_;
CefMotionEventOSR pointer_state_;
bool forward_touch_to_popup_;
bool forward_touch_to_popup_ = false;
base::WeakPtrFactory<CefRenderWidgetHostViewOSR> weak_ptr_factory_;

View File

@@ -5,6 +5,7 @@
#include "cef/libcef/browser/osr/software_output_device_proxy.h"
#include "base/memory/shared_memory.h"
#include "base/trace_event/trace_event.h"
#include "components/viz/common/resources/resource_sizes.h"
#include "mojo/public/cpp/base/shared_memory_utils.h"
#include "mojo/public/cpp/system/platform_handle.h"

View File

@@ -11,16 +11,34 @@
#include "media/capture/mojom/video_capture_types.mojom.h"
#include "ui/gfx/skbitmap_operations.h"
namespace {
// Helper to always call Done() at the end of OnFrameCaptured().
class ScopedVideoFrameDone {
public:
explicit ScopedVideoFrameDone(
viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks)
: callbacks_(std::move(callbacks)) {}
~ScopedVideoFrameDone() { callbacks_->Done(); }
private:
viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks_;
};
} // namespace
CefVideoConsumerOSR::CefVideoConsumerOSR(CefRenderWidgetHostViewOSR* view)
: view_(view),
video_capturer_(view->CreateVideoCapturer()),
weak_ptr_factory_(this) {
const gfx::Size view_size = view_->SizeInPixels();
video_capturer_->SetResolutionConstraints(view_size, view_size, true);
video_capturer_->SetAutoThrottlingEnabled(false);
video_capturer_->SetMinSizeChangePeriod(base::TimeDelta());
: view_(view), video_capturer_(view->CreateVideoCapturer()) {
video_capturer_->SetFormat(media::PIXEL_FORMAT_ARGB,
gfx::ColorSpace::CreateREC709());
// Always use the highest resolution within constraints that doesn't exceed
// the source size.
video_capturer_->SetAutoThrottlingEnabled(false);
video_capturer_->SetMinSizeChangePeriod(base::TimeDelta());
SizeChanged(view_->SizeInPixels());
SetActive(true);
}
CefVideoConsumerOSR::~CefVideoConsumerOSR() = default;
@@ -37,28 +55,40 @@ void CefVideoConsumerOSR::SetFrameRate(base::TimeDelta frame_rate) {
video_capturer_->SetMinCapturePeriod(frame_rate);
}
void CefVideoConsumerOSR::SizeChanged() {
const gfx::Size view_size = view_->SizeInPixels();
video_capturer_->SetResolutionConstraints(view_size, view_size, true);
void CefVideoConsumerOSR::SizeChanged(const gfx::Size& size_in_pixels) {
if (size_in_pixels_ == size_in_pixels)
return;
size_in_pixels_ = size_in_pixels;
// Capture resolution will be held constant.
video_capturer_->SetResolutionConstraints(size_in_pixels, size_in_pixels,
true /* use_fixed_aspect_ratio */);
}
void CefVideoConsumerOSR::RequestRefreshFrame(
const base::Optional<gfx::Rect>& bounds_in_pixels) {
bounds_in_pixels_ = bounds_in_pixels;
video_capturer_->RequestRefreshFrame();
}
// Frame size values are as follows:
// info->coded_size = Width and height of the video frame. Not all pixels in
// this region are valid.
// info->visible_rect = Region of coded_size that contains image data, also
// known as the clean aperture.
// content_rect = Region of the frame that contains the captured content, with
// the rest of the frame having been letterboxed to adhere to resolution
// constraints.
void CefVideoConsumerOSR::OnFrameCaptured(
base::ReadOnlySharedMemoryRegion data,
::media::mojom::VideoFrameInfoPtr info,
const gfx::Rect& content_rect,
viz::mojom::FrameSinkVideoConsumerFrameCallbacksPtr callbacks) {
const gfx::Size view_size = view_->SizeInPixels();
if (view_size != content_rect.size()) {
video_capturer_->SetResolutionConstraints(view_size, view_size, true);
video_capturer_->RequestRefreshFrame();
return;
}
ScopedVideoFrameDone scoped_done(std::move(callbacks));
if (!data.IsValid()) {
callbacks->Done();
if (!data.IsValid())
return;
}
base::ReadOnlySharedMemoryMapping mapping = data.Map();
if (!mapping.IsValid()) {
DLOG(ERROR) << "Shared memory mapping failed.";
@@ -78,9 +108,24 @@ void CefVideoConsumerOSR::OnFrameCaptured(
metadata.MergeInternalValuesFrom(info->metadata);
gfx::Rect damage_rect;
if (!metadata.GetRect(media::VideoFrameMetadata::CAPTURE_UPDATE_RECT,
&damage_rect)) {
damage_rect = content_rect;
if (bounds_in_pixels_) {
// Use the bounds passed to RequestRefreshFrame().
damage_rect = gfx::Rect(info->coded_size);
damage_rect.Intersect(*bounds_in_pixels_);
bounds_in_pixels_ = base::nullopt;
} else {
// Retrieve the rectangular region of the frame that has changed since the
// frame with the directly preceding CAPTURE_COUNTER. If that frame was not
// received, typically because it was dropped during transport from the
// producer, clients must assume that the entire frame has changed.
// This rectangle is relative to the full frame data, i.e. [0, 0,
// coded_size.width(), coded_size.height()]. It does not have to be
// fully contained within visible_rect.
if (!metadata.GetRect(media::VideoFrameMetadata::CAPTURE_UPDATE_RECT,
&damage_rect) ||
damage_rect.IsEmpty()) {
damage_rect = gfx::Rect(info->coded_size);
}
}
view_->OnPaint(damage_rect, info->coded_size, pixels);

View File

@@ -2,7 +2,7 @@
#define LIBCEF_BROWSER_OSR_VIDEO_CONSUMER_OSR_H_
#include "base/callback.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "components/viz/host/client_frame_sink_video_capturer.h"
class CefRenderWidgetHostViewOSR;
@@ -14,7 +14,8 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer {
void SetActive(bool active);
void SetFrameRate(base::TimeDelta frame_rate);
void SizeChanged();
void SizeChanged(const gfx::Size& size_in_pixels);
void RequestRefreshFrame(const base::Optional<gfx::Rect>& bounds_in_pixels);
private:
// viz::mojom::FrameSinkVideoConsumer implementation.
@@ -28,7 +29,8 @@ class CefVideoConsumerOSR : public viz::mojom::FrameSinkVideoConsumer {
CefRenderWidgetHostViewOSR* const view_;
std::unique_ptr<viz::ClientFrameSinkVideoCapturer> video_capturer_;
base::WeakPtrFactory<CefVideoConsumerOSR> weak_ptr_factory_;
gfx::Size size_in_pixels_;
base::Optional<gfx::Rect> bounds_in_pixels_;
DISALLOW_COPY_AND_ASSIGN(CefVideoConsumerOSR);
};

View File

@@ -96,8 +96,7 @@ gfx::Rect CefWebContentsViewOSR::GetViewBounds() const {
return view ? view->GetViewBounds() : gfx::Rect();
}
void CefWebContentsViewOSR::CreateView(const gfx::Size& initial_size,
gfx::NativeView context) {}
void CefWebContentsViewOSR::CreateView(gfx::NativeView context) {}
content::RenderWidgetHostViewBase* CefWebContentsViewOSR::CreateViewForWidget(
content::RenderWidgetHost* render_widget_host,

View File

@@ -44,8 +44,7 @@ class CefWebContentsViewOSR : public content::WebContentsView,
void FocusThroughTabTraversal(bool reverse) override;
content::DropData* GetDropData() const override;
gfx::Rect GetViewBounds() const override;
void CreateView(const gfx::Size& initial_size,
gfx::NativeView context) override;
void CreateView(gfx::NativeView context) override;
content::RenderWidgetHostViewBase* CreateViewForWidget(
content::RenderWidgetHost* render_widget_host,
content::RenderWidgetHost* embedder_render_widget_host) override;

View File

@@ -32,11 +32,11 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/web_preferences.h"
#include "content/public/common/webrtc_ip_handling_policy.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
#include "media/media_buildflags.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
namespace renderer_prefs {
@@ -308,8 +308,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
registry->RegisterBooleanPref(prefs::kWebRTCMultipleRoutesEnabled, true);
registry->RegisterBooleanPref(prefs::kWebRTCNonProxiedUdpEnabled, true);
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,
content::kWebRTCIPHandlingDefault);
blink::kWebRTCIPHandlingDefault);
registry->RegisterStringPref(prefs::kWebRTCUDPPortRange, std::string());
registry->RegisterBooleanPref(prefs::kWebRtcEventLogCollectionAllowed, false);
registry->RegisterListPref(prefs::kWebRtcLocalIpsAllowedUrls);
#if !defined(OS_MACOSX)
registry->RegisterBooleanPref(prefs::kFullscreenAllowed, true);

View File

@@ -26,6 +26,7 @@
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "components/printing/common/print.mojom.h"
#include "components/printing/common/print_messages.h"
#include "content/browser/download/download_manager_impl.h"
#include "content/public/browser/browser_context.h"
@@ -37,7 +38,9 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
#include "mojo/public/cpp/bindings/associated_remote.h"
#include "printing/metafile_skia.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "libcef/browser/thread_util.h"
@@ -55,10 +58,7 @@ void FillInDictionaryFromPdfPrintSettings(
int request_id,
base::DictionaryValue& print_settings) {
// Fixed settings.
print_settings.SetBoolean(kSettingPrintToPDF, true);
print_settings.SetBoolean(kSettingCloudPrintDialog, false);
print_settings.SetBoolean(kSettingPrintWithPrivet, false);
print_settings.SetBoolean(kSettingPrintWithExtension, false);
print_settings.SetIntKey(kSettingPrinterType, kPdfPrinter);
print_settings.SetInteger(kSettingColor, GRAY);
print_settings.SetInteger(kSettingDuplexMode, SIMPLEX);
print_settings.SetInteger(kSettingCopies, 1);
@@ -205,8 +205,12 @@ bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh,
FillInDictionaryFromPdfPrintSettings(settings, ++next_pdf_request_id_,
pdf_print_state_->settings_);
rfh->Send(new PrintMsg_InitiatePrintPreview(rfh->GetRoutingID(),
!!settings.selection_only));
mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>
print_render_frame_remote;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(
&print_render_frame_remote);
print_render_frame_remote->InitiatePrintPreview(nullptr,
!!settings.selection_only);
return true;
}
@@ -302,7 +306,11 @@ void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
DCHECK_EQ(pdf_print_state_->printing_rfh_, rfh);
rfh->Send(new PrintMsg_ClosePrintPreviewDialog(rfh->GetRoutingID()));
mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>
print_render_frame_remote;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(
&print_render_frame_remote);
print_render_frame_remote->OnPrintPreviewDialogClosed();
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
params.content.metafile_data_region);

View File

@@ -21,7 +21,10 @@
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/ssl_host_state_delegate.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/cpp/resolve_host_client_base.h"
#include "services/network/public/mojom/network_context.mojom.h"
using content::BrowserThread;
@@ -84,25 +87,21 @@ struct ResolveHostHelperOld {
class ResolveHostHelper : public network::ResolveHostClientBase {
public:
explicit ResolveHostHelper(CefRefPtr<CefResolveCallback> callback)
: callback_(callback), binding_(this) {}
: callback_(callback), receiver_(this) {}
void Start(CefBrowserContext* browser_context, const CefString& origin) {
CEF_REQUIRE_UIT();
network::mojom::HostResolverPtrInfo host_resolver_info;
browser_context->GetNetworkContext()->CreateHostResolver(
base::nullopt, mojo::MakeRequest(&host_resolver_info));
base::nullopt, host_resolver_.BindNewPipeAndPassReceiver());
network::mojom::ResolveHostClientPtr client_ptr;
binding_.Bind(mojo::MakeRequest(&client_ptr));
binding_.set_connection_error_handler(
host_resolver_.set_disconnect_handler(
base::BindOnce(&ResolveHostHelper::OnComplete, base::Unretained(this),
net::ERR_FAILED, base::nullopt));
host_resolver_ =
network::mojom::HostResolverPtr(std::move(host_resolver_info));
host_resolver_->ResolveHost(
net::HostPortPair::FromURL(GURL(origin.ToString())), nullptr,
std::move(client_ptr));
receiver_.BindNewPipeAndPassRemote());
}
private:
@@ -112,7 +111,7 @@ class ResolveHostHelper : public network::ResolveHostClientBase {
CEF_REQUIRE_UIT();
host_resolver_.reset();
binding_.Close();
receiver_.reset();
std::vector<CefString> resolved_ips;
@@ -130,8 +129,8 @@ class ResolveHostHelper : public network::ResolveHostClientBase {
CefRefPtr<CefResolveCallback> callback_;
network::mojom::HostResolverPtr host_resolver_;
mojo::Binding<network::mojom::ResolveHostClient> binding_;
mojo::Remote<network::mojom::HostResolver> host_resolver_;
mojo::Receiver<network::mojom::ResolveHostClient> receiver_;
DISALLOW_COPY_AND_ASSIGN(ResolveHostHelper);
};

View File

@@ -182,7 +182,7 @@ SkColor CefBrowserPlatformDelegateViews::GetBackgroundColor() const {
return native_delegate_->GetBackgroundColor();
}
void CefBrowserPlatformDelegateViews::SynchronizeVisualProperties() {
void CefBrowserPlatformDelegateViews::WasResized() {
content::RenderViewHost* host = browser_->web_contents()->GetRenderViewHost();
if (host)
host->GetWidget()->SynchronizeVisualProperties();

View File

@@ -42,7 +42,7 @@ class CefBrowserPlatformDelegateViews
bool CanUseSharedTexture() const override;
bool CanUseExternalBeginFrame() const override;
SkColor GetBackgroundColor() const override;
void SynchronizeVisualProperties() override;
void WasResized() override;
void SendKeyEvent(const content::NativeWebKeyboardEvent& event) override;
void SendMouseEvent(const blink::WebMouseEvent& event) override;
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event) override;

View File

@@ -51,6 +51,7 @@
#include "services/service_manager/sandbox/switches.h"
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_features.h"
#include "ui/base/ui_base_paths.h"
#include "ui/base/ui_base_switches.h"
@@ -256,22 +257,44 @@ base::FilePath GetUserDataPath() {
}
bool GetDefaultDownloadDirectory(base::FilePath* result) {
base::FilePath cur;
if (!chrome::GetUserDownloadsDirectory(&cur))
// This will return the safe download directory if necessary.
return chrome::GetUserDownloadsDirectory(result);
}
// From chrome/browser/download/download_prefs.cc.
// Consider downloads 'dangerous' if they go to the home directory on Linux and
// to the desktop on any platform.
bool DownloadPathIsDangerous(const base::FilePath& download_path) {
#if defined(OS_LINUX)
base::FilePath home_dir = base::GetHomeDir();
if (download_path == home_dir) {
return true;
}
#endif
base::FilePath desktop_dir;
if (!base::PathService::Get(base::DIR_USER_DESKTOP, &desktop_dir)) {
NOTREACHED();
return false;
*result = cur;
return true;
}
return (download_path == desktop_dir);
}
bool GetDefaultDownloadSafeDirectory(base::FilePath* result) {
base::FilePath cur;
#if defined(OS_WIN) || defined(OS_LINUX)
if (!chrome::GetUserDownloadsDirectorySafe(&cur))
// Start with the default download directory.
if (!GetDefaultDownloadDirectory(result))
return false;
if (DownloadPathIsDangerous(*result)) {
#if defined(OS_WIN) || defined(OS_LINUX)
// Explicitly switch to the safe download directory.
return chrome::GetUserDownloadsDirectorySafe(result);
#else
GetDefaultDownloadDirectory(&cur);
// No viable alternative on macOS.
return false;
#endif
*result = cur;
}
return true;
}
@@ -599,6 +622,15 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
features::kMimeHandlerViewInCrossProcessFrame.name);
}
#if defined(OS_WIN)
if (features::kCalculateNativeWinOcclusion.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
// TODO: Add support for occlusion detection in combination with native
// parent windows (see issue #2805).
disable_features.push_back(features::kCalculateNativeWinOcclusion.name);
}
#endif // defined(OS_WIN)
if (!disable_features.empty()) {
DCHECK(!base::FeatureList::GetInstance());
std::string disable_features_str =

View File

@@ -6,10 +6,10 @@
#include "chrome/common/net/net_resource_provider.h"
base::StringPiece NetResourceProvider(int key) {
scoped_refptr<base::RefCountedMemory> NetResourceProvider(int key) {
// Chrome performs substitution of localized strings for directory listings.
base::StringPiece value = chrome_common_net::NetResourceProvider(key);
if (value.empty())
scoped_refptr<base::RefCountedMemory> value = ChromeNetResourceProvider(key);
if (!value)
LOG(ERROR) << "No data resource available for id " << key;
return value;
}

View File

@@ -6,9 +6,9 @@
#define CEF_LIBCEF_COMMON_NET_RESOURCE_PROVIDER_H_
#pragma once
#include "base/strings/string_piece.h"
#include "base/memory/ref_counted_memory.h"
// This is called indirectly by the network layer to access resources.
base::StringPiece NetResourceProvider(int key);
scoped_refptr<base::RefCountedMemory> NetResourceProvider(int key);
#endif // CEF_LIBCEF_COMMON_NET_RESOURCE_PROVIDER_H_

View File

@@ -171,7 +171,7 @@ net::RedirectInfo MakeRedirectInfo(const network::ResourceRequest& request,
: net::URLRequest::NEVER_CHANGE_FIRST_PARTY_URL;
return net::RedirectInfo::ComputeRedirectInfo(
request.method, request.url, request.site_for_cookies,
request.top_frame_origin, first_party_url_policy, request.referrer_policy,
first_party_url_policy, request.referrer_policy,
request.referrer.spec(), status_code, location,
net::RedirectUtil::GetReferrerPolicyHeader(headers),
insecure_scheme_was_upgraded);

View File

@@ -37,6 +37,7 @@
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-shared.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"

View File

@@ -271,7 +271,7 @@ bool GetEncryptionSchemes(
return false;
}
const base::Value::ListStorage& list = value->GetList();
const base::span<const base::Value> list = value->GetList();
base::flat_set<media::EncryptionMode> result;
for (const auto& item : list) {
if (!item.is_string()) {

View File

@@ -61,7 +61,7 @@ void GoBack(blink::WebView* view) {
blink::WebViewImpl* view_impl = reinterpret_cast<blink::WebViewImpl*>(view);
if (view_impl->Client()->HistoryBackListCount() > 0) {
main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon(
-1, true /* has_user_gesture */, false /* from_script */);
-1, true /* has_user_gesture */);
}
}
}
@@ -75,7 +75,7 @@ void GoForward(blink::WebView* view) {
blink::WebViewImpl* view_impl = reinterpret_cast<blink::WebViewImpl*>(view);
if (view_impl->Client()->HistoryForwardListCount() > 0) {
main_frame->ToWebLocalFrame()->Client()->NavigateBackForwardSoon(
1, true /* has_user_gesture */, false /* from_script */);
1, true /* has_user_gesture */);
}
}
}

View File

@@ -576,28 +576,6 @@ bool CefContentRendererClient::OverrideCreatePlugin(
return true;
}
bool CefContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
const std::string& http_method,
bool is_initial_navigation,
bool is_server_redirect) {
DCHECK(!frame->Parent());
// For now, we skip the rest for POST submissions. This is because
// http://crbug.com/101395 is more likely to cause compatibility issues
// with hosted apps and extensions than WebUI pages. We will remove this
// check when cross-process POST submissions are supported.
if (http_method != "GET")
return false;
if (extensions::ExtensionsEnabled()) {
return extensions::CefExtensionsRendererClient::ShouldFork(
frame, url, is_initial_navigation, is_server_redirect);
}
return false;
}
void CefContentRendererClient::WillSendRequest(
blink::WebLocalFrame* frame,
ui::PageTransition transition_type,

View File

@@ -111,11 +111,6 @@ class CefContentRendererClient
bool OverrideCreatePlugin(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
blink::WebPlugin** plugin) override;
bool ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
const std::string& http_method,
bool is_initial_navigation,
bool is_server_redirect) override;
void WillSendRequest(blink::WebLocalFrame* frame,
ui::PageTransition transition_type,
const blink::WebURL& url,

View File

@@ -43,54 +43,6 @@ void IsGuestViewApiAvailableToScriptContext(
}
}
// Returns true if the frame is navigating to an URL either into or out of an
// extension app's extent.
bool CrossesExtensionExtents(blink::WebLocalFrame* frame,
const GURL& new_url,
bool is_extension_url,
bool is_initial_navigation) {
DCHECK(!frame->Parent());
GURL old_url(frame->GetDocument().Url());
extensions::RendererExtensionRegistry* extension_registry =
extensions::RendererExtensionRegistry::Get();
// If old_url is still empty and this is an initial navigation, then this is
// a window.open operation. We should look at the opener URL. Note that the
// opener is a local frame in this case.
if (is_initial_navigation && old_url.is_empty() && frame->Opener()) {
blink::WebLocalFrame* opener_frame = frame->Opener()->ToWebLocalFrame();
// We want to compare against the URL that determines the type of
// process. Use the URL of the opener's local frame root, which will
// correctly handle any site isolation modes (e.g. --site-per-process).
blink::WebLocalFrame* local_root = opener_frame->LocalRoot();
old_url = local_root->GetDocument().Url();
// If we're about to open a normal web page from a same-origin opener stuck
// in an extension process (other than the Chrome Web Store), we want to
// keep it in process to allow the opener to script it.
blink::WebDocument opener_document = opener_frame->GetDocument();
blink::WebSecurityOrigin opener_origin =
opener_document.GetSecurityOrigin();
bool opener_is_extension_url =
!opener_origin.IsUnique() && extension_registry->GetExtensionOrAppByURL(
opener_document.Url()) != nullptr;
const Extension* opener_top_extension =
extension_registry->GetExtensionOrAppByURL(old_url);
bool opener_is_web_store =
opener_top_extension &&
opener_top_extension->id() == extensions::kWebStoreAppId;
if (!is_extension_url && !opener_is_extension_url && !opener_is_web_store &&
CefExtensionsRendererClient::IsStandaloneExtensionProcess() &&
opener_origin.CanRequest(blink::WebURL(new_url)))
return false;
}
return extensions::CrossesExtensionProcessBoundary(
*extension_registry->GetMainThreadExtensionSet(), old_url, new_url);
}
} // namespace
CefExtensionsRendererClient::CefExtensionsRendererClient() {}
@@ -225,35 +177,6 @@ bool CefExtensionsRendererClient::IsStandaloneExtensionProcess() {
extensions::switches::kExtensionProcess);
}
// static
bool CefExtensionsRendererClient::ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
bool is_initial_navigation,
bool is_server_redirect) {
const extensions::RendererExtensionRegistry* extension_registry =
extensions::RendererExtensionRegistry::Get();
// Determine if the new URL is an extension (excluding bookmark apps).
const extensions::Extension* new_url_extension =
extensions::GetNonBookmarkAppExtension(
*extension_registry->GetMainThreadExtensionSet(), url);
bool is_extension_url = !!new_url_extension;
// If the navigation would cross an app extent boundary, we also need
// to defer to the browser to ensure process isolation. This is not
// necessary for server redirects, which will be transferred to a new
// process by the browser process when they are ready to commit. It is
// necessary for client redirects, which won't be transferred in the same
// way.
if (!is_server_redirect &&
CrossesExtensionExtents(frame, url, is_extension_url,
is_initial_navigation)) {
return true;
}
return false;
}
// static
content::BrowserPluginDelegate*
CefExtensionsRendererClient::CreateBrowserPluginDelegate(

View File

@@ -72,10 +72,6 @@ class CefExtensionsRendererClient : public ExtensionsRendererClient {
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame);
static bool IsStandaloneExtensionProcess();
static bool ShouldFork(blink::WebLocalFrame* frame,
const GURL& url,
bool is_initial_navigation,
bool is_server_redirect);
static content::BrowserPluginDelegate* CreateBrowserPluginDelegate(
content::RenderFrame* render_frame,
const content::WebPluginInfo& info,

View File

@@ -342,8 +342,8 @@ void CefFrameImpl::OnDraggableRegionsChanged() {
std::vector<Cef_DraggableRegion_Params> regions;
for (size_t i = 0; i < webregions.size(); ++i) {
Cef_DraggableRegion_Params region;
browser_->render_view()->ConvertViewportToWindowViaWidget(
&webregions[i].bounds);
auto render_frame = content::RenderFrameImpl::FromWebFrame(frame_);
render_frame->ConvertViewportToWindow(&webregions[i].bounds);
region.bounds = webregions[i].bounds;
region.draggable = webregions[i].draggable;
regions.push_back(region);

View File

@@ -57,10 +57,9 @@ void CefRenderFrameObserver::DidCommitProvisionalLoad(
OnLoadStart();
}
void CefRenderFrameObserver::DidFailProvisionalLoad(
const blink::WebURLError& error) {
void CefRenderFrameObserver::DidFailProvisionalLoad() {
if (frame_) {
OnLoadError(error);
OnLoadError();
}
}
@@ -224,17 +223,19 @@ void CefRenderFrameObserver::OnLoadStart() {
}
}
void CefRenderFrameObserver::OnLoadError(const blink::WebURLError& error) {
void CefRenderFrameObserver::OnLoadError() {
CefRefPtr<CefApp> app = CefContentClient::Get()->application();
if (app.get()) {
CefRefPtr<CefRenderProcessHandler> handler = app->GetRenderProcessHandler();
if (handler.get()) {
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
// Error codes were removed from DidFailProvisionalLoad() so we now always
// pass the same value.
if (load_handler.get()) {
const cef_errorcode_t errorCode =
static_cast<cef_errorcode_t>(error.reason());
const std::string& errorText = net::ErrorToString(error.reason());
const GURL& failedUrl = error.url();
static_cast<cef_errorcode_t>(net::ERR_ABORTED);
const std::string& errorText = net::ErrorToString(errorCode);
const GURL failedUrl(frame_->GetURL().c_str());
blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
CefRefPtr<CefBrowserImpl> browserPtr =
CefBrowserImpl::GetBrowserForMainFrame(frame->Top());

View File

@@ -26,7 +26,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
mojo::ScopedMessagePipeHandle* interface_pipe) override;
void DidCommitProvisionalLoad(bool is_same_document_navigation,
ui::PageTransition transition) override;
void DidFailProvisionalLoad(const blink::WebURLError& error) override;
void DidFailProvisionalLoad() override;
void DidFinishLoad() override;
void FrameDetached() override;
void FrameFocused() override;
@@ -45,7 +45,7 @@ class CefRenderFrameObserver : public content::RenderFrameObserver {
private:
void OnLoadStart();
void OnLoadError(const blink::WebURLError& error);
void OnLoadError();
service_manager::BinderRegistry registry_;
CefFrameImpl* frame_ = nullptr;

View File

@@ -86,7 +86,7 @@ void CefRenderThreadObserver::UnregisterMojoInterfaces(
void CefRenderThreadObserver::SetInitialConfiguration(
bool is_incognito_process,
chrome::mojom::ChromeOSListenerRequest chromeos_listener_request) {
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener) {
is_incognito_process_ = is_incognito_process;
}
@@ -105,8 +105,9 @@ void CefRenderThreadObserver::SetFieldTrialGroup(
}
void CefRenderThreadObserver::OnRendererConfigurationAssociatedRequest(
chrome::mojom::RendererConfigurationAssociatedRequest request) {
renderer_configuration_bindings_.AddBinding(this, std::move(request));
mojo::PendingAssociatedReceiver<chrome::mojom::RendererConfiguration>
receiver) {
renderer_configuration_receivers_.Add(this, std::move(receiver));
}
void CefRenderThreadObserver::OnModifyCrossOriginWhitelistEntry(

View File

@@ -13,6 +13,7 @@
#include "components/content_settings/core/common/content_settings.h"
#include "content/public/renderer/render_thread_observer.h"
#include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
namespace visitedlink {
class VisitedLinkSlave;
@@ -46,9 +47,10 @@ class CefRenderThreadObserver : public content::RenderThreadObserver,
blink::AssociatedInterfaceRegistry* associated_interfaces) override;
// chrome::mojom::RendererConfiguration:
void SetInitialConfiguration(bool is_incognito_process,
chrome::mojom::ChromeOSListenerRequest
chromeos_listener_request) override;
void SetInitialConfiguration(
bool is_incognito_process,
mojo::PendingReceiver<chrome::mojom::ChromeOSListener> chromeos_listener)
override;
void SetConfiguration(chrome::mojom::DynamicParamsPtr params) override;
void SetContentSettingRules(
const RendererContentSettingRules& rules) override;
@@ -56,7 +58,8 @@ class CefRenderThreadObserver : public content::RenderThreadObserver,
const std::string& group_name) override;
void OnRendererConfigurationAssociatedRequest(
chrome::mojom::RendererConfigurationAssociatedRequest request);
mojo::PendingAssociatedReceiver<chrome::mojom::RendererConfiguration>
receiver);
// Message handlers called on the render thread.
void OnModifyCrossOriginWhitelistEntry(
@@ -68,8 +71,8 @@ class CefRenderThreadObserver : public content::RenderThreadObserver,
std::unique_ptr<visitedlink::VisitedLinkSlave> visited_link_slave_;
mojo::AssociatedBindingSet<chrome::mojom::RendererConfiguration>
renderer_configuration_bindings_;
mojo::AssociatedReceiverSet<chrome::mojom::RendererConfiguration>
renderer_configuration_receivers_;
DISALLOW_COPY_AND_ASSIGN(CefRenderThreadObserver);
};

View File

@@ -55,15 +55,13 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
int64_t total_decoded_body_length) override;
void DidStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle response_body) override;
bool WillFollowRedirect(
const WebURL& new_url,
const WebURL& new_site_for_cookies,
const base::Optional<blink::WebSecurityOrigin>& new_top_frame_origin,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
const WebURLResponse& passed_redirect_response,
bool& report_raw_headers) override;
bool WillFollowRedirect(const WebURL& new_url,
const WebURL& new_site_for_cookies,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,
const WebURLResponse& passed_redirect_response,
bool& report_raw_headers) override;
protected:
// The context_ pointer will outlive this object.
@@ -395,7 +393,6 @@ void CefWebURLLoaderClient::DidStartLoadingResponseBody(
bool CefWebURLLoaderClient::WillFollowRedirect(
const WebURL& new_url,
const WebURL& new_site_for_cookies,
const base::Optional<blink::WebSecurityOrigin>& new_top_frame_origin,
const WebString& new_referrer,
network::mojom::ReferrerPolicy new_referrer_policy,
const WebString& new_method,

View File

@@ -256,10 +256,12 @@ ErrnoLogMessage::~ErrnoLogMessage() {
} // namespace cef
std::ostream& operator<<(std::ostream& out, const wchar_t* wstr) {
cef_string_utf8_t str = {0};
std::wstring tmp_str(wstr);
cef_string_wide_to_utf8(wstr, tmp_str.size(), &str);
out << str.str;
cef_string_utf8_clear(&str);
if (!tmp_str.empty()) {
cef_string_utf8_t str = {0};
cef_string_wide_to_utf8(wstr, tmp_str.size(), &str);
out << str.str;
cef_string_utf8_clear(&str);
}
return out;
}

View File

@@ -6,84 +6,19 @@
#include <algorithm>
#include "include/base/cef_bind.h"
#include "include/base/cef_logging.h"
#include "include/base/cef_macros.h"
#include "include/cef_callback.h"
#include "include/cef_request.h"
#include "include/cef_stream.h"
#include "include/wrapper/cef_closure_task.h"
#include "include/cef_task.h"
#include "include/wrapper/cef_helpers.h"
// Class that represents a readable/writable character buffer.
class CefStreamResourceHandler::Buffer {
public:
Buffer() : size_(0), bytes_requested_(0), bytes_written_(0), bytes_read_(0) {}
void Reset(int new_size) {
if (size_ < new_size) {
size_ = new_size;
buffer_.reset(new char[size_]);
DCHECK(buffer_);
}
bytes_requested_ = new_size;
bytes_written_ = 0;
bytes_read_ = 0;
}
bool IsEmpty() const { return (bytes_written_ == 0); }
bool CanRead() const { return (bytes_read_ < bytes_written_); }
int WriteTo(void* data_out, int bytes_to_read) {
const int write_size =
std::min(bytes_to_read, bytes_written_ - bytes_read_);
if (write_size > 0) {
memcpy(data_out, buffer_.get() + bytes_read_, write_size);
bytes_read_ += write_size;
}
return write_size;
}
int ReadFrom(CefRefPtr<CefStreamReader> reader) {
// Read until the buffer is full or until Read() returns 0 to indicate no
// more data.
int bytes_read;
do {
bytes_read =
static_cast<int>(reader->Read(buffer_.get() + bytes_written_, 1,
bytes_requested_ - bytes_written_));
bytes_written_ += bytes_read;
} while (bytes_read != 0 && bytes_written_ < bytes_requested_);
return bytes_written_;
}
private:
scoped_ptr<char[]> buffer_;
int size_;
int bytes_requested_;
int bytes_written_;
int bytes_read_;
DISALLOW_COPY_AND_ASSIGN(Buffer);
};
CefStreamResourceHandler::CefStreamResourceHandler(
const CefString& mime_type,
CefRefPtr<CefStreamReader> stream)
: status_code_(200),
status_text_("OK"),
mime_type_(mime_type),
stream_(stream)
#if DCHECK_IS_ON()
,
buffer_owned_by_file_thread_(false)
#endif
{
stream_(stream) {
DCHECK(!mime_type_.empty());
DCHECK(stream_.get());
read_on_file_thread_ = stream_->MayBlock();
}
CefStreamResourceHandler::CefStreamResourceHandler(
@@ -96,22 +31,18 @@ CefStreamResourceHandler::CefStreamResourceHandler(
status_text_(status_text),
mime_type_(mime_type),
header_map_(header_map),
stream_(stream)
#if DCHECK_IS_ON()
,
buffer_owned_by_file_thread_(false)
#endif
{
stream_(stream) {
DCHECK(!mime_type_.empty());
DCHECK(stream_.get());
read_on_file_thread_ = stream_->MayBlock();
}
CefStreamResourceHandler::~CefStreamResourceHandler() {}
bool CefStreamResourceHandler::Open(CefRefPtr<CefRequest> request,
bool& handle_request,
CefRefPtr<CefCallback> callback) {
DCHECK(!CefCurrentlyOn(TID_UI) && !CefCurrentlyOn(TID_IO));
bool CefStreamResourceHandler::ProcessRequest(CefRefPtr<CefRequest> request,
CefRefPtr<CefCallback> callback) {
callback->Continue();
// Continue the request immediately.
handle_request = true;
return true;
}
@@ -119,6 +50,8 @@ void CefStreamResourceHandler::GetResponseHeaders(
CefRefPtr<CefResponse> response,
int64& response_length,
CefString& redirectUrl) {
CEF_REQUIRE_IO_THREAD();
response->SetStatus(status_code_);
response->SetStatusText(status_text_);
response->SetMimeType(mime_type_);
@@ -129,70 +62,26 @@ void CefStreamResourceHandler::GetResponseHeaders(
response_length = -1;
}
bool CefStreamResourceHandler::ReadResponse(void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefCallback> callback) {
bool CefStreamResourceHandler::Read(
void* data_out,
int bytes_to_read,
int& bytes_read,
CefRefPtr<CefResourceReadCallback> callback) {
DCHECK(!CefCurrentlyOn(TID_UI) && !CefCurrentlyOn(TID_IO));
DCHECK_GT(bytes_to_read, 0);
if (read_on_file_thread_) {
#if DCHECK_IS_ON()
DCHECK(!buffer_owned_by_file_thread_);
#endif
if (buffer_ && (buffer_->CanRead() || buffer_->IsEmpty())) {
if (buffer_->CanRead()) {
// Provide data from the buffer.
bytes_read = buffer_->WriteTo(data_out, bytes_to_read);
return (bytes_read > 0);
} else {
// End of the steam.
bytes_read = 0;
return false;
}
} else {
// Perform another read on the file thread.
bytes_read = 0;
#if DCHECK_IS_ON()
buffer_owned_by_file_thread_ = true;
#endif
CefPostTask(TID_FILE,
base::Bind(&CefStreamResourceHandler::ReadOnFileThread, this,
bytes_to_read, callback));
return true;
}
} else {
// Read until the buffer is full or until Read() returns 0 to indicate no
// more data.
bytes_read = 0;
int read = 0;
do {
read = static_cast<int>(
stream_->Read(static_cast<char*>(data_out) + bytes_read, 1,
bytes_to_read - bytes_read));
bytes_read += read;
} while (read != 0 && bytes_read < bytes_to_read);
// Read until the buffer is full or until Read() returns 0 to indicate no
// more data.
bytes_read = 0;
int read = 0;
do {
read = static_cast<int>(
stream_->Read(static_cast<char*>(data_out) + bytes_read, 1,
bytes_to_read - bytes_read));
bytes_read += read;
} while (read != 0 && bytes_read < bytes_to_read);
return (bytes_read > 0);
}
return (bytes_read > 0);
}
void CefStreamResourceHandler::Cancel() {}
void CefStreamResourceHandler::ReadOnFileThread(
int bytes_to_read,
CefRefPtr<CefCallback> callback) {
CEF_REQUIRE_FILE_THREAD();
#if DCHECK_IS_ON()
DCHECK(buffer_owned_by_file_thread_);
#endif
if (!buffer_)
buffer_.reset(new Buffer());
buffer_->Reset(bytes_to_read);
buffer_->ReadFrom(stream_);
#if DCHECK_IS_ON()
buffer_owned_by_file_thread_ = false;
#endif
callback->Continue();
}

View File

@@ -184,6 +184,9 @@ patches = [
},
{
# Fix chrome Widevine build on Linux.
#
# Remove incorrect assertion on Windows/macOS by cherry-picking this commit:
# https://chromium.googlesource.com/chromium/src/+/ec992a43e7
'name': 'chrome_widevine',
},
{
@@ -199,6 +202,11 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2359
'name': 'chrome_browser_content_settings',
},
{
# Don't initialize ExtensionSystemFactory when extensions are disabled.
# https://bitbucket.org/chromiumembedded/cef/issues/2852
'name': 'chrome_browser_themes',
},
{
# Make some methods of ProfileManager virtual.
#
@@ -209,6 +217,10 @@ patches = [
{
# Show the CEF Save As dialog.
# https://bitbucket.org/chromiumembedded/cef/issues/2613
#
# Fix fatal error: 'components/printing/common/print.mojom.h' file not found
# From chrome/browser/ui/browser_commands.cc via
# chrome/browser/printing/print_view_manager_common.h
'name': 'chrome_browser_net_export',
},
{
@@ -461,4 +473,27 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2745
'name': 'osr_fling_2745',
},
{
# Windows: Fix ImportError: No module named win32file
# https://bugs.chromium.org/p/chromium/issues/detail?id=1033106#c7
'name': 'win_tool_wrapper_1033106',
},
{
# Fix Jumbo build errors.
# - error: redefinition of 'CreateExtraView'
'name': 'build_jumbo',
},
{
# Windows: Build the double_conversion target as C++17 to avoid export of
# std::is_integral templates that should be inlined.
# https://bitbucket.org/chromiumembedded/cef/issues/2819
'name': 'win_double_conversion_2819',
},
{
# Fix Check failed: !root_paint_fragment.Parent() when running
# `ceftests.exe --gtest_filter=DownloadTest.ClickedRC*` by reverting
# https://chromium-review.googlesource.com/c/chromium/src/+/1903768
# https://bugs.chromium.org/p/chromium/issues/detail?id=1008523#c61
'name': 'blink_layout_inline_1008523',
}
]

View File

@@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn
index c093596dba09..5642c52d9f6b 100644
index 200b8daecfbe..2e9d3b35325a 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -32,6 +32,7 @@ import("//build/config/sysroot.gni")
@@ -9,8 +9,8 @@ index c093596dba09..5642c52d9f6b 100644
+import("//cef/libcef/features/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -1602,7 +1603,11 @@ jumbo_component("base") {
import("//third_party/icu/config.gni")
@@ -1612,7 +1613,11 @@ jumbo_component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]

View File

@@ -1,5 +1,5 @@
diff --git base/values.cc base/values.cc
index 02e92b7e082b..b227923a6220 100644
index 6886b846e8d5..2bc969fb173a 100644
--- base/values.cc
+++ base/values.cc
@@ -23,20 +23,6 @@

View File

@@ -0,0 +1,21 @@
diff --git third_party/blink/renderer/core/layout/layout_inline.cc third_party/blink/renderer/core/layout/layout_inline.cc
index d3459a9c7e7a..00137ffdafb4 100644
--- third_party/blink/renderer/core/layout/layout_inline.cc
+++ third_party/blink/renderer/core/layout/layout_inline.cc
@@ -1070,9 +1070,14 @@ bool LayoutInline::HitTestCulledInline(
*ContainingNGBlockFlow()->PaintFragment()));
DCHECK(container_fragment->PhysicalFragment().IsInline() ||
container_fragment->PhysicalFragment().IsLineBox());
- NGInlineCursor cursor(*container_fragment);
- for (cursor.MoveTo(*this); cursor; cursor.MoveToNextForSameLayoutObject())
+ NGInlineCursor cursor;
+ cursor.MoveTo(*this);
+ for (; cursor; cursor.MoveToNextForSameLayoutObject()) {
+ if (!cursor.CurrentPaintFragment()->IsDescendantOfNotSelf(
+ *container_fragment))
+ continue;
yield(cursor.CurrentRect());
+ }
} else {
DCHECK(!ContainingNGBlockFlow());
CollectCulledLineBoxRects(yield);

View File

@@ -37,10 +37,10 @@ index 6eb21be63dec..87ccc46f4d43 100644
attached_ = true;
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
index be1334c46132..60abcebf7422 100644
index 7bb71f92bb0a..a6b89a831044 100644
--- content/browser/frame_host/interstitial_page_impl.cc
+++ content/browser/frame_host/interstitial_page_impl.cc
@@ -622,7 +622,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
@@ -619,7 +619,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
WebContentsView* wcv =
static_cast<WebContentsImpl*>(web_contents())->GetView();
RenderWidgetHostViewBase* view =
@@ -50,7 +50,7 @@ index be1334c46132..60abcebf7422 100644
render_view_host_->GetMainFrame()->AllowBindings(
BINDINGS_POLICY_DOM_AUTOMATION);
diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h
index bfb918a2cba3..a193b5a0fed8 100644
index bff5b42b166c..4e21a23e364b 100644
--- content/browser/web_contents/web_contents_view.h
+++ content/browser/web_contents/web_contents_view.h
@@ -23,7 +23,7 @@ struct DropData;
@@ -62,7 +62,7 @@ index bfb918a2cba3..a193b5a0fed8 100644
public:
virtual ~WebContentsView() {}
@@ -84,13 +84,9 @@ class WebContentsView {
@@ -83,13 +83,9 @@ class WebContentsView {
// Sets up the View that holds the rendered web page, receives messages for
// it and contains page plugins. The host view should be sized to the current
// size of the WebContents.
@@ -79,10 +79,10 @@ index bfb918a2cba3..a193b5a0fed8 100644
// Creates a new View that holds a non-top-level widget and receives messages
// for it.
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
index 15e5f49d6f48..5a33c34fb3c3 100644
index fbefaf207527..093c9cfa2bd1 100644
--- content/browser/web_contents/web_contents_view_aura.cc
+++ content/browser/web_contents/web_contents_view_aura.cc
@@ -952,7 +952,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
@@ -966,7 +966,8 @@ void WebContentsViewAura::CreateView(gfx::NativeView context) {
}
RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@@ -92,7 +92,7 @@ index 15e5f49d6f48..5a33c34fb3c3 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -964,6 +965,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@@ -978,6 +979,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
render_widget_host->GetView());
}
@@ -101,11 +101,11 @@ index 15e5f49d6f48..5a33c34fb3c3 100644
g_create_render_widget_host_view
? g_create_render_widget_host_view(render_widget_host,
diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
index 428c5afe4cd9..46e4a2b43d81 100644
index 180f4fa00e46..05ec3dec8331 100644
--- content/browser/web_contents/web_contents_view_aura.h
+++ content/browser/web_contents/web_contents_view_aura.h
@@ -123,7 +123,7 @@ class CONTENT_EXPORT WebContentsViewAura
gfx::NativeView context) override;
@@ -148,7 +148,7 @@ class CONTENT_EXPORT WebContentsViewAura
void CreateView(gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
- bool is_guest_view_hack) override;
@@ -114,10 +114,10 @@ index 428c5afe4cd9..46e4a2b43d81 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_child_frame.cc content/browser/web_contents/web_contents_view_child_frame.cc
index 1a68298648a2..a54af8a7f735 100644
index a766385cf589..fa6832be0759 100644
--- content/browser/web_contents/web_contents_view_child_frame.cc
+++ content/browser/web_contents/web_contents_view_child_frame.cc
@@ -84,7 +84,7 @@ void WebContentsViewChildFrame::CreateView(const gfx::Size& initial_size,
@@ -83,7 +83,7 @@ void WebContentsViewChildFrame::CreateView(gfx::NativeView context) {
RenderWidgetHostViewBase* WebContentsViewChildFrame::CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@@ -127,11 +127,11 @@ index 1a68298648a2..a54af8a7f735 100644
}
diff --git content/browser/web_contents/web_contents_view_child_frame.h content/browser/web_contents/web_contents_view_child_frame.h
index 8aaa80183dd1..b9df8a87be07 100644
index 412bb35e4b69..2f5f7ac02b20 100644
--- content/browser/web_contents/web_contents_view_child_frame.h
+++ content/browser/web_contents/web_contents_view_child_frame.h
@@ -40,7 +40,7 @@ class WebContentsViewChildFrame : public WebContentsView,
gfx::NativeView context) override;
@@ -39,7 +39,7 @@ class WebContentsViewChildFrame : public WebContentsView,
void CreateView(gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
- bool is_guest_view_hack) override;
@@ -140,7 +140,7 @@ index 8aaa80183dd1..b9df8a87be07 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_guest.cc content/browser/web_contents/web_contents_view_guest.cc
index ecaf30bcb7b9..7c65a61fe158 100644
index c45581fd22b7..f9507a4e7db5 100644
--- content/browser/web_contents/web_contents_view_guest.cc
+++ content/browser/web_contents/web_contents_view_guest.cc
@@ -68,6 +68,8 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
@@ -161,7 +161,7 @@ index ecaf30bcb7b9..7c65a61fe158 100644
#if defined(USE_AURA)
old_parent_view->GetNativeView()->RemoveChild(
platform_view_->GetNativeView());
@@ -120,7 +124,8 @@ void WebContentsViewGuest::CreateView(const gfx::Size& initial_size,
@@ -118,7 +122,8 @@ void WebContentsViewGuest::CreateView(gfx::NativeView context) {
}
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
@@ -171,7 +171,7 @@ index ecaf30bcb7b9..7c65a61fe158 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -132,11 +137,19 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
@@ -130,11 +135,19 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
render_widget_host->GetView());
}
@@ -195,11 +195,11 @@ index ecaf30bcb7b9..7c65a61fe158 100644
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForChildWidget(
diff --git content/browser/web_contents/web_contents_view_guest.h content/browser/web_contents/web_contents_view_guest.h
index 913fbc4bb00e..731a81c72803 100644
index 12aa7cd4799d..bcd4e242c2f7 100644
--- content/browser/web_contents/web_contents_view_guest.h
+++ content/browser/web_contents/web_contents_view_guest.h
@@ -58,7 +58,7 @@ class WebContentsViewGuest : public WebContentsView,
gfx::NativeView context) override;
@@ -57,7 +57,7 @@ class WebContentsViewGuest : public WebContentsView,
void CreateView(gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
- bool is_guest_view_hack) override;
@@ -208,11 +208,11 @@ index 913fbc4bb00e..731a81c72803 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h
index 35da7e53b6a6..df938f455be2 100644
index 6fdec8c0a5e2..f57dc03069a5 100644
--- content/browser/web_contents/web_contents_view_mac.h
+++ content/browser/web_contents/web_contents_view_mac.h
@@ -77,7 +77,7 @@ class WebContentsViewMac : public WebContentsView,
gfx::NativeView context) override;
@@ -76,7 +76,7 @@ class WebContentsViewMac : public WebContentsView,
void CreateView(gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
- bool is_guest_view_hack) override;
@@ -221,10 +221,10 @@ index 35da7e53b6a6..df938f455be2 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
index b35b9b48b53c..bfa5f5409d5d 100644
index 4721a9b3f511..dfdd46d0c5d2 100644
--- content/browser/web_contents/web_contents_view_mac.mm
+++ content/browser/web_contents/web_contents_view_mac.mm
@@ -327,7 +327,8 @@ void WebContentsViewMac::CreateView(
@@ -326,7 +326,8 @@ void WebContentsViewMac::CreateView(gfx::NativeView context) {
}
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@@ -234,7 +234,7 @@ index b35b9b48b53c..bfa5f5409d5d 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -339,6 +340,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@@ -338,6 +339,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
render_widget_host->GetView());
}
@@ -266,10 +266,10 @@ index ea12af6b86b8..f1211f374328 100644
// a BrowserPlugin even when we are using cross process frames for guests. It
// should be removed after resolving https://crbug.com/642826).
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 1578ad4f86bd..a07ed1044d60 100644
index fa13ab856de9..ddc70aedbab2 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
@@ -212,6 +212,8 @@ void MimeHandlerViewGuest::CreateWebContents(
@@ -215,6 +215,8 @@ void MimeHandlerViewGuest::CreateWebContents(
WebContents::CreateParams params(browser_context(),
guest_site_instance.get());
params.guest_delegate = this;
@@ -278,7 +278,7 @@ index 1578ad4f86bd..a07ed1044d60 100644
// TODO(erikchen): Fix ownership semantics for guest views.
// https://crbug.com/832879.
std::move(callback).Run(
@@ -256,6 +258,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const {
@@ -259,6 +261,18 @@ bool MimeHandlerViewGuest::ShouldDestroyOnDetach() const {
return true;
}
@@ -298,10 +298,10 @@ index 1578ad4f86bd..a07ed1044d60 100644
WebContents* source,
const content::OpenURLParams& params) {
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
index a608b0f31be0..025e4ed3af85 100644
index 3d0b70d06fe7..a33da99391f6 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
+++ extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
@@ -125,6 +125,10 @@ class MimeHandlerViewGuest
@@ -128,6 +128,10 @@ class MimeHandlerViewGuest
bool ZoomPropagatesFromEmbedderToGuest() const final;
bool ShouldDestroyOnDetach() const final;

View File

@@ -1,18 +1,13 @@
diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc
index f2ddb987a4de..a309caf4c670 100644
index 4f786a1c21c7..2bbd7b0caf19 100644
--- content/browser/scheduler/browser_task_executor.cc
+++ content/browser/scheduler/browser_task_executor.cc
@@ -136,10 +136,11 @@ void BrowserTaskExecutor::PostFeatureListSetup() {
@@ -249,7 +249,7 @@ void BrowserTaskExecutor::PostFeatureListSetup() {
// static
void BrowserTaskExecutor::Shutdown() {
- if (!g_browser_task_executor)
+ if (!g_browser_task_executor ||
+ !g_browser_task_executor->browser_ui_thread_scheduler_) {
+ if (!g_browser_task_executor || !g_browser_task_executor->ui_thread_executor_)
return;
+ }
- DCHECK(g_browser_task_executor->browser_ui_thread_scheduler_);
// We don't delete |g_browser_task_executor| because other threads may
// PostTask or call BrowserTaskExecutor::GetTaskRunner while we're tearing
// things down. We don't want to add locks so we just leak instead of dealing
DCHECK(g_browser_task_executor->ui_thread_executor_);

View File

@@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 352cb646dd51..44bc70c9d876 100644
index 93ad68a613b3..19b82a3a6389 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -152,7 +152,7 @@ declare_args() {
@@ -167,7 +167,7 @@ declare_args() {
!use_clang_coverage && !(is_android && use_order_profiling) &&
(use_lld ||
(use_gold &&
@@ -11,7 +11,7 @@ index 352cb646dd51..44bc70c9d876 100644
!(current_cpu == "x86" || current_cpu == "x64"))))
}
@@ -1724,8 +1724,6 @@ config("thin_archive") {
@@ -1740,8 +1740,6 @@ config("thin_archive") {
# archive names to 16 characters, which is not what we want).
if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) {
arflags = [ "-T" ]

View File

@@ -0,0 +1,22 @@
diff --git chrome/browser/ui/views/confirm_bubble_views.cc chrome/browser/ui/views/confirm_bubble_views.cc
index 5f25a23aff9d..994b493b556f 100644
--- chrome/browser/ui/views/confirm_bubble_views.cc
+++ chrome/browser/ui/views/confirm_bubble_views.cc
@@ -27,7 +27,7 @@
namespace {
-std::unique_ptr<views::View> CreateExtraView(views::ButtonListener* listener) {
+std::unique_ptr<views::View> CreateExtraView2(views::ButtonListener* listener) {
auto help_button = CreateVectorImageButton(listener);
help_button->SetFocusForPlatform();
help_button->SetTooltipText(l10n_util::GetStringUTF16(IDS_LEARN_MORE));
@@ -46,7 +46,7 @@ ConfirmBubbleViews::ConfirmBubbleViews(
DialogDelegate::set_button_label(
ui::DIALOG_BUTTON_CANCEL,
model_->GetButtonLabel(ConfirmBubbleModel::BUTTON_CANCEL));
- help_button_ = DialogDelegate::SetExtraView(::CreateExtraView(this));
+ help_button_ = DialogDelegate::SetExtraView(::CreateExtraView2(this));
set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType(
views::TEXT, views::TEXT));

View File

@@ -1,16 +1,16 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index d730660c086f..2cdc16923c2d 100644
index d3c018287325..07c26487986a 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -10,6 +10,7 @@ import("//build/config/jumbo.gni")
@@ -9,6 +9,7 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
+import("//cef/libcef/features/features.gni")
import("//chrome/common/features.gni")
import("//components/feature_engagement/features.gni")
import("//components/feed/features.gni")
@@ -1938,6 +1939,7 @@ jumbo_split_static_library("browser") {
@@ -1880,6 +1881,7 @@ jumbo_static_library("browser") {
"//base/util/values:values_util",
"//build:branding_buildflags",
"//cc",
@@ -18,7 +18,7 @@ index d730660c086f..2cdc16923c2d 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2238,6 +2240,10 @@ jumbo_split_static_library("browser") {
@@ -2182,6 +2184,10 @@ jumbo_static_library("browser") {
]
}

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index a3797e6705b8..6b7fe2e20a3f 100644
index ac6b3488a4d8..82edf3f9eeec 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -7,6 +7,7 @@
@@ -21,7 +21,7 @@ index a3797e6705b8..6b7fe2e20a3f 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_system.h"
@@ -44,8 +49,14 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
@@ -45,8 +50,14 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
DependsOn(SupervisedUserSettingsServiceFactory::GetInstance());
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -36,7 +36,7 @@ index a3797e6705b8..6b7fe2e20a3f 100644
#endif
}
@@ -85,10 +96,16 @@ scoped_refptr<RefcountedKeyedService>
@@ -86,10 +97,16 @@ scoped_refptr<RefcountedKeyedService>
base::FeatureList::IsEnabled(features::kPermissionDelegation)));
#if BUILDFLAG(ENABLE_EXTENSIONS)

View File

@@ -1,16 +1,16 @@
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 1826b714b2ee..e27010f5826d 100644
index b0ff168a4ec8..4f5fb430c9d6 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -10,6 +10,7 @@ import("//build/config/jumbo.gni")
@@ -9,6 +9,7 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
+import("//cef/libcef/features/features.gni")
import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni")
import("//components/feature_engagement/features.gni")
@@ -370,6 +371,10 @@ jumbo_split_static_library("ui") {
@@ -358,6 +359,10 @@ jumbo_static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@@ -21,16 +21,24 @@ index 1826b714b2ee..e27010f5826d 100644
# Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less
@@ -388,6 +393,7 @@ jumbo_split_static_library("ui") {
"//base:i18n",
@@ -378,6 +383,7 @@ jumbo_static_library("ui") {
"//base/allocator:buildflags",
"//build:branding_buildflags",
"//cc/paint",
+ "//cef/libcef/features",
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -1372,6 +1378,7 @@ jumbo_static_library("ui") {
"//components/keep_alive_registry",
"//components/network_session_configurator/common",
"//components/page_load_metrics/browser",
+ "//components/printing/common:mojo_interfaces",
"//components/profile_metrics",
"//components/ui_metrics",
"//components/url_formatter",
diff --git chrome/browser/ui/webui/net_export_ui.cc chrome/browser/ui/webui/net_export_ui.cc
index 081ef17bf0d9..46b1d1af2baa 100644
index 7b7cf106ad3d..b9fdb831737d 100644
--- chrome/browser/ui/webui/net_export_ui.cc
+++ chrome/browser/ui/webui/net_export_ui.cc
@@ -20,13 +20,12 @@

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 5a4b56c429e0..aedc8a45b67a 100644
index 04a864ebd3e3..4fb7f7daa41f 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -1014,10 +1014,6 @@ void LaunchURL(const GURL& url,
@@ -993,10 +993,6 @@ void LaunchURL(const GURL& url,
}
}
@@ -13,7 +13,7 @@ index 5a4b56c429e0..aedc8a45b67a 100644
void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
// |allowlist| combines pref/policy + cmdline switch in the browser process.
// For renderer and utility (e.g. NetworkService) processes the switch is the
@@ -1060,6 +1056,14 @@ base::FilePath GetModulePath(base::StringPiece16 module_name) {
@@ -1057,6 +1053,14 @@ bool IsInHostedApp(WebContents* web_contents) {
} // namespace
@@ -29,10 +29,10 @@ index 5a4b56c429e0..aedc8a45b67a 100644
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kUserAgent)) {
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index 6bb50192ce17..6cb6a28d3114 100644
index b80edc76b14f..20ba68634bbc 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -85,7 +85,8 @@ enum class Channel;
@@ -86,7 +86,8 @@ enum class Channel;
class ChromeHidDelegate;
class ChromeSerialDelegate;

View File

@@ -1,5 +1,5 @@
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 5fb5b84258a8..e28db2e984f6 100644
index 4e44716a40f3..1eb4731da1cf 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -359,7 +359,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@@ -12,7 +12,7 @@ index 5fb5b84258a8..e28db2e984f6 100644
}
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 87ecf1fc998b..924c24fa42a2 100644
index 7d02af7f8f60..eb70e533dbfb 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -99,7 +99,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -43,7 +43,7 @@ index 87ecf1fc998b..924c24fa42a2 100644
// Get the path of the last used profile, or if that's undefined, the default
// profile.
diff --git chrome/browser/profiles/renderer_updater.cc chrome/browser/profiles/renderer_updater.cc
index 9dd42523f970..b8f5ae89ae3d 100644
index 07e6f8d726df..9a3c6b38b8eb 100644
--- chrome/browser/profiles/renderer_updater.cc
+++ chrome/browser/profiles/renderer_updater.cc
@@ -7,6 +7,7 @@
@@ -54,7 +54,7 @@ index 9dd42523f970..b8f5ae89ae3d 100644
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
@@ -60,8 +61,12 @@ void GetGuestViewDefaultContentSettingRules(
@@ -67,8 +68,12 @@ void GetGuestViewDefaultContentSettingRules(
RendererUpdater::RendererUpdater(Profile* profile)
: profile_(profile), identity_manager_observer_(this) {
@@ -67,7 +67,7 @@ index 9dd42523f970..b8f5ae89ae3d 100644
#if defined(OS_CHROMEOS)
oauth2_login_manager_ =
chromeos::OAuth2LoginManagerFactory::GetForProfile(profile_);
@@ -228,7 +233,7 @@ void RendererUpdater::UpdateRenderer(
@@ -238,7 +243,7 @@ void RendererUpdater::UpdateRenderer(
force_google_safesearch_.GetValue(),
force_youtube_restrict_.GetValue(),
allowed_domains_for_apps_.GetValue(),

View File

@@ -1,8 +1,8 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index 3599895eb5c5..971ae4d3c1b6 100644
index 8d5bdf428063..0aff2229bfa8 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -229,6 +229,7 @@ jumbo_static_library("safe_browsing") {
@@ -233,6 +233,7 @@ jumbo_static_library("safe_browsing") {
"//chrome/common/safe_browsing:download_type_util",
"//chrome/services/file_util/public/cpp",
"//components/content_settings/core/browser",

View File

@@ -0,0 +1,37 @@
diff --git chrome/browser/themes/theme_service_factory.cc chrome/browser/themes/theme_service_factory.cc
index 3f065778092c..3661a9ece2a6 100644
--- chrome/browser/themes/theme_service_factory.cc
+++ chrome/browser/themes/theme_service_factory.cc
@@ -6,6 +6,7 @@
#include "base/logging.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/extensions/extension_system_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
@@ -25,6 +26,10 @@
#include "ui/views/linux_ui/linux_ui.h"
#endif
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
+#endif
+
// static
ThemeService* ThemeServiceFactory::GetForProfile(Profile* profile) {
return static_cast<ThemeService*>(
@@ -54,7 +59,13 @@ ThemeServiceFactory::ThemeServiceFactory()
BrowserContextDependencyManager::GetInstance()) {
DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
DependsOn(extensions::ExtensionPrefsFactory::GetInstance());
+#if BUILDFLAG(ENABLE_CEF)
+ if (extensions::ExtensionsEnabled()) {
+#endif
DependsOn(extensions::ExtensionSystemFactory::GetInstance());
+#if BUILDFLAG(ENABLE_CEF)
+ }
+#endif
}
ThemeServiceFactory::~ThemeServiceFactory() {}

View File

@@ -165,10 +165,10 @@ index 56f147d2fc56..9f5687d9a5b9 100644
Profile* profile = Profile::FromBrowserContext(browser_context);
std::vector<std::string> whitelist = MimeTypesHandler::GetMIMETypeWhitelist();
diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc
index 3ce38cb1ee3a..44e93a0b5035 100644
index 0a565575f36c..06dfa59d1a75 100644
--- chrome/common/google_url_loader_throttle.cc
+++ chrome/common/google_url_loader_throttle.cc
@@ -4,10 +4,15 @@
@@ -4,11 +4,16 @@
#include "chrome/common/google_url_loader_throttle.h"
@@ -176,6 +176,7 @@ index 3ce38cb1ee3a..44e93a0b5035 100644
#include "chrome/common/net/safe_search_util.h"
#include "components/variations/net/variations_http_headers.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
@@ -184,7 +185,7 @@ index 3ce38cb1ee3a..44e93a0b5035 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/extension_urls.h"
#endif
@@ -96,6 +101,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse(
@@ -98,6 +103,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse(
const GURL& response_url,
network::ResourceResponseHead* response_head,
bool* defer) {
@@ -197,10 +198,10 @@ index 3ce38cb1ee3a..44e93a0b5035 100644
GURL webstore_url(extension_urls::GetWebstoreLaunchURL());
if (response_url.SchemeIsHTTPOrHTTPS() &&
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 6ad2480f3e26..eff7211f63e4 100644
index 0948ebbbd199..41065dffa3b3 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -796,6 +796,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -794,6 +794,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@@ -208,9 +209,9 @@ index 6ad2480f3e26..eff7211f63e4 100644
observer->IsPluginTemporarilyAllowed(identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
}
@@ -996,7 +997,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -994,7 +995,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
&plugin_auth_host);
plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
- observer->DidBlockContentType(content_type, group_name);
+ if (observer)
@@ -218,7 +219,7 @@ index 6ad2480f3e26..eff7211f63e4 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -1005,7 +1007,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1003,7 +1005,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@@ -228,7 +229,7 @@ index 6ad2480f3e26..eff7211f63e4 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1015,7 +1018,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1013,7 +1016,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
@@ -238,7 +239,7 @@ index 6ad2480f3e26..eff7211f63e4 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -1023,7 +1027,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1021,7 +1025,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name));
@@ -249,10 +250,10 @@ index 6ad2480f3e26..eff7211f63e4 100644
}
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
index fe074e5b99ac..5d19f37db3d0 100644
index 205c7398f827..8fcb6e5ae7ad 100644
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -357,8 +357,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
@@ -358,8 +358,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
if (status ==
content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) {

View File

@@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index a008c196d020..bf91ed98b864 100644
index d3c40c67d587..db2160f68eb7 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -4,6 +4,7 @@
@@ -10,7 +10,7 @@ index a008c196d020..bf91ed98b864 100644
import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
@@ -118,6 +119,7 @@ jumbo_static_library("renderer") {
@@ -127,6 +128,7 @@ jumbo_static_library("renderer") {
defines = []
deps = [
@@ -18,7 +18,7 @@ index a008c196d020..bf91ed98b864 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -185,6 +187,10 @@ jumbo_static_library("renderer") {
@@ -195,6 +197,10 @@ jumbo_static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

Some files were not shown because too many files have changed in this diff Show More