Update to Chromium revision bc084a8b (#530369)

This commit is contained in:
Marshall Greenblatt
2018-02-14 19:12:09 -05:00
parent ac86b61139
commit 9e644b7538
113 changed files with 1930 additions and 1797 deletions

View File

@ -13,14 +13,14 @@
# Optionally configure GN by setting the `GN_DEFINES` and/or `GN_ARGUMENTS` # Optionally configure GN by setting the `GN_DEFINES` and/or `GN_ARGUMENTS`
# environment variables. # environment variables.
# #
# Example A: Use /DEBUG:FASTLINK on Windows: # Example A: Create an official build on Windows:
# #
# > set GN_DEFINES=is_win_fastlink=true # > set GN_DEFINES=is_official_build=true
# #
# Example B: Generate VS2015 project files in addition to the default Ninja # Example B: Generate VS2017 project files in addition to the default Ninja
# build files on Windows: # build files on Windows:
# #
# > set GN_ARGUMENTS=--ide=vs2015 --sln=cef --filters=//cef/* # > set GN_ARGUMENTS=--ide=vs2017 --sln=cef --filters=//cef/*
# #
# After completing the "GN Automated Build" or "GN Manual Build" section # After completing the "GN Automated Build" or "GN Manual Build" section
# open "out\<build_dir>\cef.sln" for editing and debugging. Building must # open "out\<build_dir>\cef.sln" for editing and debugging. Building must
@ -111,6 +111,7 @@ import("//third_party/icu/config.gni")
import("//third_party/widevine/cdm/widevine.gni") import("//third_party/widevine/cdm/widevine.gni")
import("//tools/grit/repack.gni") import("//tools/grit/repack.gni")
import("//tools/grit/grit_rule.gni") import("//tools/grit/grit_rule.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//v8/gni/v8.gni") import("//v8/gni/v8.gni")
if (is_clang) { if (is_clang) {
import("//build/config/clang/clang.gni") import("//build/config/clang/clang.gni")
@ -263,7 +264,6 @@ if (is_win) {
deps = [ deps = [
"//components/crash/core/common", # crash_keys "//components/crash/core/common", # crash_keys
"//gpu/config:crash_keys",
# Required by chrome_switches.cc # Required by chrome_switches.cc
"//chrome/common:features", "//chrome/common:features",
@ -647,6 +647,7 @@ static_library("libcef_static") {
"//chrome/child", "//chrome/child",
"//chrome/common", "//chrome/common",
"//chrome/renderer", "//chrome/renderer",
"//chrome/services/printing:lib",
"//chrome/utility", "//chrome/utility",
"//components/cdm/renderer", "//components/cdm/renderer",
"//components/content_settings/core/browser", "//components/content_settings/core/browser",
@ -684,7 +685,6 @@ static_library("libcef_static") {
"//content/public/child", "//content/public/child",
"//content/public/common", "//content/public/common",
"//content/public/gpu", "//content/public/gpu",
"//content/public/network",
"//content/public/renderer", "//content/public/renderer",
"//content/public/utility", "//content/public/utility",
"//crypto", "//crypto",
@ -706,6 +706,8 @@ static_library("libcef_static") {
"//pdf", "//pdf",
"//ppapi/features", "//ppapi/features",
"//printing/features", "//printing/features",
"//services/network:network_service",
"//services/network/public/cpp",
"//services/service_manager/embedder", "//services/service_manager/embedder",
"//services/service_manager/public/interfaces", "//services/service_manager/public/interfaces",
"//services/service_manager/runner/common", "//services/service_manager/runner/common",
@ -721,7 +723,6 @@ static_library("libcef_static") {
"//third_party/widevine/cdm:widevinecdmadapter", "//third_party/widevine/cdm:widevinecdmadapter",
"//third_party/icu", "//third_party/icu",
"//third_party/zlib:minizip", "//third_party/zlib:minizip",
"//tools/v8_context_snapshot:v8_context_snapshot",
"//ui/base", "//ui/base",
"//ui/base/ime", "//ui/base/ime",
"//ui/events:events_base", "//ui/events:events_base",
@ -754,8 +755,6 @@ static_library("libcef_static") {
"libcef/browser/osr/browser_platform_delegate_osr_win.cc", "libcef/browser/osr/browser_platform_delegate_osr_win.cc",
"libcef/browser/osr/browser_platform_delegate_osr_win.h", "libcef/browser/osr/browser_platform_delegate_osr_win.h",
"libcef/browser/osr/render_widget_host_view_osr_win.cc", "libcef/browser/osr/render_widget_host_view_osr_win.cc",
"libcef/common/crash_reporting_win.cc",
"libcef/common/crash_reporting_win.h",
# Part of //chrome/utility. # Part of //chrome/utility.
"//chrome/utility/printing_handler.cc", "//chrome/utility/printing_handler.cc",
@ -824,12 +823,21 @@ static_library("libcef_static") {
} }
if (is_posix && !is_mac) { if (is_posix && !is_mac) {
sources += [
"libcef/common/cef_crash_report_utils.cc",
"libcef/common/cef_crash_report_utils.h",
]
deps += [ deps += [
"//components/crash/content/app", "//components/crash/content/app",
"//components/crash/content/browser", "//components/crash/content/browser",
] ]
} }
if (v8_use_external_startup_data && use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot" ]
}
if (use_aura) { if (use_aura) {
sources += [ sources += [
"libcef/browser/native/window_delegate_view.cc", "libcef/browser/native/window_delegate_view.cc",
@ -904,6 +912,7 @@ static_library("libcef_static") {
] ]
deps += [ deps += [
"//services/ui",
"//ui/aura", "//ui/aura",
"//ui/events", "//ui/events",
"//ui/strings", "//ui/strings",
@ -1014,6 +1023,7 @@ if (is_win) {
cef_packaged_services = [ cef_packaged_services = [
"//chrome/app:chrome_manifest", # For spell checking. "//chrome/app:chrome_manifest", # For spell checking.
"//chrome/services/printing:manifest",
"//services/metrics:manifest", "//services/metrics:manifest",
"//services/proxy_resolver:proxy_resolver_manifest", "//services/proxy_resolver:proxy_resolver_manifest",
] ]
@ -1339,7 +1349,6 @@ if (is_mac) {
"$root_out_dir/cef_200_percent.pak", "$root_out_dir/cef_200_percent.pak",
"$root_out_dir/cef_extensions.pak", "$root_out_dir/cef_extensions.pak",
"$root_out_dir/devtools_resources.pak", "$root_out_dir/devtools_resources.pak",
"$root_out_dir/v8_context_snapshot.bin",
"$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin", "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin",
] ]
@ -1350,7 +1359,6 @@ if (is_mac) {
":pak_devtools", ":pak_devtools",
":pak_extensions", ":pak_extensions",
"//third_party/widevine/cdm:widevinecdmadapter", "//third_party/widevine/cdm:widevinecdmadapter",
"//tools/v8_context_snapshot:v8_context_snapshot",
] ]
if (icu_use_data_file) { if (icu_use_data_file) {
@ -1364,6 +1372,10 @@ if (is_mac) {
"$root_out_dir/snapshot_blob.bin", "$root_out_dir/snapshot_blob.bin",
] ]
public_deps += [ "//v8" ] public_deps += [ "//v8" ]
if (use_v8_context_snapshot) {
sources += [ "$root_out_dir/v8_context_snapshot.bin" ]
public_deps += [ "//tools/v8_context_snapshot" ]
}
} }
outputs = [ outputs = [

View File

@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding # https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{ {
'chromium_checkout': '5fdc0fab22ce7efd32532ee989b223fa12f8171e', 'chromium_checkout': 'bc084a8b5afa3744a74927344e304c02ae54189f',
} }

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for // by hand. See the translator.README.txt file in the tools directory for
// more information. // more information.
// //
// $hash=0a8f009404aedce3f63f83864f754df60c36b293$ // $hash=e4da4fab11e33d34d70714be22e6f72579586ffe$
// //
#ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_ #ifndef CEF_INCLUDE_CAPI_CEF_CRASH_UTIL_CAPI_H_
@ -129,14 +129,12 @@ extern "C" {
// //
// CrashKeys section: // CrashKeys section:
// //
// Any number of crash keys can be specified for use by the application. Crash // A maximum of 26 crash keys of each size can be specified for use by the
// key values will be truncated based on the specified size (small = 63 bytes, // application. Crash key values will be truncated based on the specified size
// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set // (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
// from any thread or process using the CefSetCrashKeyValue function. These // crash keys can be set from any thread or process using the
// key/value pairs will be sent to the crash server along with the crash dump // CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
// file. Medium and large values will be chunked for submission. For example, if // server along with the crash dump file.
// your key is named "mykey" then the value will be broken into ordered chunks
// and submitted using keys named "mykey-1", "mykey-2", etc.
/// ///
CEF_EXPORT int cef_crash_reporting_enabled(); CEF_EXPORT int cef_crash_reporting_enabled();

View File

@ -121,14 +121,12 @@
// //
// CrashKeys section: // CrashKeys section:
// //
// Any number of crash keys can be specified for use by the application. Crash // A maximum of 26 crash keys of each size can be specified for use by the
// key values will be truncated based on the specified size (small = 63 bytes, // application. Crash key values will be truncated based on the specified size
// medium = 252 bytes, large = 1008 bytes). The value of crash keys can be set // (small = 64 bytes, medium = 256 bytes, large = 1024 bytes). The value of
// from any thread or process using the CefSetCrashKeyValue function. These // crash keys can be set from any thread or process using the
// key/value pairs will be sent to the crash server along with the crash dump // CefSetCrashKeyValue function. These key/value pairs will be sent to the crash
// file. Medium and large values will be chunked for submission. For example, // server along with the crash dump file.
// if your key is named "mykey" then the value will be broken into ordered
// chunks and submitted using keys named "mykey-1", "mykey-2", etc.
/// ///
/*--cef()--*/ /*--cef()--*/
bool CefCrashReportingEnabled(); bool CefCrashReportingEnabled();

View File

@ -26,11 +26,11 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "chrome/browser/font_family_cache.h" #include "chrome/browser/font_family_cache.h"
#include "chrome/browser/net/proxy_service_factory.h"
#include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h" #include "chrome/browser/ui/zoom/chrome_zoom_level_prefs.h"
#include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/guest_view/browser/guest_view_manager.h" #include "components/guest_view/browser/guest_view_manager.h"
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/visitedlink/browser/visitedlink_event_listener.h" #include "components/visitedlink/browser/visitedlink_event_listener.h"
#include "components/visitedlink/browser/visitedlink_master.h" #include "components/visitedlink/browser/visitedlink_master.h"
#include "components/zoom/zoom_event_manager.h" #include "components/zoom/zoom_event_manager.h"
@ -40,6 +40,7 @@
#include "extensions/browser/extension_protocols.h" #include "extensions/browser/extension_protocols.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "net/proxy/proxy_config_service.h" #include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_service.h"
using content::BrowserThread; using content::BrowserThread;
@ -282,9 +283,8 @@ void CefBrowserContextImpl::Initialize() {
visitedlink_master_->Init(); visitedlink_master_->Init();
// Initialize proxy configuration tracker. // Initialize proxy configuration tracker.
pref_proxy_config_tracker_.reset( pref_proxy_config_tracker_.reset(new PrefProxyConfigTrackerImpl(
ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( GetPrefs(), BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)));
GetPrefs()));
CefBrowserContext::PostInitialize(); CefBrowserContext::PostInitialize();
@ -443,10 +443,17 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
DCHECK(!url_request_getter_.get()); DCHECK(!url_request_getter_.get());
auto io_thread_runner =
content::BrowserThread::GetTaskRunnerForThread(BrowserThread::IO);
// Initialize the proxy configuration service. // Initialize the proxy configuration service.
// TODO(cef): Determine if we can use the Chrome/Mojo implementation from
// https://crrev.com/d0d0d050
std::unique_ptr<net::ProxyConfigService> base_service(
net::ProxyService::CreateSystemProxyConfigService(io_thread_runner));
std::unique_ptr<net::ProxyConfigService> proxy_config_service( std::unique_ptr<net::ProxyConfigService> proxy_config_service(
ProxyServiceFactory::CreateProxyConfigService( pref_proxy_config_tracker_->CreateTrackingProxyConfigService(
pref_proxy_config_tracker_.get())); std::move(base_service)));
if (extensions::ExtensionsEnabled()) { if (extensions::ExtensionsEnabled()) {
// Handle only chrome-extension:// requests. CEF does not support // Handle only chrome-extension:// requests. CEF does not support
@ -461,10 +468,8 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
} }
url_request_getter_ = new CefURLRequestContextGetterImpl( url_request_getter_ = new CefURLRequestContextGetterImpl(
settings_, GetPrefs(), settings_, GetPrefs(), io_thread_runner, protocol_handlers,
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO), std::move(proxy_config_service), std::move(request_interceptors));
protocol_handlers, std::move(proxy_config_service),
std::move(request_interceptors));
resource_context()->set_url_request_context_getter(url_request_getter_.get()); resource_context()->set_url_request_context_getter(url_request_getter_.get());
return url_request_getter_.get(); return url_request_getter_.get();
} }

View File

@ -1589,9 +1589,11 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetFrameForRequest(
content::ResourceRequestInfo::ForRequest(request); content::ResourceRequestInfo::ForRequest(request);
if (!info) if (!info)
return nullptr; return nullptr;
// The value of |IsMainFrame| is unreliable when |IsDownload| returns true.
return GetOrCreateFrame(info->GetRenderFrameID(), info->GetFrameTreeNodeId(), return GetOrCreateFrame(info->GetRenderFrameID(), info->GetFrameTreeNodeId(),
CefFrameHostImpl::kUnspecifiedFrameId, CefFrameHostImpl::kUnspecifiedFrameId,
info->IsMainFrame(), base::string16(), GURL()); info->IsMainFrame(), info->IsDownload(),
base::string16(), GURL());
} }
void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) { void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) {
@ -2744,7 +2746,7 @@ void CefBrowserHostImpl::DidFinishNavigation(
CefRefPtr<CefFrame> frame = CefRefPtr<CefFrame> frame =
GetOrCreateFrame(frame_id, navigation_handle->GetFrameTreeNodeId(), GetOrCreateFrame(frame_id, navigation_handle->GetFrameTreeNodeId(),
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame,
base::string16(), url); false, base::string16(), url);
if (error_code == net::OK) { if (error_code == net::OK) {
// The navigation has been committed and there is no error. // The navigation has been committed and there is no error.
@ -2792,7 +2794,7 @@ void CefBrowserHostImpl::DidFailLoad(
GetOrCreateFrame(render_frame_host->GetRoutingID(), GetOrCreateFrame(render_frame_host->GetRoutingID(),
render_frame_host->GetFrameTreeNodeId(), render_frame_host->GetFrameTreeNodeId(),
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame,
base::string16(), validated_url); false, base::string16(), validated_url);
OnLoadError(frame, validated_url, error_code); OnLoadError(frame, validated_url, error_code);
OnLoadEnd(frame, validated_url, error_code); OnLoadEnd(frame, validated_url, error_code);
} }
@ -2918,7 +2920,7 @@ void CefBrowserHostImpl::OnFrameIdentified(int64 frame_id,
base::string16 name) { base::string16 name) {
bool is_main_frame = (parent_frame_id == CefFrameHostImpl::kMainFrameId); bool is_main_frame = (parent_frame_id == CefFrameHostImpl::kMainFrameId);
GetOrCreateFrame(frame_id, kUnspecifiedFrameTreeNodeId, parent_frame_id, GetOrCreateFrame(frame_id, kUnspecifiedFrameTreeNodeId, parent_frame_id,
is_main_frame, name, GURL()); is_main_frame, false, name, GURL());
} }
void CefBrowserHostImpl::OnFrameFocused( void CefBrowserHostImpl::OnFrameFocused(
@ -2960,7 +2962,7 @@ void CefBrowserHostImpl::OnDidFinishLoad(int64 frame_id,
CefRefPtr<CefFrame> frame = CefRefPtr<CefFrame> frame =
GetOrCreateFrame(frame_id, kUnspecifiedFrameTreeNodeId, GetOrCreateFrame(frame_id, kUnspecifiedFrameTreeNodeId,
CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame, CefFrameHostImpl::kUnspecifiedFrameId, is_main_frame,
base::string16(), validated_url); false, base::string16(), validated_url);
// Give internal scheme handlers an opportunity to update content. // Give internal scheme handlers an opportunity to update content.
scheme::DidFinishLoad(frame, validated_url); scheme::DidFinishLoad(frame, validated_url);
@ -3209,6 +3211,7 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
int frame_tree_node_id, int frame_tree_node_id,
int64 parent_frame_id, int64 parent_frame_id,
bool is_main_frame, bool is_main_frame,
bool is_download,
base::string16 frame_name, base::string16 frame_name,
const GURL& frame_url) { const GURL& frame_url) {
// We need either a valid |frame_id| or a valid |frame_tree_node_id|. // We need either a valid |frame_id| or a valid |frame_tree_node_id|.
@ -3229,12 +3232,13 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
if (frame_id < 0) { if (frame_id < 0) {
// With PlzNavigate the renderer process representation might not exist yet. // With PlzNavigate the renderer process representation might not exist yet.
if (is_main_frame && main_frame_id_ != CefFrameHostImpl::kInvalidFrameId) { if ((is_main_frame || is_download) &&
main_frame_id_ != CefFrameHostImpl::kInvalidFrameId) {
// Operating in the main frame. Continue using the existing main frame // Operating in the main frame. Continue using the existing main frame
// object until the new renderer process representation is created. // object until the new renderer process representation is created.
frame_id = main_frame_id_; frame_id = main_frame_id_;
} else { } else {
if (is_main_frame) { if (is_main_frame || is_download) {
// Always use the same pending object for the main frame. // Always use the same pending object for the main frame.
frame_tree_node_id = kMainFrameTreeNodeId; frame_tree_node_id = kMainFrameTreeNodeId;
} }
@ -3302,9 +3306,27 @@ CefRefPtr<CefFrame> CefBrowserHostImpl::GetOrCreateFrame(
} }
} }
if (!frame_created) if (!frame_created && !is_download)
frame->SetAttributes(is_main_frame, url, name, parent_frame_id); frame->SetAttributes(is_main_frame, url, name, parent_frame_id);
#if DCHECK_IS_ON()
// The main frame should always be correctly attributed.
DCHECK(main_frame_id_ == CefFrameHostImpl::kInvalidFrameId ||
main_frame_id_ >= 0)
<< main_frame_id_;
if (main_frame_id_ == CefFrameHostImpl::kInvalidFrameId) {
// With PlzNavigate the renderer process representation might not exist yet.
DCHECK(frame_id == CefFrameHostImpl::kMainFrameId ||
frame_id == CefFrameHostImpl::kUnspecifiedFrameId)
<< frame_id;
DCHECK(frame->IsMain());
} else if (main_frame_id_ == frame_id) {
DCHECK(frame->IsMain());
} else {
DCHECK(!frame->IsMain());
}
#endif
return frame.get(); return frame.get();
} }

View File

@ -585,11 +585,13 @@ class CefBrowserHostImpl : public CefBrowserHost,
// if PlzNavigate is disabled; or >= 0 otherwise. |parent_frame_id| will be // if PlzNavigate is disabled; or >= 0 otherwise. |parent_frame_id| will be
// CefFrameHostImpl::kUnspecifiedFrameId if unknown. In cases where |frame_id| // CefFrameHostImpl::kUnspecifiedFrameId if unknown. In cases where |frame_id|
// is < 0 either the existing main frame object or a pending object will be // is < 0 either the existing main frame object or a pending object will be
// returned depending on current state. // returned depending on current state. If |is_download| is true then the
// value of |is_main_frame| cannot be relied on.
CefRefPtr<CefFrame> GetOrCreateFrame(int64 frame_id, CefRefPtr<CefFrame> GetOrCreateFrame(int64 frame_id,
int frame_tree_node_id, int frame_tree_node_id,
int64 parent_frame_id, int64 parent_frame_id,
bool is_main_frame, bool is_main_frame,
bool is_download,
base::string16 frame_name, base::string16 frame_name,
const GURL& frame_url); const GURL& frame_url);

View File

@ -28,6 +28,7 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "chrome/browser/plugins/plugin_finder.h" #include "chrome/browser/plugins/plugin_finder.h"
#include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/result_codes.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "net/base/net_module.h" #include "net/base/net_module.h"
@ -66,12 +67,13 @@ void CefBrowserMainParts::PreMainMessageLoopStart() {
} }
} }
void CefBrowserMainParts::PreEarlyInitialization() { int CefBrowserMainParts::PreEarlyInitialization() {
#if defined(USE_AURA) && defined(OS_LINUX) #if defined(USE_AURA) && defined(OS_LINUX)
// TODO(linux): Consider using a real input method or // TODO(linux): Consider using a real input method or
// views::LinuxUI::SetInstance. // views::LinuxUI::SetInstance.
ui::InitializeInputMethodForTesting(); ui::InitializeInputMethodForTesting();
#endif #endif
return content::RESULT_CODE_NORMAL_EXIT;
} }
void CefBrowserMainParts::ToolkitInitialized() { void CefBrowserMainParts::ToolkitInitialized() {

View File

@ -45,7 +45,7 @@ class CefBrowserMainParts : public content::BrowserMainParts {
void PreMainMessageLoopStart() override; void PreMainMessageLoopStart() override;
void PostMainMessageLoopStart() override; void PostMainMessageLoopStart() override;
void PreEarlyInitialization() override; int PreEarlyInitialization() override;
void ToolkitInitialized() override; void ToolkitInitialized() override;
int PreCreateThreads() override; int PreCreateThreads() override;
void PreMainMessageLoopRun() override; void PreMainMessageLoopRun() override;

View File

@ -170,7 +170,7 @@ message_center::MessageCenter* ChromeBrowserProcessStub::message_center() {
return NULL; return NULL;
} }
policy::BrowserPolicyConnector* policy::ChromeBrowserPolicyConnector*
ChromeBrowserProcessStub::browser_policy_connector() { ChromeBrowserProcessStub::browser_policy_connector() {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;
@ -191,11 +191,6 @@ GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() {
return NULL; return NULL;
} }
GpuProfileCache* ChromeBrowserProcessStub::gpu_profile_cache() {
NOTREACHED();
return NULL;
}
void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler( void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler(
const std::string& ip, const std::string& ip,
uint16_t port) { uint16_t port) {

View File

@ -60,11 +60,10 @@ class ChromeBrowserProcessStub : public BrowserProcess,
NotificationUIManager* notification_ui_manager() override; NotificationUIManager* notification_ui_manager() override;
NotificationPlatformBridge* notification_platform_bridge() override; NotificationPlatformBridge* notification_platform_bridge() override;
message_center::MessageCenter* message_center() override; message_center::MessageCenter* message_center() override;
policy::BrowserPolicyConnector* browser_policy_connector() override; policy::ChromeBrowserPolicyConnector* browser_policy_connector() override;
policy::PolicyService* policy_service() override; policy::PolicyService* policy_service() override;
IconManager* icon_manager() override; IconManager* icon_manager() override;
GpuModeManager* gpu_mode_manager() override; GpuModeManager* gpu_mode_manager() override;
GpuProfileCache* gpu_profile_cache() override;
void CreateDevToolsHttpProtocolHandler(const std::string& ip, void CreateDevToolsHttpProtocolHandler(const std::string& ip,
uint16_t port) override; uint16_t port) override;
void CreateDevToolsAutoOpener() override; void CreateDevToolsAutoOpener() override;

View File

@ -100,11 +100,6 @@ void ChromeProfileStub::set_last_selected_directory(
NOTREACHED(); NOTREACHED();
} }
PrefProxyConfigTracker* ChromeProfileStub::GetProxyConfigTracker() {
NOTREACHED();
return NULL;
}
chrome_browser_net::Predictor* ChromeProfileStub::GetNetworkPredictor() { chrome_browser_net::Predictor* ChromeProfileStub::GetNetworkPredictor() {
NOTREACHED(); NOTREACHED();
return NULL; return NULL;

View File

@ -39,7 +39,6 @@ class ChromeProfileStub : public Profile {
base::Time GetStartTime() const override; base::Time GetStartTime() const override;
base::FilePath last_selected_directory() override; base::FilePath last_selected_directory() override;
void set_last_selected_directory(const base::FilePath& path) override; void set_last_selected_directory(const base::FilePath& path) override;
PrefProxyConfigTracker* GetProxyConfigTracker() override;
chrome_browser_net::Predictor* GetNetworkPredictor() override; chrome_browser_net::Predictor* GetNetworkPredictor() override;
GURL GetHomePage() override; GURL GetHomePage() override;
bool WasCreatedByVersionOrLater(const std::string& version) override; bool WasCreatedByVersionOrLater(const std::string& version) override;

View File

@ -49,6 +49,7 @@
#include "chrome/common/constants.mojom.h" #include "chrome/common/constants.mojom.h"
#include "chrome/grit/browser_resources.h" #include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chrome/services/printing/public/interfaces/constants.mojom.h"
#include "components/navigation_interception/intercept_navigation_throttle.h" #include "components/navigation_interception/intercept_navigation_throttle.h"
#include "components/navigation_interception/navigation_params.h" #include "components/navigation_interception/navigation_params.h"
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h" #include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
@ -83,8 +84,6 @@
#include "extensions/common/switches.h" #include "extensions/common/switches.h"
#include "net/ssl/ssl_cert_request_info.h" #include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h" #include "ppapi/host/ppapi_host.h"
#include "services/metrics/metrics_mojo_service.h"
#include "services/metrics/public/interfaces/constants.mojom.h"
#include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h" #include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h"
#include "storage/browser/quota/quota_settings.h" #include "storage/browser/quota/quota_settings.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h" #include "third_party/WebKit/public/web/WebWindowFeatures.h"
@ -294,7 +293,7 @@ class CefQuotaPermissionContext : public content::QuotaPermissionContext {
void RequestQuotaPermission(const content::StorageQuotaParams& params, void RequestQuotaPermission(const content::StorageQuotaParams& params,
int render_process_id, int render_process_id,
const PermissionCallback& callback) override { const PermissionCallback& callback) override {
if (params.storage_type != storage::kStorageTypePersistent) { if (params.storage_type != blink::mojom::StorageType::kPersistent) {
// To match Chrome behavior we only support requesting quota with this // To match Chrome behavior we only support requesting quota with this
// interface for Persistent storage type. // interface for Persistent storage type.
callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW); callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
@ -598,19 +597,14 @@ void CefContentBrowserClient::RegisterInProcessServices(
info.factory = base::Bind(&ChromeService::Create); info.factory = base::Bind(&ChromeService::Create);
services->insert(std::make_pair(chrome::mojom::kServiceName, info)); services->insert(std::make_pair(chrome::mojom::kServiceName, info));
} }
{
// For metrics.
service_manager::EmbeddedServiceInfo info;
info.factory = base::Bind(&metrics::CreateMetricsService);
services->emplace(metrics::mojom::kMetricsServiceName, info);
}
} }
void CefContentBrowserClient::RegisterOutOfProcessServices( void CefContentBrowserClient::RegisterOutOfProcessServices(
OutOfProcessServiceMap* services) { OutOfProcessServiceMap* services) {
(*services)[printing::mojom::kServiceName] = (*services)[printing::mojom::kServiceName] =
base::ASCIIToUTF16("PDF Compositor Service"); base::ASCIIToUTF16("PDF Compositor Service");
(*services)[printing::mojom::kChromePrintingServiceName] =
base::ASCIIToUTF16("Printing Service");
(*services)[proxy_resolver::mojom::kProxyResolverServiceName] = (*services)[proxy_resolver::mojom::kProxyResolverServiceName] =
l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME); l10n_util::GetStringUTF16(IDS_UTILITY_PROCESS_PROXY_RESOLVER_NAME);
} }
@ -662,7 +656,6 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
switches::kFrameworkDirPath, switches::kFrameworkDirPath,
#endif #endif
switches::kLang,
switches::kLocalesDirPath, switches::kLocalesDirPath,
switches::kLogFile, switches::kLogFile,
switches::kLogSeverity, switches::kLogSeverity,
@ -707,6 +700,14 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
command_line->AppendSwitch(extensions::switches::kExtensionProcess); command_line->AppendSwitch(extensions::switches::kExtensionProcess);
} }
} }
} else {
// Propagate the following switches to non-renderer command line (along with
// any associated values) if present in the browser command line.
static const char* const kSwitchNames[] = {
switches::kLang,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
arraysize(kSwitchNames));
} }
#if defined(OS_LINUX) #if defined(OS_LINUX)

View File

@ -240,27 +240,8 @@ void CefDevToolsFrontend::WebContentsDestroyed() {
delete this; delete this;
} }
void CefDevToolsFrontend::SetPreferences(const std::string& json) {
if (json.empty())
return;
base::DictionaryValue* dict = nullptr;
std::unique_ptr<base::Value> parsed = base::JSONReader::Read(json);
if (!parsed || !parsed->GetAsDictionary(&dict))
return;
DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences);
for (base::DictionaryValue::Iterator it(*dict); !it.IsAtEnd(); it.Advance()) {
if (!it.value().IsType(base::Value::Type::STRING))
continue;
update.Get()->SetWithoutPathExpansion(it.key(),
it.value().CreateDeepCopy());
}
}
void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend( void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
const std::string& message) { const std::string& message) {
if (!agent_host_)
return;
std::string method; std::string method;
base::ListValue* params = NULL; base::ListValue* params = NULL;
base::DictionaryValue* dict = NULL; base::DictionaryValue* dict = NULL;
@ -275,7 +256,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) { if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
std::string protocol_message; std::string protocol_message;
if (!params->GetString(0, &protocol_message)) if (!agent_host_ || !params->GetString(0, &protocol_message))
return; return;
agent_host_->DispatchProtocolMessage(this, protocol_message); agent_host_->DispatchProtocolMessage(this, protocol_message);
} else if (method == "loadCompleted") { } else if (method == "loadCompleted") {
@ -361,6 +342,8 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
web_contents()->GetMainFrame()->ExecuteJavaScriptForTests( web_contents()->GetMainFrame()->ExecuteJavaScriptForTests(
base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);")); base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"));
} else if (method == "reattach") { } else if (method == "reattach") {
if (!agent_host_)
return;
agent_host_->DetachClient(this); agent_host_->DetachClient(this);
agent_host_->AttachClient(this); agent_host_->AttachClient(this);
} else if (method == "registerExtensionsAPI") { } else if (method == "registerExtensionsAPI") {

View File

@ -58,7 +58,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
return frontend_browser_; return frontend_browser_;
} }
protected: private:
CefDevToolsFrontend(CefRefPtr<CefBrowserHostImpl> frontend_browser, CefDevToolsFrontend(CefRefPtr<CefBrowserHostImpl> frontend_browser,
content::WebContents* inspected_contents, content::WebContents* inspected_contents,
const CefPoint& inspect_element_at); const CefPoint& inspect_element_at);
@ -68,8 +68,7 @@ class CefDevToolsFrontend : public content::WebContentsObserver,
void AgentHostClosed(content::DevToolsAgentHost* agent_host) override; void AgentHostClosed(content::DevToolsAgentHost* agent_host) override;
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
const std::string& message) override; const std::string& message) override;
void SetPreferences(const std::string& json); void HandleMessageFromDevToolsFrontend(const std::string& message);
virtual void HandleMessageFromDevToolsFrontend(const std::string& message);
private: private:
// WebContentsObserver overrides // WebContentsObserver overrides

View File

@ -64,7 +64,7 @@ std::unique_ptr<base::DictionaryValue> ParseManifest(
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
if (!manifest.get() || !manifest->IsType(base::Value::Type::DICTIONARY)) { if (!manifest.get() || !manifest->is_dict()) {
LOG(ERROR) << "Failed to parse extension manifest."; LOG(ERROR) << "Failed to parse extension manifest.";
return NULL; return NULL;
} }
@ -367,6 +367,10 @@ void CefExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
app_sorting_.reset(new NullAppSorting); app_sorting_.reset(new NullAppSorting);
} }
void CefExtensionSystem::InitForIncognitoProfile() {
NOTREACHED();
}
ExtensionService* CefExtensionSystem::extension_service() { ExtensionService* CefExtensionSystem::extension_service() {
return nullptr; return nullptr;
} }
@ -452,8 +456,11 @@ std::unique_ptr<ExtensionSet> CefExtensionSystem::GetDependentExtensions(
return base::MakeUnique<ExtensionSet>(); return base::MakeUnique<ExtensionSet>();
} }
void CefExtensionSystem::InstallUpdate(const std::string& extension_id, void CefExtensionSystem::InstallUpdate(
const base::FilePath& temp_dir) { const std::string& extension_id,
const std::string& public_key,
const base::FilePath& temp_dir,
InstallUpdateCallback install_update_callback) {
NOTREACHED(); NOTREACHED();
base::DeleteFile(temp_dir, true /* recursive */); base::DeleteFile(temp_dir, true /* recursive */);
} }

View File

@ -89,6 +89,7 @@ class CefExtensionSystem : public ExtensionSystem {
// ExtensionSystem implementation: // ExtensionSystem implementation:
void InitForRegularProfile(bool extensions_enabled) override; void InitForRegularProfile(bool extensions_enabled) override;
void InitForIncognitoProfile() override;
ExtensionService* extension_service() override; ExtensionService* extension_service() override;
RuntimeData* runtime_data() override; RuntimeData* runtime_data() override;
ManagementPolicy* management_policy() override; ManagementPolicy* management_policy() override;
@ -111,7 +112,9 @@ class CefExtensionSystem : public ExtensionSystem {
std::unique_ptr<ExtensionSet> GetDependentExtensions( std::unique_ptr<ExtensionSet> GetDependentExtensions(
const Extension* extension) override; const Extension* extension) override;
void InstallUpdate(const std::string& extension_id, void InstallUpdate(const std::string& extension_id,
const base::FilePath& temp_dir) override; const std::string& public_key,
const base::FilePath& temp_dir,
InstallUpdateCallback install_update_callback) override;
bool initialized() const { return initialized_; } bool initialized() const { return initialized_; }

View File

@ -346,11 +346,6 @@ void CefBrowserPlatformDelegateNativeLinux::TranslateWheelEvent(
result.wheel_ticks_y = deltaY / scrollbarPixelsPerGtkTick; result.wheel_ticks_y = deltaY / scrollbarPixelsPerGtkTick;
result.has_precise_scrolling_deltas = true; result.has_precise_scrolling_deltas = true;
// Unless the phase and momentumPhase are passed in as parameters to this
// function, there is no way to know them
result.phase = blink::WebMouseWheelEvent::kPhaseNone;
result.momentum_phase = blink::WebMouseWheelEvent::kPhaseNone;
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::kLeft; result.button = blink::WebMouseEvent::Button::kLeft;
else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON) else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON)

View File

@ -423,11 +423,6 @@ void CefBrowserPlatformDelegateNativeMac::TranslateWheelEvent(
result.wheel_ticks_y = deltaY / scrollbarPixelsPerCocoaTick; result.wheel_ticks_y = deltaY / scrollbarPixelsPerCocoaTick;
result.has_precise_scrolling_deltas = true; result.has_precise_scrolling_deltas = true;
// Unless the phase and momentumPhase are passed in as parameters to this
// function, there is no way to know them
result.phase = blink::WebMouseWheelEvent::kPhaseNone;
result.momentum_phase = blink::WebMouseWheelEvent::kPhaseNone;
if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON) if (mouse_event.modifiers & EVENTFLAG_LEFT_MOUSE_BUTTON)
result.button = blink::WebMouseEvent::Button::kLeft; result.button = blink::WebMouseEvent::Button::kLeft;
else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON) else if (mouse_event.modifiers & EVENTFLAG_MIDDLE_MOUSE_BUTTON)

View File

@ -5,6 +5,8 @@
#include "libcef/browser/native/file_dialog_runner_win.h" #include "libcef/browser/native/file_dialog_runner_win.h"
#include <windows.h>
#include <commdlg.h> #include <commdlg.h>
#include <shlobj.h> #include <shlobj.h>
#include <wrl/client.h> #include <wrl/client.h>

View File

@ -7,6 +7,8 @@
#define CEF_LIBCEF_BROWSER_NATIVE_JAVASCRIPT_DIALOG_RUNNER_WIN_H_ #define CEF_LIBCEF_BROWSER_NATIVE_JAVASCRIPT_DIALOG_RUNNER_WIN_H_
#pragma once #pragma once
#include <windows.h>
#include "libcef/browser/javascript_dialog_runner.h" #include "libcef/browser/javascript_dialog_runner.h"
class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner { class CefJavaScriptDialogRunnerWin : public CefJavaScriptDialogRunner {

View File

@ -4,6 +4,8 @@
#include "libcef/browser/native/window_delegate_view.h" #include "libcef/browser/native/window_delegate_view.h"
#include <utility>
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "ui/views/background.h" #include "ui/views/background.h"
#include "ui/views/controls/webview/webview.h" #include "ui/views/controls/webview/webview.h"
@ -55,7 +57,7 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
void CefWindowDelegateView::InitContent() { void CefWindowDelegateView::InitContent() {
SetBackground(views::CreateSolidBackground(background_color_)); SetBackground(views::CreateSolidBackground(background_color_));
SetLayoutManager(new views::FillLayout()); SetLayoutManager(std::make_unique<views::FillLayout>());
AddChildView(web_view_); AddChildView(web_view_);
} }

View File

@ -13,7 +13,6 @@
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/events/platform/platform_event_source.h" #include "ui/events/platform/platform_event_source.h"
#include "ui/events/platform/x11/x11_event_source.h"
#include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h"
#include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h" #include "ui/views/widget/desktop_aura/x11_topmost_window_finder.h"
@ -170,11 +169,8 @@ void CefWindowX11::Show() {
XMapWindow(xdisplay_, xwindow_); XMapWindow(xdisplay_, xwindow_);
// We now block until our window is mapped. Some X11 APIs will crash and // TODO(thomasanderson): Find out why this flush is necessary.
// burn if passed |xwindow_| before the window is mapped, and XMapWindow is XFlush(xdisplay_);
// asynchronous.
if (ui::X11EventSource::GetInstance())
ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(xwindow_);
window_mapped_ = true; window_mapped_ = true;
// Setup the drag and drop proxy on the top level window of the application // Setup the drag and drop proxy on the top level window of the application

View File

@ -25,7 +25,6 @@
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "components/net_log/chrome_net_log.h" #include "components/net_log/chrome_net_log.h"
@ -115,6 +114,7 @@ std::unique_ptr<net::ProxyService> CreateProxyService(
net::NetLog* net_log, net::NetLog* net_log,
net::URLRequestContext* context, net::URLRequestContext* context,
net::NetworkDelegate* network_delegate, net::NetworkDelegate* network_delegate,
proxy_resolver::mojom::ProxyResolverFactoryPtr proxy_resolver_factory,
std::unique_ptr<net::ProxyConfigService> proxy_config_service, std::unique_ptr<net::ProxyConfigService> proxy_config_service,
const base::CommandLine& command_line, const base::CommandLine& command_line,
bool quick_check_enabled, bool quick_check_enabled,
@ -136,8 +136,7 @@ std::unique_ptr<net::ProxyService> CreateProxyService(
dhcp_proxy_script_fetcher = dhcp_factory.Create(context); dhcp_proxy_script_fetcher = dhcp_factory.Create(context);
proxy_service = content::CreateProxyServiceUsingMojoFactory( proxy_service = content::CreateProxyServiceUsingMojoFactory(
ChromeMojoProxyResolverFactory::CreateWithStrongBinding(), std::move(proxy_resolver_factory), std::move(proxy_config_service),
std::move(proxy_config_service),
base::MakeUnique<net::ProxyScriptFetcherImpl>(context), base::MakeUnique<net::ProxyScriptFetcherImpl>(context),
std::move(dhcp_proxy_script_fetcher), context->host_resolver(), net_log, std::move(dhcp_proxy_script_fetcher), context->host_resolver(), net_log,
network_delegate); network_delegate);
@ -171,6 +170,8 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
io_state_->net_log_ = g_browser_process->net_log(), io_state_->net_log_ = g_browser_process->net_log(),
DCHECK(io_state_->net_log_); DCHECK(io_state_->net_log_);
io_state_->io_task_runner_ = std::move(io_task_runner); io_state_->io_task_runner_ = std::move(io_task_runner);
io_state_->proxy_resolver_factory_ =
ChromeMojoProxyResolverFactory::CreateWithStrongBinding();
io_state_->proxy_config_service_ = std::move(proxy_config_service); io_state_->proxy_config_service_ = std::move(proxy_config_service);
io_state_->request_interceptors_ = std::move(request_interceptors); io_state_->request_interceptors_ = std::move(request_interceptors);
@ -318,6 +319,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
CreateProxyService(io_state_->net_log_, CreateProxyService(io_state_->net_log_,
io_state_->url_request_context_.get(), io_state_->url_request_context_.get(),
io_state_->url_request_context_->network_delegate(), io_state_->url_request_context_->network_delegate(),
std::move(io_state_->proxy_resolver_factory_),
std::move(io_state_->proxy_config_service_), std::move(io_state_->proxy_config_service_),
*command_line, quick_check_enabled_.GetValue(), *command_line, quick_check_enabled_.GetValue(),
pac_https_url_stripping_enabled_.GetValue()); pac_https_url_stripping_enabled_.GetValue());
@ -526,15 +528,6 @@ net::CookieStore* CefURLRequestContextGetterImpl::GetExistingCookieStore()
return nullptr; return nullptr;
} }
void CefURLRequestContextGetterImpl::CreateProxyConfigService() {
if (io_state_->proxy_config_service_.get())
return;
io_state_->proxy_config_service_ =
net::ProxyService::CreateSystemProxyConfigService(
io_state_->io_task_runner_);
}
void CefURLRequestContextGetterImpl::UpdateServerWhitelist() { void CefURLRequestContextGetterImpl::UpdateServerWhitelist() {
io_state_->http_auth_preferences_->SetServerWhitelist( io_state_->http_auth_preferences_->SetServerWhitelist(
auth_server_whitelist_.GetValue()); auth_server_whitelist_.GetValue());

View File

@ -17,6 +17,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/memory/ref_counted.h" #include "base/memory/ref_counted.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
#include "components/prefs/pref_member.h" #include "components/prefs/pref_member.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "net/url_request/url_request_job_factory.h" #include "net/url_request/url_request_job_factory.h"
@ -84,7 +85,6 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
} }
private: private:
void CreateProxyConfigService();
void UpdateServerWhitelist(); void UpdateServerWhitelist();
void UpdateDelegateWhitelist(); void UpdateDelegateWhitelist();
@ -117,6 +117,8 @@ class CefURLRequestContextGetterImpl : public CefURLRequestContextGetter {
std::vector<std::string> cookie_supported_schemes_; std::vector<std::string> cookie_supported_schemes_;
std::vector<CefRefPtr<CefRequestContextHandler>> handler_list_; std::vector<CefRefPtr<CefRequestContextHandler>> handler_list_;
proxy_resolver::mojom::ProxyResolverFactoryPtr proxy_resolver_factory_;
}; };
std::unique_ptr<IOState> io_state_; std::unique_ptr<IOState> io_state_;

View File

@ -101,7 +101,9 @@ struct PopulateAxNodeAttributes {
case ui::AX_ATTR_ERRORMESSAGE_ID: case ui::AX_ATTR_ERRORMESSAGE_ID:
case ui::AX_ATTR_DETAILS_ID: case ui::AX_ATTR_DETAILS_ID:
case ui::AX_ATTR_MEMBER_OF_ID: case ui::AX_ATTR_MEMBER_OF_ID:
case ui::AX_ATTR_NEXT_FOCUS_ID:
case ui::AX_ATTR_NEXT_ON_LINE_ID: case ui::AX_ATTR_NEXT_ON_LINE_ID:
case ui::AX_ATTR_PREVIOUS_FOCUS_ID:
case ui::AX_ATTR_PREVIOUS_ON_LINE_ID: case ui::AX_ATTR_PREVIOUS_ON_LINE_ID:
case ui::AX_ATTR_CHILD_TREE_ID: case ui::AX_ATTR_CHILD_TREE_ID:
case ui::AX_ATTR_SET_SIZE: case ui::AX_ATTR_SET_SIZE:

View File

@ -239,8 +239,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
#if !defined(OS_MACOSX) #if !defined(OS_MACOSX)
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>( delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
AllocateFrameSinkId(is_guest_view_hack), this, AllocateFrameSinkId(is_guest_view_hack), this,
false /* enable_surface_synchronization */, false /* enable_surface_synchronization */, false /* enable_viz */);
base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableViz));
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR)); root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
#endif #endif
@ -323,11 +322,6 @@ void CefRenderWidgetHostViewOSR::InitAsChild(gfx::NativeView parent_view) {
Show(); Show();
} }
content::RenderWidgetHost* CefRenderWidgetHostViewOSR::GetRenderWidgetHost()
const {
return render_widget_host_;
}
void CefRenderWidgetHostViewOSR::SetSize(const gfx::Size& size) {} void CefRenderWidgetHostViewOSR::SetSize(const gfx::Size& size) {}
void CefRenderWidgetHostViewOSR::SetBounds(const gfx::Rect& rect) {} void CefRenderWidgetHostViewOSR::SetBounds(const gfx::Rect& rect) {}
@ -710,6 +704,17 @@ gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
return GetViewBounds(); return GetViewBounds();
} }
content::RenderWidgetHostImpl*
CefRenderWidgetHostViewOSR::GetRenderWidgetHostImpl() const {
return render_widget_host_;
}
viz::SurfaceId CefRenderWidgetHostViewOSR::GetCurrentSurfaceId() const {
return GetDelegatedFrameHost()
? GetDelegatedFrameHost()->GetCurrentSurfaceId()
: viz::SurfaceId();
}
content::BrowserAccessibilityManager* content::BrowserAccessibilityManager*
CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager( CefRenderWidgetHostViewOSR::CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate, content::BrowserAccessibilityDelegate* delegate,
@ -799,34 +804,10 @@ void CefRenderWidgetHostViewOSR::SetNeedsBeginFrames(bool enabled) {
} }
} }
void CefRenderWidgetHostViewOSR::ProcessKeyboardEvent( void CefRenderWidgetHostViewOSR::SetWantsAnimateOnlyBeginFrames() {
const content::NativeWebKeyboardEvent& event, if (GetDelegatedFrameHost()) {
const ui::LatencyInfo& latency) { GetDelegatedFrameHost()->SetWantsAnimateOnlyBeginFrames();
render_widget_host_->ForwardKeyboardEventWithLatencyInfo(event, latency);
} }
void CefRenderWidgetHostViewOSR::ProcessMouseEvent(
const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) {
render_widget_host_->ForwardMouseEventWithLatencyInfo(event, latency);
}
void CefRenderWidgetHostViewOSR::ProcessMouseWheelEvent(
const blink::WebMouseWheelEvent& event,
const ui::LatencyInfo& latency) {
render_widget_host_->ForwardWheelEventWithLatencyInfo(event, latency);
}
void CefRenderWidgetHostViewOSR::ProcessTouchEvent(
const blink::WebTouchEvent& event,
const ui::LatencyInfo& latency) {
render_widget_host_->ForwardTouchEventWithLatencyInfo(event, latency);
}
void CefRenderWidgetHostViewOSR::ProcessGestureEvent(
const blink::WebGestureEvent& event,
const ui::LatencyInfo& latency) {
render_widget_host_->ForwardGestureEventWithLatencyInfo(event, latency);
} }
bool CefRenderWidgetHostViewOSR::TransformPointToLocalCoordSpace( bool CefRenderWidgetHostViewOSR::TransformPointToLocalCoordSpace(
@ -886,8 +867,7 @@ bool CefRenderWidgetHostViewOSR::DelegatedFrameHostIsVisible() const {
return !render_widget_host_->is_hidden(); return !render_widget_host_->is_hidden();
} }
SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor( SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor() const {
SkColor color) const {
// When making an element on the page fullscreen the element's background // When making an element on the page fullscreen the element's background
// may not match the page's, so use black as the gutter color to avoid // may not match the page's, so use black as the gutter color to avoid
// flashes of brighter colors during the transition. // flashes of brighter colors during the transition.
@ -895,7 +875,7 @@ SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor(
render_widget_host_->delegate()->IsFullscreenForCurrentTab()) { render_widget_host_->delegate()->IsFullscreenForCurrentTab()) {
return SK_ColorBLACK; return SK_ColorBLACK;
} }
return color; return background_color_;
} }
gfx::Size CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP() gfx::Size CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP()
@ -919,7 +899,7 @@ viz::LocalSurfaceId CefRenderWidgetHostViewOSR::GetLocalSurfaceId() const {
return local_surface_id_; return local_surface_id_;
} }
void CefRenderWidgetHostViewOSR::OnBeginFrame() { void CefRenderWidgetHostViewOSR::OnBeginFrame(base::TimeTicks frame_time) {
// TODO(cef): Maybe we can use this method in combination with // TODO(cef): Maybe we can use this method in combination with
// OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer. // OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer.
// See https://codereview.chromium.org/1841083007. // See https://codereview.chromium.org/1841083007.
@ -1039,7 +1019,7 @@ void CefRenderWidgetHostViewOSR::SendKeyEvent(
TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent"); TRACE_EVENT0("libcef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
if (render_widget_host_ && render_widget_host_->GetView()) { if (render_widget_host_ && render_widget_host_->GetView()) {
// Direct routing requires that events go directly to the View. // Direct routing requires that events go directly to the View.
render_widget_host_->GetView()->ProcessKeyboardEvent( render_widget_host_->ForwardKeyboardEventWithLatencyInfo(
event, ui::LatencyInfo(event.GetType() == blink::WebInputEvent::kChar || event, ui::LatencyInfo(event.GetType() == blink::WebInputEvent::kChar ||
event.GetType() == event.GetType() ==
blink::WebInputEvent::kRawKeyDown blink::WebInputEvent::kRawKeyDown
@ -1334,8 +1314,8 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer() {
local_surface_id_ = local_surface_id_allocator_.GenerateId(); local_surface_id_ = local_surface_id_allocator_.GenerateId();
GetRootLayer()->SetBounds(gfx::Rect(size)); GetRootLayer()->SetBounds(gfx::Rect(size));
GetCompositor()->SetScaleAndSize(current_device_scale_factor_, GetCompositor()->SetScaleAndSize(current_device_scale_factor_, size_in_pixels,
size_in_pixels); local_surface_id_);
PlatformResizeCompositorWidget(size_in_pixels); PlatformResizeCompositorWidget(size_in_pixels);
} }

View File

@ -16,7 +16,7 @@
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/viz/common/frame_sinks/begin_frame_source.h" #include "components/viz/common/frame_sinks/begin_frame_source.h"
#include "components/viz/common/surfaces/local_surface_id_allocator.h" #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "content/browser/renderer_host/compositor_resize_lock.h" #include "content/browser/renderer_host/compositor_resize_lock.h"
#include "content/browser/renderer_host/delegated_frame_host.h" #include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_view_base.h" #include "content/browser/renderer_host/render_widget_host_view_base.h"
@ -100,7 +100,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
// RenderWidgetHostView implementation. // RenderWidgetHostView implementation.
void InitAsChild(gfx::NativeView parent_view) override; void InitAsChild(gfx::NativeView parent_view) override;
content::RenderWidgetHost* GetRenderWidgetHost() const override;
void SetSize(const gfx::Size& size) override; void SetSize(const gfx::Size& size) override;
void SetBounds(const gfx::Rect& rect) override; void SetBounds(const gfx::Rect& rect) override;
gfx::Vector2dF GetLastScrollOffset() const override; gfx::Vector2dF GetLastScrollOffset() const override;
@ -119,7 +118,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void UnlockMouse() override; void UnlockMouse() override;
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac() const override;
void SetActive(bool active) override; void SetActive(bool active) override;
void ShowDefinitionForSelection() override; void ShowDefinitionForSelection() override;
bool SupportsSpeech() const override; bool SupportsSpeech() const override;
@ -166,6 +164,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void EndFrameSubscription() override; void EndFrameSubscription() override;
bool HasAcceleratedSurface(const gfx::Size& desired_size) override; bool HasAcceleratedSurface(const gfx::Size& desired_size) override;
gfx::Rect GetBoundsInRootWindow() override; gfx::Rect GetBoundsInRootWindow() override;
content::RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override;
viz::SurfaceId GetCurrentSurfaceId() const override;
content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager( content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
content::BrowserAccessibilityDelegate* delegate, content::BrowserAccessibilityDelegate* delegate,
bool for_root_frame) override; bool for_root_frame) override;
@ -179,17 +179,8 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
const std::vector<gfx::Rect>& character_bounds) override; const std::vector<gfx::Rect>& character_bounds) override;
void SetNeedsBeginFrames(bool enabled) override; void SetNeedsBeginFrames(bool enabled) override;
void SetWantsAnimateOnlyBeginFrames() override;
void ProcessKeyboardEvent(const content::NativeWebKeyboardEvent& event,
const ui::LatencyInfo& latency) override;
void ProcessMouseEvent(const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) override;
void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event,
const ui::LatencyInfo& latency) override;
void ProcessTouchEvent(const blink::WebTouchEvent& event,
const ui::LatencyInfo& latency) override;
void ProcessGestureEvent(const blink::WebGestureEvent& event,
const ui::LatencyInfo& latency) override;
bool TransformPointToLocalCoordSpace(const gfx::PointF& point, bool TransformPointToLocalCoordSpace(const gfx::PointF& point,
const viz::SurfaceId& original_surface, const viz::SurfaceId& original_surface,
gfx::PointF* transformed_point) override; gfx::PointF* transformed_point) override;
@ -206,13 +197,13 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
// DelegatedFrameHostClient implementation. // DelegatedFrameHostClient implementation.
ui::Layer* DelegatedFrameHostGetLayer() const override; ui::Layer* DelegatedFrameHostGetLayer() const override;
bool DelegatedFrameHostIsVisible() const override; bool DelegatedFrameHostIsVisible() const override;
SkColor DelegatedFrameHostGetGutterColor(SkColor color) const override; SkColor DelegatedFrameHostGetGutterColor() const override;
gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override; gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override;
bool DelegatedFrameCanCreateResizeLock() const override; bool DelegatedFrameCanCreateResizeLock() const override;
std::unique_ptr<content::CompositorResizeLock> std::unique_ptr<content::CompositorResizeLock>
DelegatedFrameHostCreateResizeLock() override; DelegatedFrameHostCreateResizeLock() override;
viz::LocalSurfaceId GetLocalSurfaceId() const override; viz::LocalSurfaceId GetLocalSurfaceId() const override;
void OnBeginFrame() override; void OnBeginFrame(base::TimeTicks frame_time) override;
bool IsAutoResizeEnabled() const override; bool IsAutoResizeEnabled() const override;
void OnFrameTokenChanged(uint32_t frame_token) override; void OnFrameTokenChanged(uint32_t frame_token) override;
@ -334,7 +325,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
#endif #endif
viz::LocalSurfaceId local_surface_id_; viz::LocalSurfaceId local_surface_id_;
viz::LocalSurfaceIdAllocator local_surface_id_allocator_; viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
#if defined(OS_WIN) #if defined(OS_WIN)
std::unique_ptr<gfx::WindowImpl> window_; std::unique_ptr<gfx::WindowImpl> window_;

View File

@ -26,14 +26,7 @@ class MacHelper : public content::BrowserCompositorMacClient,
// BrowserCompositorMacClient methods: // BrowserCompositorMacClient methods:
NSView* BrowserCompositorMacGetNSView() const override { SkColor BrowserCompositorMacGetGutterColor() const override {
// Intentionally return nil so that
// BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP uses the layer
// size instead of the NSView size.
return nil;
}
SkColor BrowserCompositorMacGetGutterColor(SkColor color) const override {
// When making an element on the page fullscreen the element's background // When making an element on the page fullscreen the element's background
// may not match the page's, so use black as the gutter color to avoid // may not match the page's, so use black as the gutter color to avoid
// flashes of brighter colors during the transition. // flashes of brighter colors during the transition.
@ -41,19 +34,21 @@ class MacHelper : public content::BrowserCompositorMacClient,
view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) { view_->render_widget_host()->delegate()->IsFullscreenForCurrentTab()) {
return SK_ColorBLACK; return SK_ColorBLACK;
} }
return color; return view_->background_color();
} }
void BrowserCompositorMacOnBeginFrame() override {} void BrowserCompositorMacOnBeginFrame() override {}
viz::LocalSurfaceId GetLocalSurfaceId() const override { void OnFrameTokenChanged(uint32_t frame_token) override {
return view_->local_surface_id(); view_->render_widget_host()->DidProcessFrame(frame_token);
} }
// AcceleratedWidgetMacNSView methods: // AcceleratedWidgetMacNSView methods:
NSView* AcceleratedWidgetGetNSView() const override { NSView* AcceleratedWidgetGetNSView() const override {
return [view_->window_ contentView]; // Intentionally return nil so that BrowserCompositorMac::GetViewProperties
// uses the layer size instead of the NSView size.
return nil;
} }
void AcceleratedWidgetGetVSyncParameters( void AcceleratedWidgetGetVSyncParameters(
@ -65,10 +60,6 @@ class MacHelper : public content::BrowserCompositorMacClient,
void AcceleratedWidgetSwapCompleted() override {} void AcceleratedWidgetSwapCompleted() override {}
void OnFrameTokenChanged(uint32_t frame_token) override {
view_->render_widget_host()->DidProcessFrame(frame_token);
}
private: private:
// Guaranteed to outlive this object. // Guaranteed to outlive this object.
CefRenderWidgetHostViewOSR* view_; CefRenderWidgetHostViewOSR* view_;
@ -76,13 +67,6 @@ class MacHelper : public content::BrowserCompositorMacClient,
DISALLOW_COPY_AND_ASSIGN(MacHelper); DISALLOW_COPY_AND_ASSIGN(MacHelper);
}; };
ui::AcceleratedWidgetMac* CefRenderWidgetHostViewOSR::GetAcceleratedWidgetMac()
const {
if (browser_compositor_)
return browser_compositor_->GetAcceleratedWidgetMac();
return nullptr;
}
void CefRenderWidgetHostViewOSR::SetActive(bool active) {} void CefRenderWidgetHostViewOSR::SetActive(bool active) {}
void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {} void CefRenderWidgetHostViewOSR::ShowDefinitionForSelection() {}

View File

@ -171,7 +171,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
registry->SetDefaultPrefValue( registry->SetDefaultPrefValue(
spellcheck::prefs::kSpellCheckUseSpellingService, spellcheck::prefs::kSpellCheckUseSpellingService,
base::Value(enable_spelling_service_)); base::Value(enable_spelling_service_));
registry->SetDefaultPrefValue(spellcheck::prefs::kEnableSpellcheck, registry->SetDefaultPrefValue(spellcheck::prefs::kSpellCheckEnable,
base::Value(!enable_spelling_service_)); base::Value(!enable_spelling_service_));
// Pepper flash preferences. // Pepper flash preferences.

View File

@ -16,6 +16,7 @@
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/timer/timer.h" #include "base/timer/timer.h"
#include "build/build_config.h" #include "build/build_config.h"
@ -37,6 +38,7 @@
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/system/buffer.h" #include "mojo/public/cpp/system/buffer.h"
@ -62,7 +64,6 @@ CefPrintViewManagerBase::CefPrintViewManagerBase(
printing_rfh_(nullptr), printing_rfh_(nullptr),
printing_succeeded_(false), printing_succeeded_(false),
inside_inner_message_loop_(false), inside_inner_message_loop_(false),
expecting_first_page_(true),
queue_(g_browser_process->print_job_manager()->queue()), queue_(g_browser_process->print_job_manager()->queue()),
weak_ptr_factory_(this) { weak_ptr_factory_(this) {
DCHECK(queue_.get()); DCHECK(queue_.get());
@ -71,7 +72,7 @@ CefPrintViewManagerBase::CefPrintViewManagerBase(
printing_enabled_.Init( printing_enabled_.Init(
prefs::kPrintingEnabled, profile->GetPrefs(), prefs::kPrintingEnabled, profile->GetPrefs(),
base::Bind(&CefPrintViewManagerBase::UpdatePrintingEnabled, base::Bind(&CefPrintViewManagerBase::UpdatePrintingEnabled,
base::Unretained(this))); weak_ptr_factory_.GetWeakPtr()));
} }
CefPrintViewManagerBase::~CefPrintViewManagerBase() { CefPrintViewManagerBase::~CefPrintViewManagerBase() {
@ -89,10 +90,53 @@ bool CefPrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
} }
#endif #endif
void CefPrintViewManagerBase::PrintDocument(
PrintedDocument* document,
const scoped_refptr<base::RefCountedBytes>& print_data,
const gfx::Size& page_size,
const gfx::Rect& content_area,
const gfx::Point& offsets) {
#if defined(OS_WIN)
if (PrintedDocument::HasDebugDumpPath())
document->DebugDumpData(print_data.get(), FILE_PATH_LITERAL(".pdf"));
const auto& settings = document->settings();
if (settings.printer_is_textonly()) {
print_job_->StartPdfToTextConversion(print_data, page_size);
} else if ((settings.printer_is_ps2() || settings.printer_is_ps3()) &&
!base::FeatureList::IsEnabled(
features::kDisablePostScriptPrinting)) {
print_job_->StartPdfToPostScriptConversion(
print_data, content_area, offsets, settings.printer_is_ps2());
} else {
// TODO(thestig): Figure out why rendering text with GDI results in random
// missing characters for some users. https://crbug.com/658606
// Update : The missing letters seem to have been caused by the same
// problem as https://crbug.com/659604 which was resolved. GDI printing
// seems to work with the fix for this bug applied.
bool print_text_with_gdi =
settings.print_text_with_gdi() && !settings.printer_is_xps() &&
base::FeatureList::IsEnabled(features::kGdiTextPrinting);
print_job_->StartPdfToEmfConversion(print_data, page_size, content_area,
print_text_with_gdi);
}
#else
std::unique_ptr<PdfMetafileSkia> metafile =
std::make_unique<PdfMetafileSkia>(SkiaDocumentType::PDF);
CHECK(metafile->InitFromData(print_data->front(), print_data->size()));
// Update the rendered document. It will send notifications to the listener.
document->SetDocument(std::move(metafile), page_size, content_area);
ShouldQuitFromInnerMessageLoop();
#endif
}
void CefPrintViewManagerBase::UpdatePrintingEnabled() { void CefPrintViewManagerBase::UpdatePrintingEnabled() {
web_contents()->ForEachFrame( DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
base::Bind(&CefPrintViewManagerBase::SendPrintingEnabled, // The Unretained() is safe because ForEachFrame() is synchronous.
base::Unretained(this), printing_enabled_.GetValue())); web_contents()->ForEachFrame(base::BindRepeating(
&CefPrintViewManagerBase::SendPrintingEnabled, base::Unretained(this),
printing_enabled_.GetValue()));
} }
void CefPrintViewManagerBase::NavigationStopped() { void CefPrintViewManagerBase::NavigationStopped() {
@ -113,8 +157,21 @@ void CefPrintViewManagerBase::OnDidGetPrintedPagesCount(int cookie,
OpportunisticallyCreatePrintJob(cookie); OpportunisticallyCreatePrintJob(cookie);
} }
PrintedDocument* CefPrintViewManagerBase::GetDocument(int cookie) {
if (!OpportunisticallyCreatePrintJob(cookie))
return nullptr;
PrintedDocument* document = print_job_->document();
if (!document || cookie != document->cookie()) {
// Out of sync. It may happen since we are completely asynchronous. Old
// spurious messages can be received if one of the processes is overloaded.
return nullptr;
}
return document;
}
void CefPrintViewManagerBase::OnComposePdfDone( void CefPrintViewManagerBase::OnComposePdfDone(
const PrintHostMsg_DidPrintPage_Params& params, const PrintHostMsg_DidPrintDocument_Params& params,
mojom::PdfCompositor::Status status, mojom::PdfCompositor::Status status,
mojo::ScopedSharedBufferHandle handle) { mojo::ScopedSharedBufferHandle handle) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI); DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@ -123,28 +180,26 @@ void CefPrintViewManagerBase::OnComposePdfDone(
return; return;
} }
UpdateForPrintedPage(params, true, GetShmFromMojoHandle(std::move(handle)));
}
void CefPrintViewManagerBase::OnDidPrintPage(
const PrintHostMsg_DidPrintPage_Params& params) {
// Ready to composite. Starting a print job.
if (!OpportunisticallyCreatePrintJob(params.document_cookie))
return;
PrintedDocument* document = print_job_->document(); PrintedDocument* document = print_job_->document();
if (!document || params.document_cookie != document->cookie()) { if (!document)
// Out of sync. It may happen since we are completely asynchronous. Old
// spurious messages can be received if one of the processes is overloaded.
return; return;
std::unique_ptr<base::SharedMemory> shared_buf =
GetShmFromMojoHandle(std::move(handle));
scoped_refptr<base::RefCountedBytes> bytes =
base::MakeRefCounted<base::RefCountedBytes>(
reinterpret_cast<const unsigned char*>(shared_buf->memory()),
shared_buf->mapped_size());
PrintDocument(document, bytes, params.page_size, params.content_area,
params.physical_offsets);
} }
const bool metafile_must_be_valid = expecting_first_page_; void CefPrintViewManagerBase::OnDidPrintDocument(
expecting_first_page_ = false; const PrintHostMsg_DidPrintDocument_Params& params) {
PrintedDocument* document = GetDocument(params.document_cookie);
if (!document)
return;
// Only used when |metafile_must_be_valid| is true.
std::unique_ptr<base::SharedMemory> shared_buf;
if (metafile_must_be_valid) {
if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
NOTREACHED() << "invalid memory handle"; NOTREACHED() << "invalid memory handle";
web_contents()->Stop(); web_contents()->Stop();
@ -160,82 +215,20 @@ void CefPrintViewManagerBase::OnDidPrintPage(
weak_ptr_factory_.GetWeakPtr(), params)); weak_ptr_factory_.GetWeakPtr(), params));
return; return;
} }
shared_buf =
std::unique_ptr<base::SharedMemory> shared_buf =
std::make_unique<base::SharedMemory>(params.metafile_data_handle, true); std::make_unique<base::SharedMemory>(params.metafile_data_handle, true);
if (!shared_buf->Map(params.data_size)) { if (!shared_buf->Map(params.data_size)) {
NOTREACHED() << "couldn't map"; NOTREACHED() << "couldn't map";
web_contents()->Stop(); web_contents()->Stop();
return; return;
} }
} else { scoped_refptr<base::RefCountedBytes> bytes =
if (base::SharedMemory::IsHandleValid(params.metafile_data_handle)) { base::MakeRefCounted<base::RefCountedBytes>(
NOTREACHED() << "unexpected valid memory handle";
web_contents()->Stop();
base::SharedMemory::CloseHandle(params.metafile_data_handle);
return;
}
}
UpdateForPrintedPage(params, metafile_must_be_valid, std::move(shared_buf));
}
void CefPrintViewManagerBase::UpdateForPrintedPage(
const PrintHostMsg_DidPrintPage_Params& params,
bool has_valid_page_data,
std::unique_ptr<base::SharedMemory> shared_buf) {
PrintedDocument* document = print_job_->document();
if (!document)
return;
#if defined(OS_WIN)
print_job_->AppendPrintedPage(params.page_number);
if (has_valid_page_data) {
scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes(
reinterpret_cast<const unsigned char*>(shared_buf->memory()), reinterpret_cast<const unsigned char*>(shared_buf->memory()),
shared_buf->mapped_size())); params.data_size);
PrintDocument(document, bytes, params.page_size, params.content_area,
document->DebugDumpData(bytes.get(), FILE_PATH_LITERAL(".pdf")); params.physical_offsets);
const auto& settings = document->settings();
if (settings.printer_is_textonly()) {
print_job_->StartPdfToTextConversion(bytes, params.page_size);
} else if ((settings.printer_is_ps2() || settings.printer_is_ps3()) &&
!base::FeatureList::IsEnabled(
features::kDisablePostScriptPrinting)) {
print_job_->StartPdfToPostScriptConversion(bytes, params.content_area,
params.physical_offsets,
settings.printer_is_ps2());
} else {
// TODO(thestig): Figure out why rendering text with GDI results in random
// missing characters for some users. https://crbug.com/658606
// Update : The missing letters seem to have been caused by the same
// problem as https://crbug.com/659604 which was resolved. GDI printing
// seems to work with the fix for this bug applied.
bool print_text_with_gdi =
settings.print_text_with_gdi() && !settings.printer_is_xps() &&
base::FeatureList::IsEnabled(features::kGdiTextPrinting);
print_job_->StartPdfToEmfConversion(
bytes, params.page_size, params.content_area, print_text_with_gdi);
}
}
#else
std::unique_ptr<PdfMetafileSkia> metafile =
std::make_unique<PdfMetafileSkia>(SkiaDocumentType::PDF);
if (has_valid_page_data) {
if (!metafile->InitFromData(shared_buf->memory(),
shared_buf->mapped_size())) {
NOTREACHED() << "Invalid metafile header";
web_contents()->Stop();
return;
}
}
// Update the rendered document. It will send notifications to the listener.
document->SetPage(params.page_number, std::move(metafile), params.page_size,
params.content_area);
ShouldQuitFromInnerMessageLoop();
#endif
} }
void CefPrintViewManagerBase::OnPrintingFailed(int cookie) { void CefPrintViewManagerBase::OnPrintingFailed(int cookie) {
@ -283,7 +276,7 @@ bool CefPrintViewManagerBase::OnMessageReceived(
content::RenderFrameHost* render_frame_host) { content::RenderFrameHost* render_frame_host) {
bool handled = true; bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CefPrintViewManagerBase, message) IPC_BEGIN_MESSAGE_MAP(CefPrintViewManagerBase, message)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintPage, OnDidPrintPage) IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintDocument, OnDidPrintDocument)
IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError, IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError,
OnShowInvalidPrinterSettingsError) OnShowInvalidPrinterSettingsError)
IPC_MESSAGE_UNHANDLED(handled = false) IPC_MESSAGE_UNHANDLED(handled = false)
@ -322,8 +315,9 @@ void CefPrintViewManagerBase::OnNotifyPrintJobEvent(
break; break;
} }
case JobEventDetails::NEW_DOC: case JobEventDetails::NEW_DOC:
case JobEventDetails::NEW_PAGE: #if defined(OS_WIN)
case JobEventDetails::PAGE_DONE: case JobEventDetails::PAGE_DONE:
#endif
case JobEventDetails::DOC_DONE: { case JobEventDetails::DOC_DONE: {
// Don't care about the actual printing process. // Don't care about the actual printing process.
break; break;
@ -372,7 +366,7 @@ bool CefPrintViewManagerBase::RenderAllMissingPagesNow() {
// PrintJob will send a ALL_PAGES_REQUESTED after having received all the // PrintJob will send a ALL_PAGES_REQUESTED after having received all the
// pages it needs. RunLoop::QuitCurrentWhenIdleDeprecated() will be called as // pages it needs. RunLoop::QuitCurrentWhenIdleDeprecated() will be called as
// soon as print_job_->document()->IsComplete() is true on either // soon as print_job_->document()->IsComplete() is true on either
// ALL_PAGES_REQUESTED or in DidPrintPage(). The check is done in // ALL_PAGES_REQUESTED or in DidPrintDocument(). The check is done in
// ShouldQuitFromInnerMessageLoop(). // ShouldQuitFromInnerMessageLoop().
// BLOCKS until all the pages are received. (Need to enable recursive task) // BLOCKS until all the pages are received. (Need to enable recursive task)
if (!RunInnerMessageLoop()) { if (!RunInnerMessageLoop()) {
@ -437,7 +431,6 @@ void CefPrintViewManagerBase::DisconnectFromCurrentPrintJob() {
// DO NOT wait for the job to finish. // DO NOT wait for the job to finish.
ReleasePrintJob(); ReleasePrintJob();
} }
expecting_first_page_ = true;
} }
void CefPrintViewManagerBase::TerminatePrintJob(bool cancel) { void CefPrintViewManagerBase::TerminatePrintJob(bool cancel) {

View File

@ -20,10 +20,10 @@
#include "mojo/public/cpp/system/platform_handle.h" #include "mojo/public/cpp/system/platform_handle.h"
#include "printing/features/features.h" #include "printing/features/features.h"
struct PrintHostMsg_DidPrintPage_Params; struct PrintHostMsg_DidPrintDocument_Params;
namespace base { namespace base {
class SharedMemory; class RefCountedBytes;
} }
namespace content { namespace content {
@ -36,6 +36,8 @@ class JobEventDetails;
class PrintJob; class PrintJob;
class PrintJobWorkerOwner; class PrintJobWorkerOwner;
class PrintQueriesQueue; class PrintQueriesQueue;
class PrintedDocument;
class PrinterQuery;
// Base class for managing the print commands for a WebContents. // Base class for managing the print commands for a WebContents.
class CefPrintViewManagerBase : public content::NotificationObserver, class CefPrintViewManagerBase : public content::NotificationObserver,
@ -85,15 +87,10 @@ class CefPrintViewManagerBase : public content::NotificationObserver,
void OnDidGetPrintedPagesCount(int cookie, int number_pages) override; void OnDidGetPrintedPagesCount(int cookie, int number_pages) override;
void OnPrintingFailed(int cookie) override; void OnPrintingFailed(int cookie) override;
void OnShowInvalidPrinterSettingsError(); void OnShowInvalidPrinterSettingsError();
void OnDidPrintPage(const PrintHostMsg_DidPrintPage_Params& params); void OnDidPrintDocument(const PrintHostMsg_DidPrintDocument_Params& params);
// Handle extra tasks once a page or doc is printed.
void UpdateForPrintedPage(const PrintHostMsg_DidPrintPage_Params& params,
bool has_valid_page_data,
std::unique_ptr<base::SharedMemory> shared_buf);
// IPC message handlers for service. // IPC message handlers for service.
void OnComposePdfDone(const PrintHostMsg_DidPrintPage_Params& params, void OnComposePdfDone(const PrintHostMsg_DidPrintDocument_Params& params,
mojom::PdfCompositor::Status status, mojom::PdfCompositor::Status status,
mojo::ScopedSharedBufferHandle handle); mojo::ScopedSharedBufferHandle handle);
@ -105,9 +102,21 @@ class CefPrintViewManagerBase : public content::NotificationObserver,
// been requested to the renderer. // been requested to the renderer.
bool RenderAllMissingPagesNow(); bool RenderAllMissingPagesNow();
// Checks that synchronization is correct and a print query exists for
// |cookie|. If so, returns the document associated with the cookie.
PrintedDocument* GetDocument(int cookie);
// Starts printing |document| with the given |print_data|. This method assumes
// |print_data| contains valid data.
void PrintDocument(PrintedDocument* document,
const scoped_refptr<base::RefCountedBytes>& print_data,
const gfx::Size& page_size,
const gfx::Rect& content_area,
const gfx::Point& offsets);
// Quits the current message loop if these conditions hold true: a document is // Quits the current message loop if these conditions hold true: a document is
// loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This // loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This
// function is called in DidPrintPage() or on ALL_PAGES_REQUESTED // function is called in DidPrintDocument() or on ALL_PAGES_REQUESTED
// notification. The inner message loop is created was created by // notification. The inner message loop is created was created by
// RenderAllMissingPagesNow(). // RenderAllMissingPagesNow().
void ShouldQuitFromInnerMessageLoop(); void ShouldQuitFromInnerMessageLoop();
@ -164,9 +173,6 @@ class CefPrintViewManagerBase : public content::NotificationObserver,
// print settings are being loaded. // print settings are being loaded.
bool inside_inner_message_loop_; bool inside_inner_message_loop_;
// Set to true when OnDidPrintPage() should be expecting the first page.
bool expecting_first_page_;
// Whether printing is enabled. // Whether printing is enabled.
BooleanPrefMember printing_enabled_; BooleanPrefMember printing_enabled_;

View File

@ -35,36 +35,32 @@ namespace printing {
namespace { namespace {
// There's a race condition between deletion of the CefPrintingMessageFilter class CefPrintingMessageFilterShutdownNotifierFactory
// object on the UI thread and deletion of the PrefService (owned by Profile)
// on the UI thread. If the PrefService will be deleted first then
// PrefMember::Destroy() must be called from ShutdownOnUIThread() to avoid
// heap-use-after-free on CefPrintingMessageFilter destruction (due to
// ~PrefMember trying to access the already-deleted PrefService).
// ShutdownNotifierFactory makes sure that ShutdownOnUIThread() is called in
// this case.
class ShutdownNotifierFactory
: public BrowserContextKeyedServiceShutdownNotifierFactory { : public BrowserContextKeyedServiceShutdownNotifierFactory {
public: public:
static ShutdownNotifierFactory* GetInstance(); static CefPrintingMessageFilterShutdownNotifierFactory* GetInstance();
private: private:
friend struct base::LazyInstanceTraitsBase<ShutdownNotifierFactory>; friend struct base::LazyInstanceTraitsBase<
CefPrintingMessageFilterShutdownNotifierFactory>;
ShutdownNotifierFactory() CefPrintingMessageFilterShutdownNotifierFactory()
: BrowserContextKeyedServiceShutdownNotifierFactory( : BrowserContextKeyedServiceShutdownNotifierFactory(
"CefPrintingMessageFilter") {} "CefPrintingMessageFilter") {}
~ShutdownNotifierFactory() override {}
DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory); ~CefPrintingMessageFilterShutdownNotifierFactory() override {}
DISALLOW_COPY_AND_ASSIGN(CefPrintingMessageFilterShutdownNotifierFactory);
}; };
base::LazyInstance<ShutdownNotifierFactory>::Leaky g_shutdown_notifier_factory = base::LazyInstance<CefPrintingMessageFilterShutdownNotifierFactory>::Leaky
g_printing_message_filter_shutdown_notifier_factory =
LAZY_INSTANCE_INITIALIZER; LAZY_INSTANCE_INITIALIZER;
// static // static
ShutdownNotifierFactory* ShutdownNotifierFactory::GetInstance() { CefPrintingMessageFilterShutdownNotifierFactory*
return g_shutdown_notifier_factory.Pointer(); CefPrintingMessageFilterShutdownNotifierFactory::GetInstance() {
return g_printing_message_filter_shutdown_notifier_factory.Pointer();
} }
} // namespace } // namespace
@ -76,18 +72,18 @@ CefPrintingMessageFilter::CefPrintingMessageFilter(int render_process_id,
queue_(g_browser_process->print_job_manager()->queue()) { queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_.get()); DCHECK(queue_.get());
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
shutdown_notifier_ = printing_shutdown_notifier_ =
ShutdownNotifierFactory::GetInstance()->Get(profile)->Subscribe( CefPrintingMessageFilterShutdownNotifierFactory::GetInstance()
base::Bind(&CefPrintingMessageFilter::ShutdownOnUIThread, ->Get(profile)
->Subscribe(base::Bind(&CefPrintingMessageFilter::ShutdownOnUIThread,
base::Unretained(this))); base::Unretained(this)));
is_printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs()); is_printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
is_printing_enabled_.MoveToThread( is_printing_enabled_.MoveToThread(
content::BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); content::BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
} }
void CefPrintingMessageFilter::EnsureShutdownNotifierFactoryBuilt() { void CefPrintingMessageFilter::EnsureShutdownNotifierFactoryBuilt() {
ShutdownNotifierFactory::GetInstance(); CefPrintingMessageFilterShutdownNotifierFactory::GetInstance();
} }
CefPrintingMessageFilter::~CefPrintingMessageFilter() { CefPrintingMessageFilter::~CefPrintingMessageFilter() {
@ -95,8 +91,9 @@ CefPrintingMessageFilter::~CefPrintingMessageFilter() {
} }
void CefPrintingMessageFilter::ShutdownOnUIThread() { void CefPrintingMessageFilter::ShutdownOnUIThread() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
is_printing_enabled_.Destroy(); is_printing_enabled_.Destroy();
shutdown_notifier_.reset(); printing_shutdown_notifier_.reset();
} }
void CefPrintingMessageFilter::OverrideThreadForMessage( void CefPrintingMessageFilter::OverrideThreadForMessage(
@ -249,14 +246,8 @@ void CefPrintingMessageFilter::OnUpdatePrintSettings(
} }
printer_query = queue_->PopPrinterQuery(document_cookie); printer_query = queue_->PopPrinterQuery(document_cookie);
if (!printer_query.get()) { if (!printer_query.get()) {
int host_id; printer_query = queue_->CreatePrinterQuery(
int routing_id; content::ChildProcessHost::kInvalidUniqueID, MSG_ROUTING_NONE);
if (!new_settings->GetInteger(kPreviewInitiatorHostId, &host_id) ||
!new_settings->GetInteger(kPreviewInitiatorRoutingId, &routing_id)) {
host_id = content::ChildProcessHost::kInvalidUniqueID;
routing_id = MSG_ROUTING_NONE;
}
printer_query = queue_->CreatePrinterQuery(host_id, routing_id);
} }
printer_query->SetSettings( printer_query->SetSettings(
std::move(new_settings), std::move(new_settings),
@ -276,7 +267,6 @@ void CefPrintingMessageFilter::OnUpdatePrintSettingsReply(
params.params.document_cookie = printer_query->cookie(); params.params.document_cookie = printer_query->cookie();
params.pages = PageRange::GetPages(printer_query->settings().ranges()); params.pages = PageRange::GetPages(printer_query->settings().ranges());
} }
bool canceled = printer_query.get() && bool canceled = printer_query.get() &&
(printer_query->last_status() == PrintingContext::CANCEL); (printer_query->last_status() == PrintingContext::CANCEL);
PrintHostMsg_UpdatePrintSettings::WriteReplyParams(reply_msg, params, PrintHostMsg_UpdatePrintSettings::WriteReplyParams(reply_msg, params,

View File

@ -78,15 +78,15 @@ class CefPrintingMessageFilter : public content::BrowserMessageFilter {
int preview_request_id, int preview_request_id,
bool* cancel); bool* cancel);
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
printing_shutdown_notifier_;
BooleanPrefMember is_printing_enabled_; BooleanPrefMember is_printing_enabled_;
const int render_process_id_; const int render_process_id_;
scoped_refptr<PrintQueriesQueue> queue_; scoped_refptr<PrintQueriesQueue> queue_;
std::unique_ptr<KeyedServiceShutdownNotifier::Subscription>
shutdown_notifier_;
DISALLOW_COPY_AND_ASSIGN(CefPrintingMessageFilter); DISALLOW_COPY_AND_ASSIGN(CefPrintingMessageFilter);
}; };

View File

@ -23,7 +23,6 @@
#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_frame_host.h"
#include "content/public/browser/resource_request_info.h" #include "content/public/browser/resource_request_info.h"
#include "content/public/browser/stream_info.h" #include "content/public/browser/stream_info.h"
#include "content/public/common/resource_response.h"
#include "content/public/common/webplugininfo.h" #include "content/public/common/webplugininfo.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
@ -180,7 +179,7 @@ void CefResourceDispatcherHostDelegate::OnRequestRedirected(
const GURL& redirect_url, const GURL& redirect_url,
net::URLRequest* request, net::URLRequest* request,
content::ResourceContext* resource_context, content::ResourceContext* resource_context,
content::ResourceResponse* response) { network::ResourceResponse* response) {
const GURL& active_url = request->url(); const GURL& active_url = request->url();
if (active_url.is_valid() && redirect_url.is_valid() && if (active_url.is_valid() && redirect_url.is_valid() &&
active_url.GetOrigin() != redirect_url.GetOrigin() && active_url.GetOrigin() != redirect_url.GetOrigin() &&

View File

@ -33,7 +33,7 @@ class CefResourceDispatcherHostDelegate
void OnRequestRedirected(const GURL& redirect_url, void OnRequestRedirected(const GURL& redirect_url,
net::URLRequest* request, net::URLRequest* request,
content::ResourceContext* resource_context, content::ResourceContext* resource_context,
content::ResourceResponse* response) override; network::ResourceResponse* response) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore( std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
content::ResourceContext* resource_context) override; content::ResourceContext* resource_context) override;

View File

@ -20,9 +20,7 @@ CertPolicy::~CertPolicy() {}
bool CertPolicy::Check(const net::X509Certificate& cert, bool CertPolicy::Check(const net::X509Certificate& cert,
net::CertStatus error) const { net::CertStatus error) const {
net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256(); net::SHA256HashValue fingerprint = cert.CalculateChainFingerprint256();
std::map<net::SHA256HashValue, net::CertStatus, const auto& allowed_iter = allowed_.find(fingerprint);
net::SHA256HashValueLessThan>::const_iterator allowed_iter =
allowed_.find(fingerprint);
if ((allowed_iter != allowed_.end()) && (allowed_iter->second & error) && if ((allowed_iter != allowed_.end()) && (allowed_iter->second & error) &&
((allowed_iter->second & error) == error)) { ((allowed_iter->second & error) == error)) {
return true; return true;

View File

@ -37,8 +37,7 @@ class CertPolicy {
private: private:
// The set of fingerprints of allowed certificates. // The set of fingerprints of allowed certificates.
std::map<net::SHA256HashValue, net::CertStatus, net::SHA256HashValueLessThan> std::map<net::SHA256HashValue, net::CertStatus> allowed_;
allowed_;
}; };
} // namespace internal } // namespace internal

View File

@ -26,15 +26,20 @@ CefStoragePartitionProxy::GetMediaURLRequestContext() {
return GetURLRequestContext(); return GetURLRequestContext();
} }
content::mojom::NetworkContext* CefStoragePartitionProxy::GetNetworkContext() { network::mojom::NetworkContext* CefStoragePartitionProxy::GetNetworkContext() {
return parent_->GetNetworkContext(); return parent_->GetNetworkContext();
} }
content::mojom::URLLoaderFactory* network::mojom::URLLoaderFactory*
CefStoragePartitionProxy::GetURLLoaderFactoryForBrowserProcess() { CefStoragePartitionProxy::GetURLLoaderFactoryForBrowserProcess() {
return parent_->GetURLLoaderFactoryForBrowserProcess(); return parent_->GetURLLoaderFactoryForBrowserProcess();
} }
network::mojom::CookieManager*
CefStoragePartitionProxy::GetCookieManagerForBrowserProcess() {
return parent_->GetCookieManagerForBrowserProcess();
}
storage::QuotaManager* CefStoragePartitionProxy::GetQuotaManager() { storage::QuotaManager* CefStoragePartitionProxy::GetQuotaManager() {
return parent_->GetQuotaManager(); return parent_->GetQuotaManager();
} }
@ -55,6 +60,10 @@ content::DOMStorageContext* CefStoragePartitionProxy::GetDOMStorageContext() {
return parent_->GetDOMStorageContext(); return parent_->GetDOMStorageContext();
} }
content::LockManager* CefStoragePartitionProxy::GetLockManager() {
return parent_->GetLockManager();
}
content::IndexedDBContext* CefStoragePartitionProxy::GetIndexedDBContext() { content::IndexedDBContext* CefStoragePartitionProxy::GetIndexedDBContext() {
return parent_->GetIndexedDBContext(); return parent_->GetIndexedDBContext();
} }
@ -64,6 +73,11 @@ CefStoragePartitionProxy::GetServiceWorkerContext() {
return parent_->GetServiceWorkerContext(); return parent_->GetServiceWorkerContext();
} }
content::SharedWorkerService*
CefStoragePartitionProxy::GetSharedWorkerService() {
return parent_->GetSharedWorkerService();
}
content::CacheStorageContext* content::CacheStorageContext*
CefStoragePartitionProxy::GetCacheStorageContext() { CefStoragePartitionProxy::GetCacheStorageContext() {
return parent_->GetCacheStorageContext(); return parent_->GetCacheStorageContext();
@ -87,47 +101,12 @@ CefStoragePartitionProxy::GetPlatformNotificationContext() {
return parent_->GetPlatformNotificationContext(); return parent_->GetPlatformNotificationContext();
} }
content::BackgroundFetchContext*
CefStoragePartitionProxy::GetBackgroundFetchContext() {
return parent_->GetBackgroundFetchContext();
}
content::BackgroundSyncContext*
CefStoragePartitionProxy::GetBackgroundSyncContext() {
return parent_->GetBackgroundSyncContext();
}
content::PaymentAppContextImpl*
CefStoragePartitionProxy::GetPaymentAppContext() {
return parent_->GetPaymentAppContext();
}
content::BroadcastChannelProvider*
CefStoragePartitionProxy::GetBroadcastChannelProvider() {
return parent_->GetBroadcastChannelProvider();
}
content::BluetoothAllowedDevicesMap*
CefStoragePartitionProxy::GetBluetoothAllowedDevicesMap() {
return parent_->GetBluetoothAllowedDevicesMap();
}
content::BlobURLLoaderFactory*
CefStoragePartitionProxy::GetBlobURLLoaderFactory() {
return parent_->GetBlobURLLoaderFactory();
}
content::BlobRegistryWrapper* CefStoragePartitionProxy::GetBlobRegistry() {
return parent_->GetBlobRegistry();
}
void CefStoragePartitionProxy::ClearDataForOrigin( void CefStoragePartitionProxy::ClearDataForOrigin(
uint32_t remove_mask, uint32_t remove_mask,
uint32_t quota_storage_remove_mask, uint32_t quota_storage_remove_mask,
const GURL& storage_origin, const GURL& storage_origin) {
net::URLRequestContextGetter* rq_context) {
parent_->ClearDataForOrigin(remove_mask, quota_storage_remove_mask, parent_->ClearDataForOrigin(remove_mask, quota_storage_remove_mask,
storage_origin, rq_context); storage_origin);
} }
void CefStoragePartitionProxy::ClearData( void CefStoragePartitionProxy::ClearData(
@ -171,9 +150,42 @@ void CefStoragePartitionProxy::ClearBluetoothAllowedDevicesMapForTesting() {
parent_->ClearBluetoothAllowedDevicesMapForTesting(); parent_->ClearBluetoothAllowedDevicesMapForTesting();
} }
void CefStoragePartitionProxy::SetNetworkFactoryForTesting( void CefStoragePartitionProxy::FlushNetworkInterfaceForTesting() {
content::mojom::URLLoaderFactory* test_factory) { parent_->FlushNetworkInterfaceForTesting();
parent_->SetNetworkFactoryForTesting(test_factory); }
content::BackgroundFetchContext*
CefStoragePartitionProxy::GetBackgroundFetchContext() {
return parent_->GetBackgroundFetchContext();
}
content::BackgroundSyncContext*
CefStoragePartitionProxy::GetBackgroundSyncContext() {
return parent_->GetBackgroundSyncContext();
}
content::PaymentAppContextImpl*
CefStoragePartitionProxy::GetPaymentAppContext() {
return parent_->GetPaymentAppContext();
}
content::BroadcastChannelProvider*
CefStoragePartitionProxy::GetBroadcastChannelProvider() {
return parent_->GetBroadcastChannelProvider();
}
content::BluetoothAllowedDevicesMap*
CefStoragePartitionProxy::GetBluetoothAllowedDevicesMap() {
return parent_->GetBluetoothAllowedDevicesMap();
}
content::BlobURLLoaderFactory*
CefStoragePartitionProxy::GetBlobURLLoaderFactory() {
return parent_->GetBlobURLLoaderFactory();
}
content::BlobRegistryWrapper* CefStoragePartitionProxy::GetBlobRegistry() {
return parent_->GetBlobRegistry();
} }
content::URLLoaderFactoryGetter* content::URLLoaderFactoryGetter*
@ -190,3 +202,12 @@ mojo::BindingId CefStoragePartitionProxy::Bind(
mojo::InterfaceRequest<content::mojom::StoragePartitionService> request) { mojo::InterfaceRequest<content::mojom::StoragePartitionService> request) {
return parent_->Bind(process_id, std::move(request)); return parent_->Bind(process_id, std::move(request));
} }
void CefStoragePartitionProxy::set_site_for_service_worker(
const GURL& site_for_service_worker) {
parent_->set_site_for_service_worker(site_for_service_worker);
}
const GURL& CefStoragePartitionProxy::site_for_service_worker() const {
return parent_->site_for_service_worker();
}

View File

@ -24,33 +24,28 @@ class CefStoragePartitionProxy : public content::StoragePartition {
base::FilePath GetPath() override; base::FilePath GetPath() override;
net::URLRequestContextGetter* GetURLRequestContext() override; net::URLRequestContextGetter* GetURLRequestContext() override;
net::URLRequestContextGetter* GetMediaURLRequestContext() override; net::URLRequestContextGetter* GetMediaURLRequestContext() override;
content::mojom::NetworkContext* GetNetworkContext() override; network::mojom::NetworkContext* GetNetworkContext() override;
content::mojom::URLLoaderFactory* GetURLLoaderFactoryForBrowserProcess() network::mojom::URLLoaderFactory* GetURLLoaderFactoryForBrowserProcess()
override; override;
network::mojom::CookieManager* GetCookieManagerForBrowserProcess() override;
storage::QuotaManager* GetQuotaManager() override; storage::QuotaManager* GetQuotaManager() override;
content::AppCacheService* GetAppCacheService() override; content::AppCacheService* GetAppCacheService() override;
storage::FileSystemContext* GetFileSystemContext() override; storage::FileSystemContext* GetFileSystemContext() override;
storage::DatabaseTracker* GetDatabaseTracker() override; storage::DatabaseTracker* GetDatabaseTracker() override;
content::DOMStorageContext* GetDOMStorageContext() override; content::DOMStorageContext* GetDOMStorageContext() override;
content::LockManager* GetLockManager() override;
content::IndexedDBContext* GetIndexedDBContext() override; content::IndexedDBContext* GetIndexedDBContext() override;
content::ServiceWorkerContext* GetServiceWorkerContext() override; content::ServiceWorkerContext* GetServiceWorkerContext() override;
content::SharedWorkerService* GetSharedWorkerService() override;
content::CacheStorageContext* GetCacheStorageContext() override; content::CacheStorageContext* GetCacheStorageContext() override;
content::HostZoomMap* GetHostZoomMap() override; content::HostZoomMap* GetHostZoomMap() override;
content::HostZoomLevelContext* GetHostZoomLevelContext() override; content::HostZoomLevelContext* GetHostZoomLevelContext() override;
content::ZoomLevelDelegate* GetZoomLevelDelegate() override; content::ZoomLevelDelegate* GetZoomLevelDelegate() override;
content::PlatformNotificationContext* GetPlatformNotificationContext() content::PlatformNotificationContext* GetPlatformNotificationContext()
override; override;
content::BackgroundFetchContext* GetBackgroundFetchContext() override;
content::BackgroundSyncContext* GetBackgroundSyncContext() override;
content::PaymentAppContextImpl* GetPaymentAppContext() override;
content::BroadcastChannelProvider* GetBroadcastChannelProvider() override;
content::BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
content::BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
content::BlobRegistryWrapper* GetBlobRegistry() override;
void ClearDataForOrigin(uint32_t remove_mask, void ClearDataForOrigin(uint32_t remove_mask,
uint32_t quota_storage_remove_mask, uint32_t quota_storage_remove_mask,
const GURL& storage_origin, const GURL& storage_origin) override;
net::URLRequestContextGetter* rq_context) override;
void ClearData(uint32_t remove_mask, void ClearData(uint32_t remove_mask,
uint32_t quota_storage_remove_mask, uint32_t quota_storage_remove_mask,
const GURL& storage_origin, const GURL& storage_origin,
@ -72,14 +67,23 @@ class CefStoragePartitionProxy : public content::StoragePartition {
base::OnceClosure callback) override; base::OnceClosure callback) override;
void Flush() override; void Flush() override;
void ClearBluetoothAllowedDevicesMapForTesting() override; void ClearBluetoothAllowedDevicesMapForTesting() override;
void SetNetworkFactoryForTesting( void FlushNetworkInterfaceForTesting() override;
content::mojom::URLLoaderFactory* test_factory) override; content::BackgroundFetchContext* GetBackgroundFetchContext() override;
content::BackgroundSyncContext* GetBackgroundSyncContext() override;
content::PaymentAppContextImpl* GetPaymentAppContext() override;
content::BroadcastChannelProvider* GetBroadcastChannelProvider() override;
content::BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
content::BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
content::BlobRegistryWrapper* GetBlobRegistry() override;
content::URLLoaderFactoryGetter* url_loader_factory_getter() override; content::URLLoaderFactoryGetter* url_loader_factory_getter() override;
content::BrowserContext* browser_context() const override; content::BrowserContext* browser_context() const override;
mojo::BindingId Bind( mojo::BindingId Bind(
int process_id, int process_id,
mojo::InterfaceRequest<content::mojom::StoragePartitionService> request) mojo::InterfaceRequest<content::mojom::StoragePartitionService> request)
override; override;
void set_site_for_service_worker(
const GURL& site_for_service_worker) override;
const GURL& site_for_service_worker() const override;
content::StoragePartition* parent() const { return parent_; } content::StoragePartition* parent() const { return parent_; }

View File

@ -57,7 +57,7 @@ class CefLayoutImpl : public CefLayoutAdapter, public CefLayoutClass {
owner_view_ = owner_view; owner_view_ = owner_view;
layout_ref_ = CreateLayout(); layout_ref_ = CreateLayout();
DCHECK(layout_ref_); DCHECK(layout_ref_);
owner_view->SetLayoutManager(layout_ref_); owner_view->SetLayoutManager(base::WrapUnique(layout_ref_));
layout_util::Assign(this, owner_view); layout_util::Assign(this, owner_view);
} }

View File

@ -7,22 +7,23 @@
#include "libcef/browser/x509_cert_principal_impl.h" #include "libcef/browser/x509_cert_principal_impl.h"
#include "libcef/common/time_util.h" #include "libcef/common/time_util.h"
#include "net/cert/x509_util.h"
#include "net/ssl/ssl_private_key.h" #include "net/ssl/ssl_private_key.h"
namespace { namespace {
CefRefPtr<CefBinaryValue> EncodeCertificate( CefRefPtr<CefBinaryValue> EncodeCertificate(const CRYPTO_BUFFER* cert_buffer,
const net::X509Certificate::OSCertHandle& os_handle,
bool der) { bool der) {
CefRefPtr<CefBinaryValue> bin_encoded;
std::string encoded; std::string encoded;
if (der) {
if ((der && net::X509Certificate::GetDEREncoded(os_handle, &encoded)) || encoded =
(!der && net::X509Certificate::GetPEMEncoded(os_handle, &encoded))) { std::string(net::x509_util::CryptoBufferAsStringPiece(cert_buffer));
bin_encoded = CefBinaryValue::Create(encoded.c_str(), encoded.size()); } else if (!net::X509Certificate::GetPEMEncoded(cert_buffer, &encoded)) {
return nullptr;
} }
if (encoded.empty())
return bin_encoded; return nullptr;
return CefBinaryValue::Create(encoded.c_str(), encoded.size());
} }
} // namespace } // namespace
@ -77,25 +78,25 @@ CefTime CefX509CertificateImpl::GetValidExpiry() {
CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetDEREncoded() { CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetDEREncoded() {
if (cert_) { if (cert_) {
net::X509Certificate::OSCertHandle os_handle = cert_->os_cert_handle(); const CRYPTO_BUFFER* cert_buffer = cert_->cert_buffer();
if (os_handle) if (cert_buffer)
return EncodeCertificate(os_handle, true); return EncodeCertificate(cert_buffer, true);
} }
return nullptr; return nullptr;
} }
CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetPEMEncoded() { CefRefPtr<CefBinaryValue> CefX509CertificateImpl::GetPEMEncoded() {
if (cert_) { if (cert_) {
net::X509Certificate::OSCertHandle os_handle = cert_->os_cert_handle(); const CRYPTO_BUFFER* cert_buffer = cert_->cert_buffer();
if (os_handle) if (cert_buffer)
return EncodeCertificate(os_handle, false); return EncodeCertificate(cert_buffer, false);
} }
return nullptr; return nullptr;
} }
size_t CefX509CertificateImpl::GetIssuerChainSize() { size_t CefX509CertificateImpl::GetIssuerChainSize() {
if (cert_) if (cert_)
return cert_->GetIntermediateCertificates().size(); return cert_->intermediate_buffers().size();
return 0; return 0;
} }
@ -113,14 +114,10 @@ void CefX509CertificateImpl::GetEncodedIssuerChain(
bool der) { bool der) {
chain.clear(); chain.clear();
if (cert_) { if (cert_) {
const net::X509Certificate::OSCertHandles& handles = for (const auto& it : cert_->intermediate_buffers()) {
cert_->GetIntermediateCertificates();
for (net::X509Certificate::OSCertHandles::const_iterator it =
handles.begin();
it != handles.end(); it++) {
// Add each to the chain, even if one conversion unexpectedly failed. // Add each to the chain, even if one conversion unexpectedly failed.
// GetIssuerChainSize depends on these being the same length. // GetIssuerChainSize depends on these being the same length.
chain.push_back(EncodeCertificate(*it, der)); chain.push_back(EncodeCertificate(it.get(), der));
} }
} }
} }

View File

@ -4,6 +4,7 @@
#include "libcef/common/cef_crash_report_upload_thread.h" #include "libcef/common/cef_crash_report_upload_thread.h"
#include "libcef/common/cef_crash_report_utils.h"
#include "third_party/crashpad/crashpad/client/settings.h" #include "third_party/crashpad/crashpad/client/settings.h"
using namespace crashpad; using namespace crashpad;
@ -159,6 +160,11 @@ void CefCrashReportUploadThread::ProcessPendingReport(
} }
} }
CrashReportUploadThread::ParameterMap
CefCrashReportUploadThread::FilterParameters(const ParameterMap& parameters) {
return crash_report_utils::FilterParameters(parameters);
}
bool CefCrashReportUploadThread::UploadsEnabled() const { bool CefCrashReportUploadThread::UploadsEnabled() const {
Settings* const settings = database_->GetSettings(); Settings* const settings = database_->GetSettings();
bool uploads_enabled; bool uploads_enabled;

View File

@ -19,6 +19,7 @@ class CefCrashReportUploadThread : public crashpad::CrashReportUploadThread {
void ProcessPendingReports() override; void ProcessPendingReports() override;
void ProcessPendingReport( void ProcessPendingReport(
const crashpad::CrashReportDatabase::Report& report) override; const crashpad::CrashReportDatabase::Report& report) override;
ParameterMap FilterParameters(const ParameterMap& parameters) override;
bool UploadsEnabled() const; bool UploadsEnabled() const;

View File

@ -0,0 +1,57 @@
// Copyright 2018 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "libcef/common/cef_crash_report_utils.h"
#include "base/strings/string_split.h"
namespace crash_report_utils {
ParameterMap FilterParameters(const ParameterMap& parameters) {
ParameterMap in_map = parameters;
// Extract the key map, if any. Must match the logic in
// CefCrashReporterClient::ReadCrashConfigFile.
std::string key_map;
for (size_t i = 0; true; ++i) {
const std::string& key = "K-" + std::string(1, 'A' + i);
ParameterMap::iterator it = in_map.find(key);
if (it == in_map.end())
break;
key_map += it->second;
in_map.erase(it);
}
if (key_map.empty()) {
// Nothing to substitute.
return parameters;
}
// Parse |key_map|.
base::StringPairs kv_pairs;
if (!base::SplitStringIntoKeyValuePairs(key_map, '=', ',', &kv_pairs)) {
return parameters;
}
ParameterMap subs;
for (const auto& pairs : kv_pairs) {
subs.insert(std::make_pair(pairs.first, pairs.second));
}
ParameterMap out_map;
// Perform key substitutions.
for (const auto& params : in_map) {
std::string key = params.first;
ParameterMap::const_iterator subs_it = subs.find(params.first);
if (subs_it != subs.end()) {
key = subs_it->second;
}
out_map.insert(std::make_pair(key, params.second));
}
return out_map;
}
} // namespace crash_report_utils

View File

@ -0,0 +1,19 @@
// Copyright 2018 The Chromium Embedded Framework Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CEF_LIBCEF_COMMON_CEF_CRASH_REPORT_UTILS_H_
#define CEF_LIBCEF_COMMON_CEF_CRASH_REPORT_UTILS_H_
#include <map>
#include <string>
namespace crash_report_utils {
using ParameterMap = std::map<std::string, std::string>;
ParameterMap FilterParameters(const ParameterMap& parameters);
} // namespace crash_report_utils
#endif // CEF_LIBCEF_COMMON_CEF_CRASH_REPORT_UTILS_H_

View File

@ -15,9 +15,9 @@
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/common/crash_keys.h" #include "components/crash/core/common/crash_key.h"
#include "third_party/crashpad/crashpad/client/annotation.h"
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
#include "libcef/common/util_mac.h" #include "libcef/common/util_mac.h"
@ -37,6 +37,7 @@
#if defined(OS_POSIX) && !defined(OS_MACOSX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "libcef/common/cef_crash_report_utils.h"
#endif #endif
#if defined(OS_WIN) #if defined(OS_WIN)
@ -227,27 +228,39 @@ CefCrashReporterClient* g_crash_reporter_client = nullptr;
#endif // defined(OS_WIN) #endif // defined(OS_WIN)
const char kKeyMapDelim = ',';
std::string NormalizeCrashKey(const base::StringPiece& key) {
std::string str = key.as_string();
std::replace(str.begin(), str.end(), kKeyMapDelim, '-');
if (str.length() > crashpad::Annotation::kNameMaxLength) {
return str.substr(0, crashpad::Annotation::kNameMaxLength);
}
return str;
}
} // namespace } // namespace
#if defined(OS_WIN) #if defined(OS_WIN)
extern "C" { extern "C" {
// Export functions from chrome_elf that are required by // Export functions from chrome_elf that are required by crash_reporting.cc
// crash_reporting_win::InitializeCrashReportingForModule().
size_t __declspec(dllexport) __cdecl GetCrashKeyCountImpl() { int __declspec(dllexport) __cdecl SetCrashKeyValueImpl(const char* key,
if (!g_crash_reporter_client) size_t key_size,
const char* value,
size_t value_size) {
if (g_crash_reporter_client) {
return g_crash_reporter_client->SetCrashKeyValue(
base::StringPiece(key, key_size), base::StringPiece(value, value_size));
}
return 0; return 0;
return g_crash_reporter_client->GetCrashKeyCount();
} }
bool __declspec(dllexport) __cdecl GetCrashKeyImpl(size_t index, int __declspec(dllexport) __cdecl IsCrashReportingEnabledImpl() {
const char** key_name, return g_crash_reporter_client &&
size_t* max_length) { g_crash_reporter_client->HasCrashConfigFile();
if (!g_crash_reporter_client)
return false;
return g_crash_reporter_client->GetCrashKey(index, key_name, max_length);
} }
} // extern "C" } // extern "C"
@ -330,6 +343,11 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
char line[1000]; char line[1000];
size_t small_index = 0;
size_t medium_index = 0;
size_t large_index = 0;
std::string map_keys;
enum section { enum section {
kNoSection, kNoSection,
kConfigSection, kConfigSection,
@ -413,34 +431,71 @@ bool CefCrashReporterClient::ReadCrashConfigFile() {
} }
#endif #endif
} else if (current_section == kCrashKeysSection) { } else if (current_section == kCrashKeysSection) {
size_t max_size = 0; // Skip duplicate definitions.
if (val_str == "small") if (!crash_keys_.empty() &&
max_size = crash_keys::kSmallSize; crash_keys_.find(name_str) != crash_keys_.end()) {
else if (val_str == "medium")
max_size = crash_keys::kMediumSize;
else if (val_str == "large")
max_size = crash_keys::kLargeSize;
if (max_size == 0)
continue; continue;
}
crash_keys_.push_back({name_str, max_size}); KeySize size;
size_t index;
char group;
if (val_str == "small") {
size = SMALL_SIZE;
index = small_index++;
group = 'S';
} else if (val_str == "medium") {
size = MEDIUM_SIZE;
index = medium_index++;
group = 'M';
} else if (val_str == "large") {
size = LARGE_SIZE;
index = large_index++;
group = 'L';
} else {
continue;
}
name_str = NormalizeCrashKey(name_str);
crash_keys_.insert(std::make_pair(name_str, std::make_pair(size, index)));
const std::string& key =
std::string(1, group) + "-" + std::string(1, 'A' + index);
if (!map_keys.empty()) {
map_keys.append(std::string(1, kKeyMapDelim));
}
map_keys.append(key + "=" + name_str);
} }
} }
fclose(fp); fclose(fp);
// Add the list of potential crash keys from chrome, content and other layers. if (!map_keys.empty()) {
// Do it here so that they're also exported to the libcef module for Windows. // Split |map_keys| across multiple Annotations if necessary.
{ // Must match the logic in crash_report_utils::FilterParameters.
std::vector<base::debug::CrashKey> keys; using IDKey =
crash_keys::GetChromeCrashKeys(keys); crash_reporter::CrashKeyString<crashpad::Annotation::kValueMaxSize>;
static IDKey ids[] = {
{"K-A", IDKey::Tag::kArray},
{"K-B", IDKey::Tag::kArray},
{"K-C", IDKey::Tag::kArray},
};
if (!keys.empty()) { // Make sure we can fit all possible name/value pairs.
crash_keys_.reserve(crash_keys_.size() + keys.size()); static_assert(arraysize(ids) * crashpad::Annotation::kValueMaxSize >=
for (const auto& key : keys) { 3 * 26 /* sizes (small, medium, large) * slots (A to Z) */
crash_keys_.push_back({key.key_name, key.max_length}); * (3 + 2 /* key size ("S-A") + delim size ("=,") */
} + crashpad::Annotation::kNameMaxLength),
"Not enough storage for key map");
size_t offset = 0;
for (size_t i = 0; i < arraysize(ids); ++i) {
size_t length = std::min(map_keys.size() - offset,
crashpad::Annotation::kValueMaxSize);
ids[i].Set(base::StringPiece(map_keys.data() + offset, length));
offset += length;
if (offset >= map_keys.size())
break;
} }
} }
@ -575,20 +630,6 @@ bool CefCrashReporterClient::ReportingIsEnforcedByPolicy(
} }
#endif #endif
size_t CefCrashReporterClient::RegisterCrashKeys() {
std::vector<base::debug::CrashKey> keys;
if (!crash_keys_.empty()) {
keys.reserve(crash_keys_.size());
for (const auto& key : crash_keys_) {
keys.push_back({key.key_name_.c_str(), key.max_length_});
}
}
return base::debug::InitCrashKeys(&keys[0], keys.size(),
crash_keys::kChunkMaxLength);
}
#if defined(OS_POSIX) && !defined(OS_MACOSX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
bool CefCrashReporterClient::IsRunningUnattended() { bool CefCrashReporterClient::IsRunningUnattended() {
// Crash upload will only be enabled with Breakpad on Linux if this method // Crash upload will only be enabled with Breakpad on Linux if this method
@ -597,24 +638,6 @@ bool CefCrashReporterClient::IsRunningUnattended() {
} }
#endif #endif
#if defined(OS_WIN)
size_t CefCrashReporterClient::GetCrashKeyCount() const {
return crash_keys_.size();
}
bool CefCrashReporterClient::GetCrashKey(size_t index,
const char** key_name,
size_t* max_length) const {
if (index >= crash_keys_.size())
return false;
const auto& key = crash_keys_[index];
*key_name = key.key_name_.c_str();
*max_length = key.max_length_;
return true;
}
#endif // defined(OS_WIN)
std::string CefCrashReporterClient::GetCrashServerURL() { std::string CefCrashReporterClient::GetCrashServerURL() {
return server_url_; return server_url_;
} }
@ -665,3 +688,77 @@ bool CefCrashReporterClient::EnableBrowserCrashForwarding() {
return enable_browser_crash_forwarding_; return enable_browser_crash_forwarding_;
} }
#endif #endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
CefCrashReporterClient::ParameterMap CefCrashReporterClient::FilterParameters(
const ParameterMap& parameters) {
return crash_report_utils::FilterParameters(parameters);
}
#endif
// The new Crashpad Annotation API requires that annotations be declared using
// static storage. We work around this limitation by defining a fixed amount of
// storage for each key size and later substituting the actual key name during
// crash dump processing.
#define IDKEY(name) \
{ name, IDKey::Tag::kArray }
#define IDKEY_ENTRIES(n) \
IDKEY(n "-A"), IDKEY(n "-B"), IDKEY(n "-C"), IDKEY(n "-D"), IDKEY(n "-E"), \
IDKEY(n "-F"), IDKEY(n "-G"), IDKEY(n "-H"), IDKEY(n "-I"), \
IDKEY(n "-J"), IDKEY(n "-K"), IDKEY(n "-L"), IDKEY(n "-M"), \
IDKEY(n "-N"), IDKEY(n "-O"), IDKEY(n "-P"), IDKEY(n "-Q"), \
IDKEY(n "-R"), IDKEY(n "-S"), IDKEY(n "-T"), IDKEY(n "-U"), \
IDKEY(n "-V"), IDKEY(n "-W"), IDKEY(n "-X"), IDKEY(n "-Y"), \
IDKEY(n "-Z")
#define IDKEY_FUNCTION(name, size) \
static_assert(size <= crashpad::Annotation::kValueMaxSize, \
"Annotation size is too large."); \
bool Set##name##Annotation(size_t index, const base::StringPiece& value) { \
using IDKey = crash_reporter::CrashKeyString<size>; \
static IDKey ids[] = {IDKEY_ENTRIES(#name)}; \
if (index < arraysize(ids)) { \
if (value.empty()) { \
ids[index].Clear(); \
} else { \
ids[index].Set(value); \
} \
return true; \
} \
return false; \
}
// The first argument must be kept synchronized with the logic in
// CefCrashReporterClient::ReadCrashConfigFile and
// crash_report_utils::FilterParameters.
IDKEY_FUNCTION(S, 64)
IDKEY_FUNCTION(M, 256)
IDKEY_FUNCTION(L, 1024)
bool CefCrashReporterClient::SetCrashKeyValue(const base::StringPiece& key,
const base::StringPiece& value) {
if (key.empty() || crash_keys_.empty())
return false;
KeyMap::const_iterator it = crash_keys_.find(NormalizeCrashKey(key));
if (it == crash_keys_.end())
return false;
const KeySize size = it->second.first;
const size_t index = it->second.second;
base::AutoLock lock_scope(crash_key_lock_);
switch (size) {
case SMALL_SIZE:
return SetSAnnotation(index, value);
case MEDIUM_SIZE:
return SetMAnnotation(index, value);
case LARGE_SIZE:
return SetLAnnotation(index, value);
}
return false;
}

View File

@ -14,6 +14,7 @@
#include "include/cef_version.h" #include "include/cef_version.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/synchronization/lock.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "components/crash/content/app/crash_reporter_client.h" #include "components/crash/content/app/crash_reporter_client.h"
@ -66,19 +67,10 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
bool ReportingIsEnforcedByPolicy(bool* crashpad_enabled) override; bool ReportingIsEnforcedByPolicy(bool* crashpad_enabled) override;
#endif #endif
size_t RegisterCrashKeys() override;
#if defined(OS_POSIX) && !defined(OS_MACOSX) #if defined(OS_POSIX) && !defined(OS_MACOSX)
bool IsRunningUnattended() override; bool IsRunningUnattended() override;
#endif #endif
#if defined(OS_WIN)
size_t GetCrashKeyCount() const;
bool GetCrashKey(size_t index,
const char** key_name,
size_t* max_length) const;
#endif
std::string GetCrashServerURL() override; std::string GetCrashServerURL() override;
void GetCrashOptionalArguments(std::vector<std::string>* arguments) override; void GetCrashOptionalArguments(std::vector<std::string>* arguments) override;
@ -92,16 +84,27 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
bool EnableBrowserCrashForwarding() override; bool EnableBrowserCrashForwarding() override;
#endif #endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
ParameterMap FilterParameters(const ParameterMap& parameters) override;
#endif
// Set or clear a crash key value.
bool SetCrashKeyValue(const base::StringPiece& key,
const base::StringPiece& value);
private: private:
bool has_crash_config_file_ = false; bool has_crash_config_file_ = false;
// Values that will persist until the end of the program. enum KeySize { SMALL_SIZE, MEDIUM_SIZE, LARGE_SIZE };
// Matches the members of base::debug::CrashKey.
struct StoredCrashKey { // Map of crash key name to (KeySize, index).
std::string key_name_; // Const access to |crash_keys_| is thread-safe after initialization.
size_t max_length_; using KeyMap = std::map<std::string, std::pair<KeySize, size_t>>;
}; KeyMap crash_keys_;
std::vector<StoredCrashKey> crash_keys_;
// Modification of CrashKeyString values must be synchronized.
base::Lock crash_key_lock_;
std::string server_url_; std::string server_url_;
bool rate_limit_ = true; bool rate_limit_ = true;
int max_uploads_ = 5; int max_uploads_ = 5;

View File

@ -10,9 +10,11 @@
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/crash_logging.h" #include "base/debug/crash_logging.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chrome/common/crash_keys.h" #include "chrome/common/crash_keys.h"
#include "components/crash/core/common/crash_key.h" #include "components/crash/core/common/crash_key.h"
#include "components/crash/core/common/crash_keys.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
@ -32,14 +34,55 @@
#include "v8/include/v8.h" #include "v8/include/v8.h"
#endif #endif
#if defined(OS_WIN)
#include "libcef/common/crash_reporting_win.h"
#endif
namespace crash_reporting { namespace crash_reporting {
namespace { namespace {
#if defined(OS_WIN)
const base::FilePath::CharType kChromeElfDllName[] =
FILE_PATH_LITERAL("chrome_elf.dll");
// exported in crash_reporter_client.cc:
// int __declspec(dllexport) __cdecl SetCrashKeyValueImpl.
typedef int(__cdecl* SetCrashKeyValue)(const char*,
size_t,
const char*,
size_t);
// int __declspec(dllexport) __cdecl IsCrashReportingEnabledImpl.
typedef int(__cdecl* IsCrashReportingEnabled)();
bool SetCrashKeyValueTrampoline(const base::StringPiece& key,
const base::StringPiece& value) {
static SetCrashKeyValue set_crash_key = []() {
HMODULE elf_module = GetModuleHandle(kChromeElfDllName);
return reinterpret_cast<SetCrashKeyValue>(
elf_module ? GetProcAddress(elf_module, "SetCrashKeyValueImpl")
: nullptr);
}();
if (set_crash_key) {
return !!(set_crash_key)(key.data(), key.size(), value.data(),
value.size());
}
return false;
}
bool IsCrashReportingEnabledTrampoline() {
static IsCrashReportingEnabled is_crash_reporting_enabled = []() {
HMODULE elf_module = GetModuleHandle(kChromeElfDllName);
return reinterpret_cast<IsCrashReportingEnabled>(
elf_module ? GetProcAddress(elf_module, "IsCrashReportingEnabledImpl")
: nullptr);
}();
if (is_crash_reporting_enabled) {
return !!(is_crash_reporting_enabled)();
}
return false;
}
#endif // defined(OS_WIN)
bool g_crash_reporting_enabled = false; bool g_crash_reporting_enabled = false;
#if defined(OS_POSIX) #if defined(OS_POSIX)
@ -109,7 +152,8 @@ bool IsBoringCEFSwitch(const std::string& flag) {
// Chromium internals. // Chromium internals.
"content-image-texture-target", "mojo-platform-channel-handle", "content-image-texture-target", "mojo-platform-channel-handle",
"primordial-pipe-token", "service-request-channel-token", "primordial-pipe-token", "service-pipe-token",
"service-request-channel-token",
}; };
if (!base::StartsWith(flag, "--", base::CompareCase::SENSITIVE)) if (!base::StartsWith(flag, "--", base::CompareCase::SENSITIVE))
@ -130,6 +174,18 @@ bool Enabled() {
return g_crash_reporting_enabled; return g_crash_reporting_enabled;
} }
bool SetCrashKeyValue(const base::StringPiece& key,
const base::StringPiece& value) {
if (!g_crash_reporting_enabled)
return false;
#if defined(OS_WIN)
return SetCrashKeyValueTrampoline(key, value);
#else
return g_crash_reporter_client.Pointer()->SetCrashKeyValue(key, value);
#endif
}
#if defined(OS_POSIX) #if defined(OS_POSIX)
// Be aware that logging is not initialized at the time this method is called. // Be aware that logging is not initialized at the time this method is called.
void BasicStartupComplete(base::CommandLine* command_line) { void BasicStartupComplete(base::CommandLine* command_line) {
@ -152,9 +208,7 @@ void PreSandboxStartup(const base::CommandLine& command_line,
// Windows is initialized from context.cc. // Windows is initialized from context.cc.
InitCrashReporter(command_line, process_type); InitCrashReporter(command_line, process_type);
#elif defined(OS_WIN) #elif defined(OS_WIN)
// Initialize crash key globals in the module (libcef) address space. g_crash_reporting_enabled = IsCrashReportingEnabledTrampoline();
g_crash_reporting_enabled =
crash_reporting_win::InitializeCrashReportingForModule();
#endif #endif
if (g_crash_reporting_enabled) { if (g_crash_reporting_enabled) {
@ -196,5 +250,8 @@ bool CefCrashReportingEnabled() {
} }
void CefSetCrashKeyValue(const CefString& key, const CefString& value) { void CefSetCrashKeyValue(const CefString& key, const CefString& value) {
base::debug::SetCrashKeyValue(key.ToString(), value.ToString()); if (!crash_reporting::SetCrashKeyValue(key.ToString(), value.ToString())) {
LOG(WARNING) << "Failed to set crash key: " << key.ToString()
<< " with value: " << value.ToString();
}
} }

View File

@ -4,6 +4,7 @@
#include <string> #include <string>
#include "base/strings/string_piece_forward.h"
#include "build/build_config.h" #include "build/build_config.h"
namespace base { namespace base {
@ -15,6 +16,10 @@ namespace crash_reporting {
// Returns true if crash reporting is enabled. // Returns true if crash reporting is enabled.
bool Enabled(); bool Enabled();
// Set or clear a crash key value.
bool SetCrashKeyValue(const base::StringPiece& key,
const base::StringPiece& value);
// Functions are called from similarly named methods in CefMainDelegate. // Functions are called from similarly named methods in CefMainDelegate.
#if defined(OS_POSIX) #if defined(OS_POSIX)

View File

@ -1,121 +0,0 @@
// Copyright 2016 The Chromium Embedded Framework Authors. Portions copyright
// 2016 The Chromium Authors. All rights reserved. Use of this source code is
// governed by a BSD-style license that can be found in the LICENSE file.
#include <windows.h>
#include "libcef/common/crash_reporting_win.h"
#include "base/debug/crash_logging.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/common/chrome_constants.h"
#include "components/crash/core/common/crash_keys.h"
namespace crash_reporting_win {
namespace {
const base::FilePath::CharType kChromeElfDllName[] =
FILE_PATH_LITERAL("chrome_elf.dll");
// exported in crash_reporter_client.cc:
// size_t __declspec(dllexport) __cdecl GetCrashKeyCountImpl.
typedef size_t(__cdecl* GetCrashKeyCount)();
// exported in crash_reporter_client.cc:
// bool __declspec(dllexport) __cdecl GetCrashKeyImpl.
typedef bool(__cdecl* GetCrashKey)(size_t, const char**, size_t*);
size_t GetCrashKeyCountTrampoline() {
static GetCrashKeyCount get_crash_key_count = []() {
HMODULE elf_module = GetModuleHandle(kChromeElfDllName);
return reinterpret_cast<GetCrashKeyCount>(
elf_module ? GetProcAddress(elf_module, "GetCrashKeyCountImpl")
: nullptr);
}();
if (get_crash_key_count) {
return (get_crash_key_count)();
}
return 0;
}
bool GetCrashKeyTrampoline(size_t index,
const char** key_name,
size_t* max_length) {
static GetCrashKey get_crash_key = []() {
HMODULE elf_module = GetModuleHandle(kChromeElfDllName);
return reinterpret_cast<GetCrashKey>(
elf_module ? GetProcAddress(elf_module, "GetCrashKeyImpl") : nullptr);
}();
if (get_crash_key) {
return (get_crash_key)(index, key_name, max_length);
}
return false;
}
// From chrome/common/child_process_logging_win.cc:
// exported in breakpad_win.cc/crashpad_win.cc:
// void __declspec(dllexport) __cdecl SetCrashKeyValueImpl.
typedef void(__cdecl* SetCrashKeyValue)(const wchar_t*, const wchar_t*);
// exported in breakpad_win.cc/crashpad_win.cc:
// void __declspec(dllexport) __cdecl ClearCrashKeyValueImpl.
typedef void(__cdecl* ClearCrashKeyValue)(const wchar_t*);
void SetCrashKeyValueTrampoline(const base::StringPiece& key,
const base::StringPiece& value) {
static SetCrashKeyValue set_crash_key = []() {
HMODULE elf_module = GetModuleHandle(kChromeElfDllName);
return reinterpret_cast<SetCrashKeyValue>(
elf_module ? GetProcAddress(elf_module, "SetCrashKeyValueImpl")
: nullptr);
}();
if (set_crash_key) {
(set_crash_key)(base::UTF8ToWide(key).data(),
base::UTF8ToWide(value).data());
}
}
void ClearCrashKeyValueTrampoline(const base::StringPiece& key) {
static ClearCrashKeyValue clear_crash_key = []() {
HMODULE elf_module = GetModuleHandle(kChromeElfDllName);
return reinterpret_cast<ClearCrashKeyValue>(
elf_module ? GetProcAddress(elf_module, "ClearCrashKeyValueImpl")
: nullptr);
}();
if (clear_crash_key)
(clear_crash_key)(base::UTF8ToWide(key).data());
}
} // namespace
bool InitializeCrashReportingForModule() {
base::debug::SetCrashKeyReportingFunctions(&SetCrashKeyValueTrampoline,
&ClearCrashKeyValueTrampoline);
std::vector<base::debug::CrashKey> keys;
size_t key_ct = GetCrashKeyCountTrampoline();
if (key_ct > 0U) {
keys.reserve(key_ct);
const char* key_name;
size_t max_length;
for (size_t i = 0; i < key_ct; ++i) {
if (GetCrashKeyTrampoline(i, &key_name, &max_length))
keys.push_back({key_name, max_length});
}
}
if (!keys.empty()) {
base::debug::InitCrashKeys(&keys[0], keys.size(),
crash_keys::kChunkMaxLength);
return true;
}
return false;
}
} // namespace crash_reporting_win

View File

@ -1,11 +0,0 @@
// Copyright 2016 The Chromium Embedded Framework Authors. Portions copyright
// 2016 The Chromium Authors. All rights reserved. Use of this source code is
// governed by a BSD-style license that can be found in the LICENSE file.
namespace crash_reporting_win {
// Called from libcef to initialize crash key globals. Retrieves the necessary
// state from chrome_elf via exported functions.
bool InitializeCrashReportingForModule();
} // namespace crash_reporting_win

View File

@ -29,6 +29,7 @@
#include "components/content_settings/core/common/content_settings_pattern.h" #include "components/content_settings/core/common/content_settings_pattern.h"
#include "content/public/browser/browser_main_runner.h" #include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "content/public/common/main_function_params.h" #include "content/public/common/main_function_params.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
@ -435,6 +436,21 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
switches::kUncaughtExceptionStackSize, switches::kUncaughtExceptionStackSize,
base::IntToString(settings.uncaught_exception_stack_size)); base::IntToString(settings.uncaught_exception_stack_size));
} }
// Disable AsyncWheelEvents when OSR is enabled to avoid DCHECKs in
// MouseWheelEventQueue.
if (settings.windowless_rendering_enabled &&
features::kAsyncWheelEvents.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
DCHECK(!base::FeatureList::GetInstance());
std::string disable_features =
command_line->GetSwitchValueASCII(switches::kDisableFeatures);
if (!disable_features.empty())
disable_features += ",";
disable_features += features::kAsyncWheelEvents.name;
command_line->AppendSwitchASCII(switches::kDisableFeatures,
disable_features);
}
} }
if (content_client_.application().get()) { if (content_client_.application().get()) {

View File

@ -33,6 +33,7 @@
#include "net/http/http_util.h" #include "net/http/http_util.h"
#include "net/url_request/url_fetcher.h" #include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#include "services/network/public/cpp/network_switches.h"
#include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURL.h" #include "third_party/WebKit/public/platform/WebURL.h"
#include "third_party/WebKit/public/platform/WebURLError.h" #include "third_party/WebKit/public/platform/WebURLError.h"
@ -99,7 +100,7 @@ class FileElementReader : public net::UploadFileElementReader {
std::string GetURLRequestReferrer(const GURL& referrer_url) { std::string GetURLRequestReferrer(const GURL& referrer_url) {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (!referrer_url.is_valid() || if (!referrer_url.is_valid() ||
command_line->HasSwitch(switches::kNoReferrers)) { command_line->HasSwitch(network::switches::kNoReferrers)) {
return std::string(); return std::string();
} }
@ -559,6 +560,7 @@ void CefRequestImpl::Get(blink::WebURLRequest& request,
void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params, void CefRequestImpl::Get(const CefMsg_LoadRequest_Params& params,
blink::WebURLRequest& request) { blink::WebURLRequest& request) {
request.SetURL(params.url); request.SetURL(params.url);
request.SetRequestorOrigin(blink::WebSecurityOrigin::Create(params.url));
if (!params.method.empty()) if (!params.method.empty())
request.SetHTTPMethod(blink::WebString::FromASCII(params.method)); request.SetHTTPMethod(blink::WebString::FromASCII(params.method));

View File

@ -11,6 +11,7 @@
] ]
}, },
"requires": { "requires": {
"chrome_printing": [ "converter" ],
"proxy_resolver": [ "factory" ] "proxy_resolver": [ "factory" ]
} }
}, },

View File

@ -24,19 +24,19 @@ CefRefPtr<CefValue> CefValueImpl::GetOrCreateRefOrCopy(
CefValueController* controller) { CefValueController* controller) {
DCHECK(value); DCHECK(value);
if (value->IsType(base::Value::Type::BINARY)) { if (value->is_blob()) {
return new CefValueImpl( return new CefValueImpl(
CefBinaryValueImpl::GetOrCreateRef(value, parent_value, controller)); CefBinaryValueImpl::GetOrCreateRef(value, parent_value, controller));
} }
if (value->IsType(base::Value::Type::DICTIONARY)) { if (value->is_dict()) {
base::DictionaryValue* dict_value = base::DictionaryValue* dict_value =
static_cast<base::DictionaryValue*>(value); static_cast<base::DictionaryValue*>(value);
return new CefValueImpl(CefDictionaryValueImpl::GetOrCreateRef( return new CefValueImpl(CefDictionaryValueImpl::GetOrCreateRef(
dict_value, parent_value, read_only, controller)); dict_value, parent_value, read_only, controller));
} }
if (value->IsType(base::Value::Type::LIST)) { if (value->is_list()) {
base::ListValue* list_value = static_cast<base::ListValue*>(value); base::ListValue* list_value = static_cast<base::ListValue*>(value);
return new CefValueImpl(CefListValueImpl::GetOrCreateRef( return new CefValueImpl(CefListValueImpl::GetOrCreateRef(
list_value, parent_value, read_only, controller)); list_value, parent_value, read_only, controller));
@ -825,7 +825,7 @@ CefRefPtr<CefBinaryValue> CefDictionaryValueImpl::GetBinary(
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
out_value->IsType(base::Value::Type::BINARY)) { out_value->is_blob()) {
base::Value* binary_value = const_cast<base::Value*>(out_value); base::Value* binary_value = const_cast<base::Value*>(out_value);
return CefBinaryValueImpl::GetOrCreateRef( return CefBinaryValueImpl::GetOrCreateRef(
binary_value, const_cast<base::DictionaryValue*>(&const_value()), binary_value, const_cast<base::DictionaryValue*>(&const_value()),
@ -843,7 +843,7 @@ CefRefPtr<CefDictionaryValue> CefDictionaryValueImpl::GetDictionary(
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
out_value->IsType(base::Value::Type::DICTIONARY)) { out_value->is_dict()) {
base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>( base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>(
const_cast<base::Value*>(out_value)); const_cast<base::Value*>(out_value));
return CefDictionaryValueImpl::GetOrCreateRef( return CefDictionaryValueImpl::GetOrCreateRef(
@ -861,7 +861,7 @@ CefRefPtr<CefListValue> CefDictionaryValueImpl::GetList(const CefString& key) {
if (const_value().GetWithoutPathExpansion(base::StringPiece(key), if (const_value().GetWithoutPathExpansion(base::StringPiece(key),
&out_value) && &out_value) &&
out_value->IsType(base::Value::Type::LIST)) { out_value->is_list()) {
base::ListValue* list_value = base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value)); static_cast<base::ListValue*>(const_cast<base::Value*>(out_value));
return CefListValueImpl::GetOrCreateRef( return CefListValueImpl::GetOrCreateRef(
@ -962,8 +962,7 @@ bool CefDictionaryValueImpl::RemoveInternal(const CefString& key) {
controller()->Remove(out_value.get(), true); controller()->Remove(out_value.get(), true);
// Only list and dictionary types may have dependencies. // Only list and dictionary types may have dependencies.
if (out_value->IsType(base::Value::Type::LIST) || if (out_value->is_list() || out_value->is_dict()) {
out_value->IsType(base::Value::Type::DICTIONARY)) {
controller()->RemoveDependencies(out_value.get()); controller()->RemoveDependencies(out_value.get());
} }
@ -1230,8 +1229,7 @@ CefRefPtr<CefBinaryValue> CefListValueImpl::GetBinary(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value) && if (const_value().Get(index, &out_value) && out_value->is_blob()) {
out_value->IsType(base::Value::Type::BINARY)) {
base::Value* binary_value = const_cast<base::Value*>(out_value); base::Value* binary_value = const_cast<base::Value*>(out_value);
return CefBinaryValueImpl::GetOrCreateRef( return CefBinaryValueImpl::GetOrCreateRef(
binary_value, const_cast<base::ListValue*>(&const_value()), binary_value, const_cast<base::ListValue*>(&const_value()),
@ -1246,8 +1244,7 @@ CefRefPtr<CefDictionaryValue> CefListValueImpl::GetDictionary(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value) && if (const_value().Get(index, &out_value) && out_value->is_dict()) {
out_value->IsType(base::Value::Type::DICTIONARY)) {
base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>( base::DictionaryValue* dict_value = static_cast<base::DictionaryValue*>(
const_cast<base::Value*>(out_value)); const_cast<base::Value*>(out_value));
return CefDictionaryValueImpl::GetOrCreateRef( return CefDictionaryValueImpl::GetOrCreateRef(
@ -1263,8 +1260,7 @@ CefRefPtr<CefListValue> CefListValueImpl::GetList(size_t index) {
const base::Value* out_value = NULL; const base::Value* out_value = NULL;
if (const_value().Get(index, &out_value) && if (const_value().Get(index, &out_value) && out_value->is_list()) {
out_value->IsType(base::Value::Type::LIST)) {
base::ListValue* list_value = base::ListValue* list_value =
static_cast<base::ListValue*>(const_cast<base::Value*>(out_value)); static_cast<base::ListValue*>(const_cast<base::Value*>(out_value));
return CefListValueImpl::GetOrCreateRef( return CefListValueImpl::GetOrCreateRef(
@ -1368,8 +1364,7 @@ bool CefListValueImpl::RemoveInternal(size_t index) {
controller()->Remove(const_cast<base::Value*>(actual_value), true); controller()->Remove(const_cast<base::Value*>(actual_value), true);
// Only list and dictionary types may have dependencies. // Only list and dictionary types may have dependencies.
if (out_value->IsType(base::Value::Type::LIST) || if (out_value->is_list() || out_value->is_dict()) {
out_value->IsType(base::Value::Type::DICTIONARY)) {
controller()->RemoveDependencies(const_cast<base::Value*>(actual_value)); controller()->RemoveDependencies(const_cast<base::Value*>(actual_value));
} }

View File

@ -16,6 +16,7 @@
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/native_library.h" #include "base/native_library.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_piece.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/common/widevine_cdm_constants.h" #include "chrome/common/widevine_cdm_constants.h"
@ -63,9 +64,7 @@ const char kCdmVersionName[] = "version";
// All values are strings. // All values are strings.
// All values that are lists are delimited by commas. No trailing commas. // All values that are lists are delimited by commas. No trailing commas.
// For example, "1,2,4". // For example, "1,2,4".
const char kCdmValueDelimiter = ','; const char kCdmValueDelimiter[] = ",";
static_assert(kCdmValueDelimiter == kCdmSupportedCodecsValueDelimiter,
"cdm delimiters must match");
// The following entries are required. // The following entries are required.
// Interface versions are lists of integers (e.g. "1" or "1,2,4"). // Interface versions are lists of integers (e.g. "1" or "1,2,4").
// These are checked in this file before registering the CDM. // These are checked in this file before registering the CDM.
@ -80,6 +79,17 @@ const char kCdmHostVersionsName[] = "x-cdm-host-versions";
// The codecs list is a list of simple codec names (e.g. "vp8,vorbis"). // The codecs list is a list of simple codec names (e.g. "vp8,vorbis").
// The list is passed to other parts of Chrome. // The list is passed to other parts of Chrome.
const char kCdmCodecsListName[] = "x-cdm-codecs"; const char kCdmCodecsListName[] = "x-cdm-codecs";
// Whether persistent license is supported by the CDM: "true" or "false".
const char kCdmPersistentLicenseSupportName[] =
"x-cdm-persistent-license-support";
// The following strings are used to specify supported codecs in the
// parameter |kCdmCodecsListName|.
const char kCdmSupportedCodecVp8[] = "vp8";
const char kCdmSupportedCodecVp9[] = "vp9.0";
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
const char kCdmSupportedCodecAvc1[] = "avc1";
#endif
std::unique_ptr<base::DictionaryValue> ParseManifestFile( std::unique_ptr<base::DictionaryValue> ParseManifestFile(
const base::FilePath& manifest_path) { const base::FilePath& manifest_path) {
@ -95,7 +105,7 @@ std::unique_ptr<base::DictionaryValue> ParseManifestFile(
JSONStringValueDeserializer deserializer(manifest_contents); JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); std::unique_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL));
if (!manifest.get() || !manifest->IsType(base::Value::Type::DICTIONARY)) if (!manifest.get() || !manifest->is_dict())
return nullptr; return nullptr;
// Transfer ownership to the caller. // Transfer ownership to the caller.
@ -129,8 +139,8 @@ bool CheckForCompatibleVersion(const base::DictionaryValue& manifest,
if (versions_string.empty()) if (versions_string.empty())
return false; return false;
for (const base::StringPiece& ver_str : base::SplitStringPiece( for (const base::StringPiece& ver_str :
versions_string, std::string(1, kCdmValueDelimiter), base::SplitStringPiece(versions_string, kCdmValueDelimiter,
base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) { base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL)) {
int version = 0; int version = 0;
if (base::StringToInt(ver_str, &version)) if (base::StringToInt(ver_str, &version))
@ -169,6 +179,7 @@ void GetPluginInfo(const base::FilePath& cdm_adapter_path,
const base::FilePath& cdm_path, const base::FilePath& cdm_path,
const std::string& cdm_version, const std::string& cdm_version,
const std::string& cdm_codecs, const std::string& cdm_codecs,
bool supports_persistent_license,
content::PepperPluginInfo* widevine_cdm) { content::PepperPluginInfo* widevine_cdm) {
widevine_cdm->is_out_of_process = true; widevine_cdm->is_out_of_process = true;
widevine_cdm->path = cdm_adapter_path; widevine_cdm->path = cdm_adapter_path;
@ -180,11 +191,6 @@ void GetPluginInfo(const base::FilePath& cdm_adapter_path,
kWidevineCdmPluginMimeType, kWidevineCdmPluginExtension, kWidevineCdmPluginMimeType, kWidevineCdmPluginExtension,
kWidevineCdmPluginMimeTypeDescription); kWidevineCdmPluginMimeTypeDescription);
widevine_cdm_mime_type.additional_params.emplace_back(
content::WebPluginMimeType::Param(
base::ASCIIToUTF16(kCdmSupportedCodecsParamName),
base::ASCIIToUTF16(cdm_codecs)));
widevine_cdm->mime_types.push_back(widevine_cdm_mime_type); widevine_cdm->mime_types.push_back(widevine_cdm_mime_type);
widevine_cdm->permissions = kWidevineCdmPluginPermissions; widevine_cdm->permissions = kWidevineCdmPluginPermissions;
} }
@ -196,6 +202,7 @@ cef_cdm_registration_error_t LoadWidevineCdmInfo(
base::FilePath* cdm_path, base::FilePath* cdm_path,
std::string* cdm_version, std::string* cdm_version,
std::string* cdm_codecs, std::string* cdm_codecs,
bool* supports_persistent_license,
std::string* error_message) { std::string* error_message) {
std::stringstream ss; std::stringstream ss;
@ -240,6 +247,10 @@ cef_cdm_registration_error_t LoadWidevineCdmInfo(
if (cdm_codecs->empty()) if (cdm_codecs->empty())
return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS; return CEF_CDM_REGISTRATION_ERROR_INCORRECT_CONTENTS;
const base::Value* value =
manifest->FindKey(kCdmPersistentLicenseSupportName);
*supports_persistent_license = value && value->is_bool() && value->GetBool();
return CEF_CDM_REGISTRATION_ERROR_NONE; return CEF_CDM_REGISTRATION_ERROR_NONE;
} }
@ -255,16 +266,37 @@ void DeliverWidevineCdmCallback(cef_cdm_registration_error_t result,
callback->OnCdmRegistrationComplete(result, error_message); callback->OnCdmRegistrationComplete(result, error_message);
} }
std::vector<media::VideoCodec> ConvertCodecsString(const std::string& codecs) {
std::vector<media::VideoCodec> supported_video_codecs;
const std::vector<base::StringPiece> supported_codecs =
base::SplitStringPiece(codecs, kCdmValueDelimiter, base::TRIM_WHITESPACE,
base::SPLIT_WANT_NONEMPTY);
for (const auto& codec : supported_codecs) {
if (codec == kCdmSupportedCodecVp8)
supported_video_codecs.push_back(media::VideoCodec::kCodecVP8);
else if (codec == kCdmSupportedCodecVp9)
supported_video_codecs.push_back(media::VideoCodec::kCodecVP9);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
else if (codec == kCdmSupportedCodecAvc1)
supported_video_codecs.push_back(media::VideoCodec::kCodecH264);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
}
return supported_video_codecs;
}
void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path, void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path,
const base::FilePath& cdm_path, const base::FilePath& cdm_path,
const std::string& cdm_version, const std::string& cdm_version,
const std::string& cdm_codecs, const std::string& cdm_codecs,
bool supports_persistent_license,
CefRefPtr<CefRegisterCdmCallback> callback) { CefRefPtr<CefRegisterCdmCallback> callback) {
CEF_REQUIRE_UIT(); CEF_REQUIRE_UIT();
content::PepperPluginInfo widevine_cdm; content::PepperPluginInfo widevine_cdm;
GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs, GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs,
&widevine_cdm); supports_persistent_license, &widevine_cdm);
// true = Add to beginning of list to override any existing registrations. // true = Add to beginning of list to override any existing registrations.
content::PluginService::GetInstance()->RegisterInternalPlugin( content::PluginService::GetInstance()->RegisterInternalPlugin(
@ -275,12 +307,12 @@ void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path,
content::PluginService::GetInstance()->PurgePluginListCache(NULL, false); content::PluginService::GetInstance()->PurgePluginListCache(NULL, false);
// Also register Widevine with the CdmRegistry. // Also register Widevine with the CdmRegistry.
const std::vector<std::string> codecs = base::SplitString( std::vector<media::VideoCodec> supported_video_codecs =
cdm_codecs, std::string(1, kCdmSupportedCodecsValueDelimiter), ConvertCodecsString(cdm_codecs);
base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
content::CdmRegistry::GetInstance()->RegisterCdm(content::CdmInfo( content::CdmRegistry::GetInstance()->RegisterCdm(content::CdmInfo(
kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(cdm_version), kWidevineCdmDisplayName, kWidevineCdmGuid, base::Version(cdm_version),
cdm_path, kWidevineCdmFileSystemId, codecs, kWidevineKeySystem, false)); cdm_path, kWidevineCdmFileSystemId, supported_video_codecs,
supports_persistent_license, kWidevineKeySystem, false));
DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(), DeliverWidevineCdmCallback(CEF_CDM_REGISTRATION_ERROR_NONE, std::string(),
callback); callback);
@ -295,10 +327,11 @@ void LoadWidevineCdmInfoOnFileThread(
base::FilePath cdm_path; base::FilePath cdm_path;
std::string cdm_version; std::string cdm_version;
std::string cdm_codecs; std::string cdm_codecs;
bool supports_persistent_license;
std::string error_message; std::string error_message;
cef_cdm_registration_error_t result = cef_cdm_registration_error_t result = LoadWidevineCdmInfo(
LoadWidevineCdmInfo(base_path, &cdm_adapter_path, &cdm_path, &cdm_version, base_path, &cdm_adapter_path, &cdm_path, &cdm_version, &cdm_codecs,
&cdm_codecs, &error_message); &supports_persistent_license, &error_message);
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) { if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result, CEF_POST_TASK(CEF_UIT, base::Bind(DeliverWidevineCdmCallback, result,
error_message, callback)); error_message, callback));
@ -308,7 +341,8 @@ void LoadWidevineCdmInfoOnFileThread(
// Continue execution on the UI thread. // Continue execution on the UI thread.
CEF_POST_TASK(CEF_UIT, CEF_POST_TASK(CEF_UIT,
base::Bind(RegisterWidevineCdmOnUIThread, cdm_adapter_path, base::Bind(RegisterWidevineCdmOnUIThread, cdm_adapter_path,
cdm_path, cdm_version, cdm_codecs, callback)); cdm_path, cdm_version, cdm_codecs,
supports_persistent_license, callback));
} }
} // namespace } // namespace
@ -374,10 +408,11 @@ void CefWidevineLoader::AddPepperPlugins(
base::FilePath cdm_path; base::FilePath cdm_path;
std::string cdm_version; std::string cdm_version;
std::string cdm_codecs; std::string cdm_codecs;
bool supports_persistent_license;
std::string error_message; std::string error_message;
cef_cdm_registration_error_t result = cef_cdm_registration_error_t result = LoadWidevineCdmInfo(
LoadWidevineCdmInfo(base_path, &cdm_adapter_path, &cdm_path, &cdm_version, base_path, &cdm_adapter_path, &cdm_path, &cdm_version, &cdm_codecs,
&cdm_codecs, &error_message); &supports_persistent_license, &error_message);
if (result != CEF_CDM_REGISTRATION_ERROR_NONE) { if (result != CEF_CDM_REGISTRATION_ERROR_NONE) {
LOG(ERROR) << "Widevine CDM registration failed; " << error_message; LOG(ERROR) << "Widevine CDM registration failed; " << error_message;
return; return;
@ -385,7 +420,7 @@ void CefWidevineLoader::AddPepperPlugins(
content::PepperPluginInfo widevine_cdm; content::PepperPluginInfo widevine_cdm;
GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs, GetPluginInfo(cdm_adapter_path, cdm_path, cdm_version, cdm_codecs,
&widevine_cdm); supports_persistent_license, &widevine_cdm);
plugins->push_back(widevine_cdm); plugins->push_back(widevine_cdm);
} }

View File

@ -444,16 +444,7 @@ void CefContentRendererClient::RenderFrameCreated(
const base::CommandLine* command_line = const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess(); base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) { if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
SpellCheckProvider* spell_check_provider =
new SpellCheckProvider(render_frame, spellcheck_.get(), this); new SpellCheckProvider(render_frame, spellcheck_.get(), this);
// TODO(xiaochengh): Design better way to sync between Chrome-side and
// Blink-side spellcheck enabled states. See crbug.com/710097.
//
// TODO(alexmos): Do this for all frames so that this works properly for
// OOPIFs. See https://crbug.com/789273.
if (render_frame->IsMainFrame())
spell_check_provider->EnableSpellcheck(
spellcheck_->IsSpellcheckEnabled());
} }
BrowserCreated(render_frame->GetRenderView(), render_frame); BrowserCreated(render_frame->GetRenderView(), render_frame);
@ -515,7 +506,6 @@ bool CefContentRendererClient::WillSendRequest(
blink::WebLocalFrame* frame, blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles,
GURL* new_url) { GURL* new_url) {
if (extensions::ExtensionsEnabled()) { if (extensions::ExtensionsEnabled()) {
return extensions_renderer_client_->WillSendRequest(frame, transition_type, return extensions_renderer_client_->WillSendRequest(frame, transition_type,
@ -569,16 +559,12 @@ void CefContentRendererClient::RunScriptsAtDocumentIdle(
extensions_renderer_client_->RunScriptsAtDocumentIdle(render_frame); extensions_renderer_client_->RunScriptsAtDocumentIdle(render_frame);
} }
void CefContentRendererClient::DevToolsAgentAttached( void CefContentRendererClient::DevToolsAgentAttached() {
content::RenderFrame* render_frame,
int session_id) {
CEF_REQUIRE_RT(); CEF_REQUIRE_RT();
++devtools_agent_count_; ++devtools_agent_count_;
} }
void CefContentRendererClient::DevToolsAgentDetached( void CefContentRendererClient::DevToolsAgentDetached() {
content::RenderFrame* render_frame,
int session_id) {
CEF_REQUIRE_RT(); CEF_REQUIRE_RT();
--devtools_agent_count_; --devtools_agent_count_;
if (devtools_agent_count_ == 0 && uncaught_exception_stack_size_ > 0) { if (devtools_agent_count_ == 0 && uncaught_exception_stack_size_ > 0) {

View File

@ -110,11 +110,9 @@ class CefContentRendererClient : public content::ContentRendererClient,
bool is_initial_navigation, bool is_initial_navigation,
bool is_server_redirect, bool is_server_redirect,
bool* send_referrer) override; bool* send_referrer) override;
bool WillSendRequest( bool WillSendRequest(blink::WebLocalFrame* frame,
blink::WebLocalFrame* frame,
ui::PageTransition transition_type, ui::PageTransition transition_type,
const blink::WebURL& url, const blink::WebURL& url,
std::vector<std::unique_ptr<content::URLLoaderThrottle>>* throttles,
GURL* new_url) override; GURL* new_url) override;
unsigned long long VisitedLinkHash(const char* canonical_url, unsigned long long VisitedLinkHash(const char* canonical_url,
size_t length) override; size_t length) override;
@ -129,10 +127,8 @@ class CefContentRendererClient : public content::ContentRendererClient,
void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentStart(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentEnd(content::RenderFrame* render_frame) override;
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override; void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override;
void DevToolsAgentAttached(content::RenderFrame* render_frame, void DevToolsAgentAttached() override;
int session_id) override; void DevToolsAgentDetached() override;
void DevToolsAgentDetached(content::RenderFrame* render_frame,
int session_id) override;
// service_manager::LocalInterfaceProvider implementation. // service_manager::LocalInterfaceProvider implementation.
void GetInterface(const std::string& name, void GetInterface(const std::string& name,

View File

@ -9,8 +9,8 @@
#include "libcef/renderer/render_thread_observer.h" #include "libcef/renderer/render_thread_observer.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "chrome/common/extensions/extension_process_policy.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "chrome/renderer/extensions/extension_process_policy.h"
#include "chrome/renderer/extensions/resource_request_policy.h" #include "chrome/renderer/extensions/resource_request_policy.h"
#include "content/public/common/content_constants.h" #include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"

View File

@ -46,7 +46,8 @@ class CefWebURLLoaderClient : public blink::WebURLLoaderClient {
void DidFinishLoading(double finish_time, void DidFinishLoading(double finish_time,
int64_t total_encoded_data_length, int64_t total_encoded_data_length,
int64_t total_encoded_body_length, int64_t total_encoded_body_length,
int64_t total_decoded_body_length) override; int64_t total_decoded_body_length,
bool blocked_cross_site_document) override;
void DidFail(const WebURLError&, void DidFail(const WebURLError&,
int64_t total_encoded_data_length, int64_t total_encoded_data_length,
int64_t total_encoded_body_length, int64_t total_encoded_body_length,
@ -261,11 +262,11 @@ void CefWebURLLoaderClient::DidReceiveData(const char* data, int dataLength) {
context_->OnDownloadData(data, dataLength); context_->OnDownloadData(data, dataLength);
} }
void CefWebURLLoaderClient::DidFinishLoading( void CefWebURLLoaderClient::DidFinishLoading(double finishTime,
double finishTime,
int64_t total_encoded_data_length, int64_t total_encoded_data_length,
int64_t total_encoded_body_length, int64_t total_encoded_body_length,
int64_t total_decoded_body_length) { int64_t total_decoded_body_length,
bool blocked_cross_site_document) {
context_->OnComplete(); context_->OnComplete();
} }

View File

@ -9,6 +9,7 @@
MSVC_PUSH_WARNING_LEVEL(0); MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/WebKit/public/platform/WebString.h" #include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebURLResponse.h"
#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDocument.h"
#include "third_party/WebKit/public/web/WebElement.h" #include "third_party/WebKit/public/web/WebElement.h"
#include "third_party/WebKit/public/web/WebNode.h" #include "third_party/WebKit/public/web/WebNode.h"
@ -26,6 +27,7 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h" #include "third_party/WebKit/Source/core/frame/WebLocalFrameImpl.h"
#include "third_party/WebKit/Source/platform/bindings/ScriptForbiddenScope.h" #include "third_party/WebKit/Source/platform/bindings/ScriptForbiddenScope.h"
#include "third_party/WebKit/Source/platform/bindings/V8Binding.h" #include "third_party/WebKit/Source/platform/bindings/V8Binding.h"
#include "third_party/WebKit/Source/platform/loader/fetch/ResourceResponse.h"
#include "third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h" #include "third_party/WebKit/Source/platform/weborigin/SchemeRegistry.h"
MSVC_POP_WARNING(); MSVC_POP_WARNING();
#undef LOG #undef LOG
@ -160,6 +162,7 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
const blink::ScriptSourceCode ssc = blink::ScriptSourceCode( const blink::ScriptSourceCode ssc = blink::ScriptSourceCode(
source, blink::ScriptSourceLocationType::kInternal, source, blink::ScriptSourceLocationType::kInternal,
nullptr, /* cache_handler */
blink::KURL(source_url), blink::KURL(source_url),
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line), WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
WTF::OrdinalNumber::FromZeroBasedInt(0))); WTF::OrdinalNumber::FromZeroBasedInt(0)));
@ -175,9 +178,9 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions(); v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
v8::Local<v8::Script> script; v8::Local<v8::Script> script;
if (!blink::V8ScriptRunner::CompileScript(blink::ScriptState::From(context), if (!blink::V8ScriptRunner::CompileScript(
ssc, blink::ScriptFetchOptions(), blink::ScriptState::From(context), ssc, accessControlStatus,
accessControlStatus, v8CacheOptions) v8CacheOptions, blink::ReferrerScriptInfo())
.ToLocal(&script)) { .ToLocal(&script)) {
DCHECK(tryCatch.HasCaught()); DCHECK(tryCatch.HasCaught());
return result; return result;

View File

@ -8,6 +8,8 @@
#include <utility> #include <utility>
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/services/printing/printing_service.h"
#include "chrome/services/printing/public/interfaces/constants.mojom.h"
#include "chrome/utility/utility_message_handler.h" #include "chrome/utility/utility_message_handler.h"
#include "components/printing/service/public/cpp/pdf_compositor_service_factory.h" #include "components/printing/service/public/cpp/pdf_compositor_service_factory.h"
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h" #include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
@ -64,6 +66,14 @@ void CefContentUtilityClient::RegisterServices(StaticServiceMap* services) {
base::Bind(&printing::CreatePdfCompositorService, std::string()); base::Bind(&printing::CreatePdfCompositorService, std::string());
services->emplace(printing::mojom::kServiceName, pdf_compositor_info); services->emplace(printing::mojom::kServiceName, pdf_compositor_info);
{
service_manager::EmbeddedServiceInfo printing_info;
printing_info.factory =
base::Bind(&printing::PrintingService::CreateService);
services->emplace(printing::mojom::kChromePrintingServiceName,
printing_info);
}
service_manager::EmbeddedServiceInfo proxy_resolver_info; service_manager::EmbeddedServiceInfo proxy_resolver_info;
proxy_resolver_info.task_runner = proxy_resolver_info.task_runner =
content::ChildThread::Get()->GetIOTaskRunner(); content::ChildThread::Get()->GetIOTaskRunner();

View File

@ -310,6 +310,8 @@ patches = [
{ {
# Pass is_main_frame to PluginServiceFilter::IsPluginAvailable. # Pass is_main_frame to PluginServiceFilter::IsPluginAvailable.
# https://bitbucket.org/chromiumembedded/cef/issues/2015 # https://bitbucket.org/chromiumembedded/cef/issues/2015
#
# Add ContentRendererClient::DevToolsAgent[Attached|Detached] methods.
'name': 'webkit_plugin_info_2015', 'name': 'webkit_plugin_info_2015',
}, },
{ {
@ -323,9 +325,6 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2256 # https://bitbucket.org/chromiumembedded/cef/issues/2256
# #
# Linux: Fix GTK2 compile errors. # Linux: Fix GTK2 compile errors.
# https://bugs.chromium.org/p/chromium/issues/detail?id=771365#c16
# https://bugs.chromium.org/p/chromium/issues/detail?id=610428#c88
# https://bugs.chromium.org/p/chromium/issues/detail?id=780973#c15
'name': 'linux_build', 'name': 'linux_build',
}, },
{ {
@ -347,20 +346,8 @@ patches = [
'name': 'devtools_product_2300', 'name': 'devtools_product_2300',
}, },
{ {
# macOS: Fix build of widevinecdmadapter.plugin. # Fix DCHECK running OSRTest.DragDropUpdateCursor.
# https://bitbucket.org/chromiumembedded/cef/issues/2314 # https://bugs.chromium.org/p/chromium/issues/detail?id=781966
'name': 'mac_widevine_2314', 'name': 'webkit_pointer_event_781966',
},
{
# Windows: Fix rc.py ico processing and add support for menuitem separators.
# https://bugs.chromium.org/p/chromium/issues/detail?id=792576
# https://bugs.chromium.org/p/chromium/issues/detail?id=792594
# Using 'DEPS' because it must be applied before the `gclient sync` step.
'name': 'DEPS',
},
{
# Fix ReportingServiceProxy mojo binding failure messages.
# https://bugs.chromium.org/p/chromium/issues/detail?id=784518
'name': 'blink_mojo_806477',
}, },
] ]

View File

@ -1,27 +0,0 @@
diff --git build/toolchain/win/rc/linux64/rc.sha1 build/toolchain/win/rc/linux64/rc.sha1
index 76f7627..11440ae 100644
--- build/toolchain/win/rc/linux64/rc.sha1
+++ build/toolchain/win/rc/linux64/rc.sha1
@@ -1 +1 @@
-a6d75f015275c8a65ff855e8b78437dd03a9bb7d
\ No newline at end of file
+e642170ce663c75a44822c3bffb1579068ab6f17
\ No newline at end of file
diff --git build/toolchain/win/rc/mac/rc.sha1 build/toolchain/win/rc/mac/rc.sha1
index 8a817c5..ff0c32e 100644
--- build/toolchain/win/rc/mac/rc.sha1
+++ build/toolchain/win/rc/mac/rc.sha1
@@ -1 +1 @@
-3ccc7a61fc5368e8db33364093e42a92de874a26
\ No newline at end of file
+58489426ecea29e276c94529201bc6a0cc1da027
\ No newline at end of file
diff --git build/toolchain/win/rc/win/rc.exe.sha1 build/toolchain/win/rc/win/rc.exe.sha1
index c74dce41..165e4688 100644
--- build/toolchain/win/rc/win/rc.exe.sha1
+++ build/toolchain/win/rc/win/rc.exe.sha1
@@ -1 +1 @@
-9887dc07d042bf58d20b5557e3f91d18d0254022
\ No newline at end of file
+9de6c3d751b4432a3a7b1cf96f432a21187764e9
\ No newline at end of file

View File

@ -1,52 +0,0 @@
diff --git third_party/WebKit/Source/core/frame/Deprecation.cpp third_party/WebKit/Source/core/frame/Deprecation.cpp
index db80f4a67b11..f3191313f929 100644
--- third_party/WebKit/Source/core/frame/Deprecation.cpp
+++ third_party/WebKit/Source/core/frame/Deprecation.cpp
@@ -16,8 +16,9 @@
#include "core/page/Page.h"
#include "core/workers/WorkerOrWorkletGlobalScope.h"
#include "platform/runtime_enabled_features.h"
+#include "public/platform/Platform.h"
#include "public/platform/reporting.mojom-blink.h"
-#include "services/service_manager/public/cpp/interface_provider.h"
+#include "services/service_manager/public/cpp/connector.h"
#include "third_party/WebKit/common/feature_policy/feature_policy_feature.h"
using blink::WebFeature;
@@ -796,7 +797,9 @@ void Deprecation::GenerateReport(const LocalFrame* frame, WebFeature feature) {
// Send the deprecation report to the Reporting API.
mojom::blink::ReportingServiceProxyPtr service;
- frame->Client()->GetInterfaceProvider()->GetInterface(&service);
+ Platform* platform = Platform::Current();
+ platform->GetConnector()->BindInterface(platform->GetBrowserServiceName(),
+ &service);
service->QueueDeprecationReport(document->Url(), info.message,
body->sourceFile(), body->lineNumber(),
body->columnNumber());
diff --git third_party/WebKit/Source/core/frame/Intervention.cpp third_party/WebKit/Source/core/frame/Intervention.cpp
index fb342ba765db..089eb6a3d662 100644
--- third_party/WebKit/Source/core/frame/Intervention.cpp
+++ third_party/WebKit/Source/core/frame/Intervention.cpp
@@ -11,8 +11,9 @@
#include "core/frame/Report.h"
#include "core/frame/ReportingContext.h"
#include "core/inspector/ConsoleMessage.h"
+#include "public/platform/Platform.h"
#include "public/platform/reporting.mojom-blink.h"
-#include "services/service_manager/public/cpp/interface_provider.h"
+#include "services/service_manager/public/cpp/connector.h"
namespace blink {
@@ -44,7 +45,9 @@ void Intervention::GenerateReport(const LocalFrame* frame,
// Send the intervention report to the Reporting API.
mojom::blink::ReportingServiceProxyPtr service;
- frame->Client()->GetInterfaceProvider()->GetInterface(&service);
+ Platform* platform = Platform::Current();
+ platform->GetConnector()->BindInterface(platform->GetBrowserServiceName(),
+ &service);
service->QueueInterventionReport(document->Url(), message, body->sourceFile(),
body->lineNumber(), body->columnNumber());
}

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h diff --git content/browser/renderer_host/browser_compositor_view_mac.h content/browser/renderer_host/browser_compositor_view_mac.h
index 3ed8b18dfabd..f0c30a60376a 100644 index 81376ab57c4b..364305777492 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h --- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h +++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -53,6 +53,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { @@ -51,11 +51,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
// These will not return nullptr until Destroy is called. // These will not return nullptr until Destroy is called.
DelegatedFrameHost* GetDelegatedFrameHost(); DelegatedFrameHost* GetDelegatedFrameHost();
@ -10,19 +10,17 @@ index 3ed8b18dfabd..f0c30a60376a 100644
// Ensure that the currect compositor frame be cleared (even if it is // Ensure that the currect compositor frame be cleared (even if it is
// potentially visible). // potentially visible).
@@ -60,6 +61,7 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient { void ClearCompositorFrame();
// This may return nullptr, if this has detached itself from its
// ui::Compositor.
+ ui::Compositor* GetCompositor(); + ui::Compositor* GetCompositor();
ui::AcceleratedWidgetMac* GetAcceleratedWidgetMac(); gfx::AcceleratedWidget GetAcceleratedWidget();
void DidCreateNewRendererCompositorFrameSink( void DidCreateNewRendererCompositorFrameSink(
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink);
diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm diff --git content/browser/renderer_host/browser_compositor_view_mac.mm content/browser/renderer_host/browser_compositor_view_mac.mm
index 00169dea145c..cb3d2b3175b1 100644 index 8e98fb37c1d4..8dc887eac61b 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm --- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm +++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -211,6 +211,12 @@ BrowserCompositorMac::~BrowserCompositorMac() { @@ -214,6 +214,12 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
g_spare_recyclable_compositors.Get().clear(); g_spare_recyclable_compositors.Get().clear();
} }
@ -32,22 +30,40 @@ index 00169dea145c..cb3d2b3175b1 100644
+ return nullptr; + return nullptr;
+} +}
+ +
ui::AcceleratedWidgetMac* BrowserCompositorMac::GetAcceleratedWidgetMac() { gfx::AcceleratedWidget BrowserCompositorMac::GetAcceleratedWidget() {
if (recyclable_compositor_) if (recyclable_compositor_) {
return recyclable_compositor_->accelerated_widget_mac(); return recyclable_compositor_->accelerated_widget_mac()
@@ -441,8 +447,13 @@ SkColor BrowserCompositorMac::DelegatedFrameHostGetGutterColor( @@ -473,10 +479,16 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
} NSView* ns_view =
accelerated_widget_mac_ns_view_->AcceleratedWidgetGetNSView();
gfx::Size BrowserCompositorMac::DelegatedFrameHostDesiredSizeInDIP() const { if (bounds_in_dip) {
- NSRect bounds = [client_->BrowserCompositorMacGetNSView() bounds]; - NSSize dip_ns_size = [ns_view bounds].size;
- return gfx::Size(bounds.size.width, bounds.size.height); - *bounds_in_dip = gfx::Size(dip_ns_size.width, dip_ns_size.height);
+ // View will be nil with CEF OSR. + if (ns_view) {
+ NSView* view = client_->BrowserCompositorMacGetNSView(); + NSSize dip_ns_size = [ns_view bounds].size;
+ if (view) { + *bounds_in_dip = gfx::Size(dip_ns_size.width, dip_ns_size.height);
+ NSRect bounds = [view bounds]; + } else {
+ return gfx::Size(bounds.size.width, bounds.size.height); + // |ns_view| will be nullptr for CEF.
+ *bounds_in_dip = root_layer_->bounds().size();
+ } + }
+ return root_layer_->bounds().size();
} }
if (scale_factor || color_space) {
+ // TODO(cef): Return values from CEF callbacks here.
display::Display display =
display::Screen::GetScreen()->GetDisplayNearestView(ns_view);
if (scale_factor)
diff --git ui/accelerated_widget_mac/accelerated_widget_mac.mm ui/accelerated_widget_mac/accelerated_widget_mac.mm
index 7ff59beee63c..48efe5ac93fa 100644
--- ui/accelerated_widget_mac/accelerated_widget_mac.mm
+++ ui/accelerated_widget_mac/accelerated_widget_mac.mm
@@ -66,6 +66,10 @@ - (void)setContentsChanged;
DCHECK(view && !view_);
view_ = view;
bool BrowserCompositorMac::DelegatedFrameCanCreateResizeLock() const { + // Will be nullptr for CEF.
+ if (!view_->AcceleratedWidgetGetNSView())
+ return;
+
CALayer* background_layer = [view_->AcceleratedWidgetGetNSView() layer];
DCHECK(background_layer);
[flipped_layer_ setBounds:[background_layer bounds]];

View File

@ -1,5 +1,5 @@
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
index ccdafd2e9280..3d3651cf5b26 100644 index c83e5babe405..92efd9e12561 100644
--- content/browser/browser_plugin/browser_plugin_guest.cc --- content/browser/browser_plugin/browser_plugin_guest.cc
+++ content/browser/browser_plugin/browser_plugin_guest.cc +++ content/browser/browser_plugin/browser_plugin_guest.cc
@@ -339,8 +339,11 @@ void BrowserPluginGuest::InitInternal( @@ -339,8 +339,11 @@ void BrowserPluginGuest::InitInternal(
@ -15,7 +15,7 @@ index ccdafd2e9280..3d3651cf5b26 100644
// Once a BrowserPluginGuest has an embedder WebContents, it's considered to // Once a BrowserPluginGuest has an embedder WebContents, it's considered to
// be attached. // be attached.
@@ -837,10 +840,19 @@ void BrowserPluginGuest::OnWillAttachComplete( @@ -836,10 +839,19 @@ void BrowserPluginGuest::OnWillAttachComplete(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) { if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {
web_contents_view->CreateViewForWidget( web_contents_view->CreateViewForWidget(
@ -37,7 +37,7 @@ index ccdafd2e9280..3d3651cf5b26 100644
attached_ = true; attached_ = true;
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
index 2f24f1b959d4..5cfb0b3e97c6 100644 index 5a7aa396e372..8f80ed6d340c 100644
--- content/browser/frame_host/interstitial_page_impl.cc --- content/browser/frame_host/interstitial_page_impl.cc
+++ content/browser/frame_host/interstitial_page_impl.cc +++ content/browser/frame_host/interstitial_page_impl.cc
@@ -613,7 +613,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() { @@ -613,7 +613,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
@ -46,7 +46,7 @@ index 2f24f1b959d4..5cfb0b3e97c6 100644
RenderWidgetHostViewBase* view = RenderWidgetHostViewBase* view =
- wcv->CreateViewForWidget(render_view_host_->GetWidget(), false); - wcv->CreateViewForWidget(render_view_host_->GetWidget(), false);
+ wcv->CreateViewForWidget(render_view_host_->GetWidget(), nullptr); + wcv->CreateViewForWidget(render_view_host_->GetWidget(), nullptr);
RenderWidgetHostImpl::From(render_view_host_->GetWidget())->SetView(view); render_view_host_->GetWidget()->SetView(view);
render_view_host_->GetMainFrame()->AllowBindings( render_view_host_->GetMainFrame()->AllowBindings(
BINDINGS_POLICY_DOM_AUTOMATION); BINDINGS_POLICY_DOM_AUTOMATION);
diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h
@ -79,10 +79,10 @@ index a38a936af6df..5380e09ee023 100644
// Creates a new View that holds a popup and receives messages for it. // Creates a new View that holds a popup and receives messages for it.
virtual RenderWidgetHostViewBase* CreateViewForPopupWidget( virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
index ee18b4dd66bd..9e447f7d9511 100644 index c5ce75e10e2b..9968d86d4d48 100644
--- content/browser/web_contents/web_contents_view_aura.cc --- content/browser/web_contents/web_contents_view_aura.cc
+++ content/browser/web_contents/web_contents_view_aura.cc +++ content/browser/web_contents/web_contents_view_aura.cc
@@ -886,7 +886,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size, @@ -887,7 +887,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
} }
RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@ -92,7 +92,7 @@ index ee18b4dd66bd..9e447f7d9511 100644
if (render_widget_host->GetView()) { if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the // 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 // test view, so we don't want to clobber it with a real one. To verify that
@@ -898,6 +899,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget( @@ -899,6 +900,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
render_widget_host->GetView()); render_widget_host->GetView());
} }
@ -101,7 +101,7 @@ index ee18b4dd66bd..9e447f7d9511 100644
g_create_render_widget_host_view g_create_render_widget_host_view
? g_create_render_widget_host_view(render_widget_host, ? 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 diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
index 7b2078f53dc4..e65fd914dd0d 100644 index 534f92c4cd6a..6f2ec63f09e6 100644
--- content/browser/web_contents/web_contents_view_aura.h --- content/browser/web_contents/web_contents_view_aura.h
+++ content/browser/web_contents/web_contents_view_aura.h +++ content/browser/web_contents/web_contents_view_aura.h
@@ -120,7 +120,7 @@ class CONTENT_EXPORT WebContentsViewAura @@ -120,7 +120,7 @@ class CONTENT_EXPORT WebContentsViewAura
@ -140,10 +140,10 @@ index ca3c586f9f8f..5fd0e860a5ff 100644
RenderWidgetHost* render_widget_host) override; RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) 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 diff --git content/browser/web_contents/web_contents_view_guest.cc content/browser/web_contents/web_contents_view_guest.cc
index f1370d294ef9..d7a451028e64 100644 index 227a66c7c836..f4d47bbed1a8 100644
--- content/browser/web_contents/web_contents_view_guest.cc --- content/browser/web_contents/web_contents_view_guest.cc
+++ content/browser/web_contents/web_contents_view_guest.cc +++ content/browser/web_contents/web_contents_view_guest.cc
@@ -73,6 +73,8 @@ void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const { @@ -74,6 +74,8 @@ void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const {
void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) { void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
#if defined(USE_AURA) #if defined(USE_AURA)
@ -152,16 +152,16 @@ index f1370d294ef9..d7a451028e64 100644
// In aura, ScreenPositionClient doesn't work properly if we do // In aura, ScreenPositionClient doesn't work properly if we do
// not have the native view associated with this WebContentsViewGuest in the // not have the native view associated with this WebContentsViewGuest in the
// view hierarchy. We add this view as embedder's child here. // view hierarchy. We add this view as embedder's child here.
@@ -85,6 +87,8 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) { @@ -86,6 +88,8 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) { void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) {
#if defined(USE_AURA) #if defined(USE_AURA)
+ if (!platform_view_->GetNativeView()) + if (!platform_view_->GetNativeView())
+ return; + return;
if (!IsUsingMus()) { if (!switches::IsMusHostingViz()) {
old_parent_view->GetNativeView()->RemoveChild( old_parent_view->GetNativeView()->RemoveChild(
platform_view_->GetNativeView()); platform_view_->GetNativeView());
@@ -138,7 +142,8 @@ void WebContentsViewGuest::CreateView(const gfx::Size& initial_size, @@ -139,7 +143,8 @@ void WebContentsViewGuest::CreateView(const gfx::Size& initial_size,
} }
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget( RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
@ -171,7 +171,7 @@ index f1370d294ef9..d7a451028e64 100644
if (render_widget_host->GetView()) { if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the // 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 // test view, so we don't want to clobber it with a real one. To verify that
@@ -150,11 +155,19 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget( @@ -151,11 +156,19 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
render_widget_host->GetView()); render_widget_host->GetView());
} }

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 1126d7e63c30..64ecb8982428 100644 index 472d5ea34687..575960cb4a37 100644
--- chrome/browser/BUILD.gn --- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn +++ chrome/browser/BUILD.gn
@@ -7,6 +7,7 @@ import("//build/config/crypto.gni") @@ -7,6 +7,7 @@ import("//build/config/crypto.gni")
@ -10,7 +10,7 @@ index 1126d7e63c30..64ecb8982428 100644
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//components/feature_engagement/features.gni") import("//components/feature_engagement/features.gni")
import("//components/nacl/features.gni") import("//components/nacl/features.gni")
@@ -1551,6 +1552,7 @@ split_static_library("browser") { @@ -1586,6 +1587,7 @@ split_static_library("browser") {
"//base:i18n", "//base:i18n",
"//base/allocator:features", "//base/allocator:features",
"//cc", "//cc",
@ -18,7 +18,7 @@ index 1126d7e63c30..64ecb8982428 100644
"//chrome:extra_resources", "//chrome:extra_resources",
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
@@ -1797,6 +1799,10 @@ split_static_library("browser") { @@ -1837,6 +1839,10 @@ split_static_library("browser") {
"//ui/web_dialogs", "//ui/web_dialogs",
] ]

View File

@ -71,10 +71,10 @@ index e8e76ce5b954..1dd338dd0142 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito( content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context); content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 0fe78f76aaa7..8fb527cc2636 100644 index c5ab3d4e4d7a..69f54123f2cc 100644
--- chrome/browser/profiles/profile_manager.cc --- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc +++ chrome/browser/profiles/profile_manager.cc
@@ -375,7 +375,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir) @@ -377,7 +377,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
@ -84,7 +84,7 @@ index 0fe78f76aaa7..8fb527cc2636 100644
this)); this));
} }
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 538b8458ab9e..169d4e079bf9 100644 index 9c410dc3ba6d..219d42503fa7 100644
--- chrome/browser/profiles/profile_manager.h --- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h +++ chrome/browser/profiles/profile_manager.h
@@ -93,7 +93,7 @@ class ProfileManager : public content::NotificationObserver, @@ -93,7 +93,7 @@ class ProfileManager : public content::NotificationObserver,

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index 1afbaf86ac40..c80a499d4dc2 100644 index 312e27d1b562..03eb1fda05cb 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc --- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc +++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -18,6 +18,7 @@ @@ -17,6 +17,7 @@
#include "base/task_runner_util.h" #include "base/task_runner_util.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
@ -10,9 +10,9 @@ index 1afbaf86ac40..c80a499d4dc2 100644
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h" #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h" #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
@@ -56,6 +57,11 @@ @@ -55,6 +56,11 @@
#include "url/gurl.h"
#include "url/origin.h" #include "url/origin.h"
#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
+#if BUILDFLAG(ENABLE_CEF) +#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/browser/plugins/plugin_service_filter.h" +#include "cef/libcef/browser/plugins/plugin_service_filter.h"
@ -22,37 +22,39 @@ index 1afbaf86ac40..c80a499d4dc2 100644
#if BUILDFLAG(ENABLE_EXTENSIONS) #if BUILDFLAG(ENABLE_EXTENSIONS)
#include "components/guest_view/browser/guest_view_base.h" #include "components/guest_view/browser/guest_view_base.h"
#include "extensions/browser/extension_registry.h" #include "extensions/browser/extension_registry.h"
@@ -77,12 +83,10 @@ namespace { @@ -76,12 +82,10 @@ namespace {
class ShutdownNotifierFactory class PluginInfoHostImplShutdownNotifierFactory
: public BrowserContextKeyedServiceShutdownNotifierFactory { : public BrowserContextKeyedServiceShutdownNotifierFactory {
public: public:
- static ShutdownNotifierFactory* GetInstance() { - static PluginInfoHostImplShutdownNotifierFactory* GetInstance() {
- return base::Singleton<ShutdownNotifierFactory>::get(); - return base::Singleton<PluginInfoHostImplShutdownNotifierFactory>::get();
- } - }
+ static ShutdownNotifierFactory* GetInstance(); + static PluginInfoHostImplShutdownNotifierFactory* GetInstance();
private: private:
- friend struct base::DefaultSingletonTraits<ShutdownNotifierFactory>; - friend struct base::DefaultSingletonTraits<
+ friend struct base::LazyInstanceTraitsBase<ShutdownNotifierFactory>; + friend struct base::LazyInstanceTraitsBase<
PluginInfoHostImplShutdownNotifierFactory>;
ShutdownNotifierFactory() PluginInfoHostImplShutdownNotifierFactory()
: BrowserContextKeyedServiceShutdownNotifierFactory( @@ -93,6 +97,16 @@ class PluginInfoHostImplShutdownNotifierFactory
@@ -93,6 +97,14 @@ class ShutdownNotifierFactory DISALLOW_COPY_AND_ASSIGN(PluginInfoHostImplShutdownNotifierFactory);
DISALLOW_COPY_AND_ASSIGN(ShutdownNotifierFactory);
}; };
+base::LazyInstance<ShutdownNotifierFactory>::Leaky g_shutdown_notifier_factory = +base::LazyInstance<PluginInfoHostImplShutdownNotifierFactory>::Leaky
+ g_plugin_info_host_impl_shutdown_notifier_factory =
+ LAZY_INSTANCE_INITIALIZER; + LAZY_INSTANCE_INITIALIZER;
+ +
+// static +// static
+ShutdownNotifierFactory* ShutdownNotifierFactory::GetInstance() { +PluginInfoHostImplShutdownNotifierFactory*
+ return g_shutdown_notifier_factory.Pointer(); +PluginInfoHostImplShutdownNotifierFactory::GetInstance() {
+ return g_plugin_info_host_impl_shutdown_notifier_factory.Pointer();
+} +}
+ +
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) #if BUILDFLAG(ENABLE_EXTENSIONS)
// Returns whether a request from a plugin to load |resource| from a renderer
enum PluginAvailabilityStatusForUMA { // with process id |process_id| is a request for an internal resource by an app
@@ -124,6 +136,9 @@ bool IsPluginLoadingAccessibleResourceInWebView( @@ -101,6 +115,9 @@ bool IsPluginLoadingAccessibleResourceInWebView(
extensions::ExtensionRegistry* extension_registry, extensions::ExtensionRegistry* extension_registry,
int process_id, int process_id,
const GURL& resource) { const GURL& resource) {
@ -62,7 +64,7 @@ index 1afbaf86ac40..c80a499d4dc2 100644
extensions::WebViewRendererState* renderer_state = extensions::WebViewRendererState* renderer_state =
extensions::WebViewRendererState::GetInstance(); extensions::WebViewRendererState::GetInstance();
std::string partition_id; std::string partition_id;
@@ -153,12 +168,16 @@ bool IsPluginLoadingAccessibleResourceInWebView( @@ -130,12 +147,16 @@ bool IsPluginLoadingAccessibleResourceInWebView(
PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile) PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile)
: render_process_id_(render_process_id), : render_process_id_(render_process_id),
resource_context_(profile->GetResourceContext()), resource_context_(profile->GetResourceContext()),
@ -82,7 +84,7 @@ index 1afbaf86ac40..c80a499d4dc2 100644
allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated, allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated,
profile->GetPrefs()); profile->GetPrefs());
allow_outdated_plugins_.MoveToThread( allow_outdated_plugins_.MoveToThread(
@@ -264,6 +283,7 @@ void PluginInfoHostImpl::PluginsLoaded( @@ -234,6 +255,7 @@ void PluginInfoHostImpl::PluginsLoaded(
plugin_metadata->identifier(), &output->status); plugin_metadata->identifier(), &output->status);
} }
@ -90,7 +92,7 @@ index 1afbaf86ac40..c80a499d4dc2 100644
if (output->status == chrome::mojom::PluginStatus::kNotFound) { if (output->status == chrome::mojom::PluginStatus::kNotFound) {
// Check to see if the component updater can fetch an implementation. // Check to see if the component updater can fetch an implementation.
base::PostTaskAndReplyWithResult( base::PostTaskAndReplyWithResult(
@@ -275,7 +295,9 @@ void PluginInfoHostImpl::PluginsLoaded( @@ -245,7 +267,9 @@ void PluginInfoHostImpl::PluginsLoaded(
base::BindOnce(&PluginInfoHostImpl::ComponentPluginLookupDone, this, base::BindOnce(&PluginInfoHostImpl::ComponentPluginLookupDone, this,
params, std::move(output), std::move(callback), params, std::move(output), std::move(callback),
std::move(plugin_metadata))); std::move(plugin_metadata)));
@ -101,7 +103,7 @@ index 1afbaf86ac40..c80a499d4dc2 100644
GetPluginInfoFinish(params, std::move(output), std::move(callback), GetPluginInfoFinish(params, std::move(output), std::move(callback),
std::move(plugin_metadata)); std::move(plugin_metadata));
} }
@@ -325,6 +347,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus( @@ -258,6 +282,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus(
PluginMetadata::SecurityStatus security_status, PluginMetadata::SecurityStatus security_status,
const std::string& plugin_identifier, const std::string& plugin_identifier,
chrome::mojom::PluginStatus* status) const { chrome::mojom::PluginStatus* status) const {
@ -116,7 +118,7 @@ index 1afbaf86ac40..c80a499d4dc2 100644
if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) { if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
*status = chrome::mojom::PluginStatus::kAllowed; *status = chrome::mojom::PluginStatus::kAllowed;
return; return;
@@ -450,16 +480,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin( @@ -382,16 +414,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin(
return false; return false;
} }
@ -155,10 +157,10 @@ index 1afbaf86ac40..c80a499d4dc2 100644
// If we broke out of the loop, we have found an enabled plugin. // If we broke out of the loop, we have found an enabled plugin.
bool enabled = i < matching_plugins.size(); bool enabled = i < matching_plugins.size();
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 5dc888bfb2df..297737be682e 100644 index 47aceed2a513..2f1dae33e865 100644
--- chrome/renderer/chrome_content_renderer_client.cc --- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc +++ chrome/renderer/chrome_content_renderer_client.cc
@@ -805,6 +805,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -795,6 +795,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized || if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) && status == chrome::mojom::PluginStatus::kBlocked) &&
@ -166,7 +168,7 @@ index 5dc888bfb2df..297737be682e 100644
observer->IsPluginTemporarilyAllowed(identifier)) { observer->IsPluginTemporarilyAllowed(identifier)) {
status = chrome::mojom::PluginStatus::kAllowed; status = chrome::mojom::PluginStatus::kAllowed;
} }
@@ -992,7 +993,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -982,7 +983,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface( render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
&plugin_auth_host); &plugin_auth_host);
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier); plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@ -176,7 +178,7 @@ index 5dc888bfb2df..297737be682e 100644
break; break;
} }
case chrome::mojom::PluginStatus::kBlocked: { case chrome::mojom::PluginStatus::kBlocked: {
@@ -1001,7 +1003,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -991,7 +993,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading(); placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@ -186,7 +188,7 @@ index 5dc888bfb2df..297737be682e 100644
break; break;
} }
case chrome::mojom::PluginStatus::kBlockedByPolicy: { case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1011,7 +1014,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -1001,7 +1004,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name)); group_name));
RenderThread::Get()->RecordAction( RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy")); UserMetricsAction("Plugin_BlockedByPolicy"));
@ -196,7 +198,7 @@ index 5dc888bfb2df..297737be682e 100644
break; break;
} }
case chrome::mojom::PluginStatus::kBlockedNoLoading: { case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -1019,7 +1023,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin( @@ -1009,7 +1013,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML, IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING, l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name)); group_name));
@ -207,10 +209,10 @@ index 5dc888bfb2df..297737be682e 100644
} }
case chrome::mojom::PluginStatus::kComponentUpdateRequired: { case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
index 7a814bb072dc..79c7d65118cb 100644 index 63b86138b4fe..4ed38c132efb 100644
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc --- chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc +++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -349,8 +349,11 @@ void ChromePluginPlaceholder::OnBlockedContent( @@ -350,8 +350,11 @@ void ChromePluginPlaceholder::OnBlockedContent(
if (status == if (status ==
content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) { content::RenderFrame::PeripheralContentStatus::CONTENT_STATUS_TINY) {

View File

@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index da3b9d31a05b..78c15d30755d 100644 index 3f68c173d1c2..3906f588c7c2 100644
--- chrome/renderer/BUILD.gn --- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn +++ chrome/renderer/BUILD.gn
@@ -3,6 +3,7 @@ @@ -3,6 +3,7 @@
@ -10,7 +10,7 @@ index da3b9d31a05b..78c15d30755d 100644
import("//chrome/common/features.gni") import("//chrome/common/features.gni")
import("//components/nacl/features.gni") import("//components/nacl/features.gni")
import("//components/spellcheck/spellcheck_build_features.gni") import("//components/spellcheck/spellcheck_build_features.gni")
@@ -102,6 +103,7 @@ static_library("renderer") { @@ -106,6 +107,7 @@ static_library("renderer") {
defines = [] defines = []
deps = [ deps = [
@ -18,7 +18,7 @@ index da3b9d31a05b..78c15d30755d 100644
"//chrome:resources", "//chrome:resources",
"//chrome:strings", "//chrome:strings",
"//chrome/common", "//chrome/common",
@@ -161,6 +163,10 @@ static_library("renderer") { @@ -166,6 +168,10 @@ static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ] configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@ -1,8 +1,8 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index 8171be4d4249..1d437dabd35e 100644 index 3c0ce2e2f701..7b078635d3b9 100644
--- chrome/common/chrome_content_client.cc --- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc +++ chrome/common/chrome_content_client.cc
@@ -90,7 +90,8 @@ @@ -91,7 +91,8 @@
#if BUILDFLAG(ENABLE_LIBRARY_CDMS) #if BUILDFLAG(ENABLE_LIBRARY_CDMS)
#include "media/cdm/cdm_paths.h" // nogncheck #include "media/cdm/cdm_paths.h" // nogncheck

View File

@ -13,7 +13,7 @@ index 4393a8fac233..860715e86900 100644
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params); explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
~ContentServiceManagerMainDelegate() override; ~ContentServiceManagerMainDelegate() override;
diff --git third_party/WebKit/Source/controller/BUILD.gn third_party/WebKit/Source/controller/BUILD.gn diff --git third_party/WebKit/Source/controller/BUILD.gn third_party/WebKit/Source/controller/BUILD.gn
index 714113da5d67..2a8feb621f4b 100644 index d10cff4a0fdd..89673c9c5250 100644
--- third_party/WebKit/Source/controller/BUILD.gn --- third_party/WebKit/Source/controller/BUILD.gn
+++ third_party/WebKit/Source/controller/BUILD.gn +++ third_party/WebKit/Source/controller/BUILD.gn
@@ -25,6 +25,7 @@ component("controller") { @@ -25,6 +25,7 @@ component("controller") {
@ -24,8 +24,8 @@ index 714113da5d67..2a8feb621f4b 100644
"//third_party/WebKit/Source:config", "//third_party/WebKit/Source:config",
"//third_party/WebKit/Source:inside_blink", "//third_party/WebKit/Source:inside_blink",
"//third_party/WebKit/Source:non_test_config", "//third_party/WebKit/Source:non_test_config",
@@ -39,6 +40,8 @@ component("controller") { @@ -41,6 +42,8 @@ component("controller") {
"ControllerExport.h", "DevToolsFrontendImpl.h",
"OomInterventionImpl.cpp", "OomInterventionImpl.cpp",
"OomInterventionImpl.h", "OomInterventionImpl.h",
+ "//cef/libcef/renderer/webkit_glue.cc", + "//cef/libcef/renderer/webkit_glue.cc",

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index cddd17ca8682..c8641e9d0fdc 100644 index 33b9aa78462d..0653e11dbef1 100644
--- content/browser/compositor/gpu_process_transport_factory.cc --- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc +++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -502,9 +502,19 @@ void GpuProcessTransportFactory::EstablishedGpuChannel( @@ -491,9 +491,19 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
// surfaces as they are not following the correct mode. // surfaces as they are not following the correct mode.
DisableGpuCompositing(compositor.get()); DisableGpuCompositing(compositor.get());
} }
@ -24,18 +24,18 @@ index cddd17ca8682..c8641e9d0fdc 100644
} else { } else {
DCHECK(context_provider); DCHECK(context_provider);
diff --git ui/compositor/compositor.h ui/compositor/compositor.h diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index 00885cbac420..874ec42e3825 100644 index eb56a103f8cb..ec2a44f1f5d0 100644
--- ui/compositor/compositor.h --- ui/compositor/compositor.h
+++ ui/compositor/compositor.h +++ ui/compositor/compositor.h
@@ -23,6 +23,7 @@ @@ -24,6 +24,7 @@
#include "components/viz/common/surfaces/local_surface_id.h" #include "components/viz/common/surfaces/local_surface_id.h"
#include "components/viz/common/surfaces/surface_sequence.h" #include "components/viz/common/surfaces/surface_sequence.h"
#include "components/viz/host/host_frame_sink_client.h" #include "components/viz/host/host_frame_sink_client.h"
+#include "components/viz/service/display/software_output_device.h" +#include "components/viz/service/display/software_output_device.h"
#include "third_party/skia/include/core/SkColor.h" #include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkMatrix44.h"
#include "ui/compositor/compositor_animation_observer.h" #include "ui/compositor/compositor_animation_observer.h"
#include "ui/compositor/compositor_export.h" @@ -186,6 +187,17 @@ class COMPOSITOR_EXPORT ContextFactory {
@@ -179,6 +180,17 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual void RemoveObserver(ContextFactoryObserver* observer) = 0; virtual void RemoveObserver(ContextFactoryObserver* observer) = 0;
}; };
@ -53,7 +53,7 @@ index 00885cbac420..874ec42e3825 100644
// Compositor object to take care of GPU painting. // Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final // A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an // displayable form of pixels comprising a single widget's contents. It draws an
@@ -218,6 +230,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, @@ -225,6 +237,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Schedules a redraw of the layer tree associated with this compositor. // Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw(); void ScheduleDraw();
@ -63,7 +63,7 @@ index 00885cbac420..874ec42e3825 100644
// Sets the root of the layer tree drawn by this Compositor. The root layer // Sets the root of the layer tree drawn by this Compositor. The root layer
// must have no parent. The compositor's root layer is reset if the root layer // must have no parent. The compositor's root layer is reset if the root layer
// is destroyed. NULL can be passed to reset the root layer, in which case the // is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -436,6 +451,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient, @@ -445,6 +460,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
ui::ContextFactory* context_factory_; ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_; ui::ContextFactoryPrivate* context_factory_private_;

View File

@ -14,10 +14,10 @@ index 4f4dadd98fd9..840c1df997dd 100644
// The GetPlugins call causes the plugin list to be refreshed. Once that's // The GetPlugins call causes the plugin list to be refreshed. Once that's
// done we can retry the GetPluginInfo call. We break out of this cycle // done we can retry the GetPluginInfo call. We break out of this cycle
diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc
index 1783a101aa02..b380ef826ff7 100644 index 5b07f3a407bf..7dffe84fc17c 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.cc --- chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc +++ chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -179,6 +179,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable( @@ -169,6 +169,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
int render_frame_id, int render_frame_id,
const void* context, const void* context,
const GURL& plugin_content_url, const GURL& plugin_content_url,
@ -26,10 +26,10 @@ index 1783a101aa02..b380ef826ff7 100644
content::WebPluginInfo* plugin) { content::WebPluginInfo* plugin) {
base::AutoLock auto_lock(lock_); base::AutoLock auto_lock(lock_);
diff --git chrome/browser/plugins/chrome_plugin_service_filter.h chrome/browser/plugins/chrome_plugin_service_filter.h diff --git chrome/browser/plugins/chrome_plugin_service_filter.h chrome/browser/plugins/chrome_plugin_service_filter.h
index f8b651f1ddc4..ec39f8d7dc85 100644 index 133145db74bf..021ab307ee2a 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.h --- chrome/browser/plugins/chrome_plugin_service_filter.h
+++ chrome/browser/plugins/chrome_plugin_service_filter.h +++ chrome/browser/plugins/chrome_plugin_service_filter.h
@@ -71,6 +71,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter, @@ -66,6 +66,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
int render_frame_id, int render_frame_id,
const void* context, const void* context,
const GURL& plugin_content_url, const GURL& plugin_content_url,
@ -64,7 +64,7 @@ index 6a2122ee1ed7..68831894695a 100644
} }
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 34c9855a251e..0e09454569e2 100644 index fcbea93113dd..0cd61aaf0aae 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc --- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -596,6 +596,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted( @@ -596,6 +596,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
@ -76,10 +76,10 @@ index 34c9855a251e..0e09454569e2 100644
mime_type, false, NULL, &plugin, NULL)); mime_type, false, NULL, &plugin, NULL));
} }
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
index 73afa8b3908c..c9edab729e94 100644 index 89a41274745c..586864a9d827 100644
--- content/browser/frame_host/navigation_handle_impl.cc --- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc +++ content/browser/frame_host/navigation_handle_impl.cc
@@ -321,12 +321,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() { @@ -325,12 +325,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
} }
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() { RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
@ -93,7 +93,7 @@ index 73afa8b3908c..c9edab729e94 100644
} }
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index 1a4440241992..172190cb3339 100644 index fc3412cb2680..385a7c591689 100644
--- content/browser/frame_host/render_frame_host_impl.cc --- content/browser/frame_host/render_frame_host_impl.cc
+++ content/browser/frame_host/render_frame_host_impl.cc +++ content/browser/frame_host/render_frame_host_impl.cc
@@ -1499,6 +1499,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError( @@ -1499,6 +1499,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
@ -104,10 +104,10 @@ index 1a4440241992..172190cb3339 100644
} }
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params); frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
@@ -3484,9 +3485,9 @@ void RenderFrameHostImpl::CommitNavigation( @@ -3515,9 +3516,9 @@ void RenderFrameHostImpl::CommitNavigation(
// however only do this for cross-document navigations, because the // however only do this for cross-document navigations, because the
// alternative would be redundant effort. // alternative would be redundant effort.
mojom::URLLoaderFactoryPtr default_factory; network::mojom::URLLoaderFactoryPtr default_factory;
- StoragePartitionImpl* storage_partition = - StoragePartitionImpl* storage_partition =
- static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition( - static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance())); - GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
@ -117,11 +117,24 @@ index 1a4440241992..172190cb3339 100644
if (subresource_loader_params && if (subresource_loader_params &&
subresource_loader_params->loader_factory_info.is_valid()) { subresource_loader_params->loader_factory_info.is_valid()) {
// If the caller has supplied a default URLLoaderFactory override (for // If the caller has supplied a default URLLoaderFactory override (for
@@ -3652,9 +3653,9 @@ void RenderFrameHostImpl::FailedNavigation(
// completing an unload handler.
ResetWaitingState();
- StoragePartitionImpl* storage_partition =
- static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
+ StoragePartition* storage_partition =
+ BrowserContext::GetStoragePartition(
+ GetSiteInstance()->GetBrowserContext(), GetSiteInstance());
network::mojom::URLLoaderFactoryPtr default_factory;
if (g_url_loader_factory_callback_for_test.Get().is_null()) {
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index 4099c6a7ea9f..5c0d94d6062d 100644 index 6e105e13b6c5..99815c49cbc1 100644
--- content/browser/frame_host/render_frame_message_filter.cc --- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc +++ content/browser/frame_host/render_frame_message_filter.cc
@@ -542,6 +542,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id, @@ -540,6 +540,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
void RenderFrameMessageFilter::OnGetPlugins( void RenderFrameMessageFilter::OnGetPlugins(
bool refresh, bool refresh,
@ -129,7 +142,7 @@ index 4099c6a7ea9f..5c0d94d6062d 100644
const url::Origin& main_frame_origin, const url::Origin& main_frame_origin,
IPC::Message* reply_msg) { IPC::Message* reply_msg) {
// Don't refresh if the specified threshold has not been passed. Note that // Don't refresh if the specified threshold has not been passed. Note that
@@ -563,18 +564,19 @@ void RenderFrameMessageFilter::OnGetPlugins( @@ -561,18 +562,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
PluginServiceImpl::GetInstance()->GetPlugins( PluginServiceImpl::GetInstance()->GetPlugins(
base::BindOnce(&RenderFrameMessageFilter::GetPluginsCallback, this, base::BindOnce(&RenderFrameMessageFilter::GetPluginsCallback, this,
@ -151,7 +164,7 @@ index 4099c6a7ea9f..5c0d94d6062d 100644
int routing_id = MSG_ROUTING_NONE; int routing_id = MSG_ROUTING_NONE;
// In this loop, copy the WebPluginInfo (and do not use a reference) because // In this loop, copy the WebPluginInfo (and do not use a reference) because
// the filter might mutate it. // the filter might mutate it.
@@ -583,7 +585,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( @@ -581,7 +583,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
if (!filter || if (!filter ||
filter->IsPluginAvailable(child_process_id, routing_id, filter->IsPluginAvailable(child_process_id, routing_id,
resource_context_, main_frame_origin.GetURL(), resource_context_, main_frame_origin.GetURL(),
@ -160,7 +173,7 @@ index 4099c6a7ea9f..5c0d94d6062d 100644
plugins.push_back(plugin); plugins.push_back(plugin);
} }
} }
@@ -595,6 +597,7 @@ void RenderFrameMessageFilter::GetPluginsCallback( @@ -593,6 +595,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
void RenderFrameMessageFilter::OnGetPluginInfo( void RenderFrameMessageFilter::OnGetPluginInfo(
int render_frame_id, int render_frame_id,
const GURL& url, const GURL& url,
@ -168,7 +181,7 @@ index 4099c6a7ea9f..5c0d94d6062d 100644
const url::Origin& main_frame_origin, const url::Origin& main_frame_origin,
const std::string& mime_type, const std::string& mime_type,
bool* found, bool* found,
@@ -603,8 +606,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo( @@ -601,8 +604,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
bool allow_wildcard = true; bool allow_wildcard = true;
*found = plugin_service_->GetPluginInfo( *found = plugin_service_->GetPluginInfo(
render_process_id_, render_frame_id, resource_context_, url, render_process_id_, render_frame_id, resource_context_, url,
@ -180,7 +193,7 @@ index 4099c6a7ea9f..5c0d94d6062d 100644
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin( void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
index 0b884a7558a9..98ecd1ca2460 100644 index 8c3371209034..ae382bf750c0 100644
--- content/browser/frame_host/render_frame_message_filter.h --- content/browser/frame_host/render_frame_message_filter.h
+++ content/browser/frame_host/render_frame_message_filter.h +++ content/browser/frame_host/render_frame_message_filter.h
@@ -136,13 +136,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter @@ -136,13 +136,16 @@ class CONTENT_EXPORT RenderFrameMessageFilter
@ -201,10 +214,10 @@ index 0b884a7558a9..98ecd1ca2460 100644
const std::string& mime_type, const std::string& mime_type,
bool* found, bool* found,
diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc
index 130041fe86c2..90b4e6e21167 100644 index f951a3fd5cad..4740a49d4d38 100644
--- content/browser/loader/mime_sniffing_resource_handler.cc --- content/browser/loader/mime_sniffing_resource_handler.cc
+++ content/browser/loader/mime_sniffing_resource_handler.cc +++ content/browser/loader/mime_sniffing_resource_handler.cc
@@ -449,8 +449,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler( @@ -447,8 +447,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
WebPluginInfo plugin; WebPluginInfo plugin;
bool has_plugin = plugin_service_->GetPluginInfo( bool has_plugin = plugin_service_->GetPluginInfo(
info->GetChildID(), info->GetRenderFrameID(), info->GetContext(), info->GetChildID(), info->GetRenderFrameID(), info->GetContext(),
@ -216,10 +229,10 @@ index 130041fe86c2..90b4e6e21167 100644
if (stale) { if (stale) {
// Refresh the plugins asynchronously. // Refresh the plugins asynchronously.
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
index 0378ab3c5013..21b7157f7ac8 100644 index 130f4d8e92e8..bade33e04c2e 100644
--- content/browser/plugin_service_impl.cc --- content/browser/plugin_service_impl.cc
+++ content/browser/plugin_service_impl.cc +++ content/browser/plugin_service_impl.cc
@@ -260,6 +260,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, @@ -262,6 +262,7 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
int render_frame_id, int render_frame_id,
ResourceContext* context, ResourceContext* context,
const GURL& url, const GURL& url,
@ -227,7 +240,7 @@ index 0378ab3c5013..21b7157f7ac8 100644
const url::Origin& main_frame_origin, const url::Origin& main_frame_origin,
const std::string& mime_type, const std::string& mime_type,
bool allow_wildcard, bool allow_wildcard,
@@ -276,7 +277,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id, @@ -278,7 +279,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
for (size_t i = 0; i < plugins.size(); ++i) { for (size_t i = 0; i < plugins.size(); ++i) {
if (!filter_ || if (!filter_ ||
filter_->IsPluginAvailable(render_process_id, render_frame_id, context, filter_->IsPluginAvailable(render_process_id, render_frame_id, context,
@ -238,7 +251,7 @@ index 0378ab3c5013..21b7157f7ac8 100644
if (actual_mime_type) if (actual_mime_type)
*actual_mime_type = mime_types[i]; *actual_mime_type = mime_types[i];
diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h
index fb9226fd1b1c..0e13f2df47a3 100644 index e6de4ca6c8b3..18eea4948e43 100644
--- content/browser/plugin_service_impl.h --- content/browser/plugin_service_impl.h
+++ content/browser/plugin_service_impl.h +++ content/browser/plugin_service_impl.h
@@ -63,6 +63,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService { @@ -63,6 +63,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService {
@ -250,10 +263,10 @@ index fb9226fd1b1c..0e13f2df47a3 100644
const std::string& mime_type, const std::string& mime_type,
bool allow_wildcard, bool allow_wildcard,
diff --git content/common/frame_messages.h content/common/frame_messages.h diff --git content/common/frame_messages.h content/common/frame_messages.h
index 3e00480ee1bc..34421dcd3c20 100644 index 7bce348a78d4..bc27dbcdda37 100644
--- content/common/frame_messages.h --- content/common/frame_messages.h
+++ content/common/frame_messages.h +++ content/common/frame_messages.h
@@ -1359,8 +1359,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback, @@ -1342,8 +1342,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
// Used to get the list of plugins. |main_frame_origin| is used to handle // Used to get the list of plugins. |main_frame_origin| is used to handle
// exceptions for plugin content settings. // exceptions for plugin content settings.
@ -264,7 +277,7 @@ index 3e00480ee1bc..34421dcd3c20 100644
url::Origin /* main_frame_origin */, url::Origin /* main_frame_origin */,
std::vector<content::WebPluginInfo> /* plugins */) std::vector<content::WebPluginInfo> /* plugins */)
@@ -1368,9 +1369,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins, @@ -1351,9 +1352,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
// type. If there is no matching plugin, |found| is false. // type. If there is no matching plugin, |found| is false.
// |actual_mime_type| is the actual mime type supported by the // |actual_mime_type| is the actual mime type supported by the
// found plugin. // found plugin.
@ -325,7 +338,7 @@ index 3b610b1f554e..7c439e060779 100644
WebPluginInfo* plugin) = 0; WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index 3d34633700dd..b175fff52d6c 100644 index b51a04da8ca0..ca13e9a6a07e 100644
--- content/public/renderer/content_renderer_client.h --- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h +++ content/public/renderer/content_renderer_client.h
@@ -73,6 +73,9 @@ class CONTENT_EXPORT ContentRendererClient { @@ -73,6 +73,9 @@ class CONTENT_EXPORT ContentRendererClient {
@ -338,24 +351,22 @@ index 3d34633700dd..b175fff52d6c 100644
// Notifies that a new RenderFrame has been created. // Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {} virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -331,6 +334,12 @@ class CONTENT_EXPORT ContentRendererClient { @@ -327,6 +330,10 @@ class CONTENT_EXPORT ContentRendererClient {
// This method may invalidate the frame. // This method may invalidate the frame.
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {} virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
+ // Notifies that a DevTools agent has attached or detached. + // Notifies that a DevTools agent has attached or detached.
+ virtual void DevToolsAgentAttached(RenderFrame* render_frame, + virtual void DevToolsAgentAttached() {}
+ int session_id) {} + virtual void DevToolsAgentDetached() {}
+ virtual void DevToolsAgentDetached(RenderFrame* render_frame,
+ int session_id) {}
+ +
// Allows subclasses to enable some runtime features before Blink has // Allows subclasses to enable some runtime features before Blink has
// started. // started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {} virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h diff --git content/public/renderer/render_frame_observer.h content/public/renderer/render_frame_observer.h
index 4f8478bfa87a..52471407518e 100644 index aa77b86eee98..097d26a80aa9 100644
--- content/public/renderer/render_frame_observer.h --- content/public/renderer/render_frame_observer.h
+++ content/public/renderer/render_frame_observer.h +++ content/public/renderer/render_frame_observer.h
@@ -124,6 +124,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, @@ -121,6 +121,9 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
// load. This is used for UseCounter feature metrics. // load. This is used for UseCounter feature metrics.
virtual void DidObserveNewFeatureUsage(blink::mojom::WebFeature feature) {} virtual void DidObserveNewFeatureUsage(blink::mojom::WebFeature feature) {}
@ -365,54 +376,11 @@ index 4f8478bfa87a..52471407518e 100644
// Called when the focused node has changed to |node|. // Called when the focused node has changed to |node|.
virtual void FocusedNodeChanged(const blink::WebNode& node) {} virtual void FocusedNodeChanged(const blink::WebNode& node) {}
diff --git content/renderer/devtools/devtools_agent.cc content/renderer/devtools/devtools_agent.cc
index 685c39f6aca2..cee77800770a 100644
--- content/renderer/devtools/devtools_agent.cc
+++ content/renderer/devtools/devtools_agent.cc
@@ -20,7 +20,9 @@
#include "content/child/child_process.h"
#include "content/common/devtools_messages.h"
#include "content/common/frame_messages.h"
+#include "content/public/common/content_client.h"
#include "content/public/common/manifest.h"
+#include "content/public/renderer/content_renderer_client.h"
#include "content/renderer/devtools/devtools_cpu_throttler.h"
#include "content/renderer/render_frame_impl.h"
#include "content/renderer/render_widget.h"
@@ -218,6 +220,8 @@ void DevToolsAgent::AttachDevToolsSession(
GetWebAgent()->Attach(session_id);
}
+ GetContentClient()->renderer()->DevToolsAgentAttached(frame_, session_id);
+
sessions_[session_id].reset(
new Session(session_id, this, std::move(session)));
@@ -237,6 +241,7 @@ void DevToolsAgent::AttachDevToolsSession(
void DevToolsAgent::DetachSession(int session_id) {
GetWebAgent()->Detach(session_id);
+ GetContentClient()->renderer()->DevToolsAgentDetached(frame_, session_id);
io_sessions_.erase(session_id);
sessions_.erase(session_id);
hosts_.erase(session_id);
@@ -382,8 +387,10 @@ bool DevToolsAgent::IsAttached() {
}
void DevToolsAgent::DetachAllSessions() {
- for (auto& it : hosts_)
+ for (auto& it : hosts_) {
GetWebAgent()->Detach(it.first);
+ GetContentClient()->renderer()->DevToolsAgentDetached(frame_, it.first);
+ }
hosts_.clear();
io_sessions_.clear();
sessions_.clear();
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index 40f9cef599dc..ebbc6078b611 100644 index f341fb4aec24..28f3105f15c0 100644
--- content/renderer/render_frame_impl.cc --- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc +++ content/renderer/render_frame_impl.cc
@@ -3210,7 +3210,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin( @@ -3468,7 +3468,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
std::string mime_type; std::string mime_type;
bool found = false; bool found = false;
Send(new FrameHostMsg_GetPluginInfo( Send(new FrameHostMsg_GetPluginInfo(
@ -422,7 +390,7 @@ index 40f9cef599dc..ebbc6078b611 100644
params.mime_type.Utf8(), &found, &info, &mime_type)); params.mime_type.Utf8(), &found, &info, &mime_type));
if (!found) if (!found)
return nullptr; return nullptr;
@@ -3552,6 +3553,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) { @@ -3824,6 +3825,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
void RenderFrameImpl::FrameFocused() { void RenderFrameImpl::FrameFocused() {
Send(new FrameHostMsg_FrameFocused(routing_id_)); Send(new FrameHostMsg_FrameFocused(routing_id_));
@ -432,10 +400,10 @@ index 40f9cef599dc..ebbc6078b611 100644
void RenderFrameImpl::WillCommitProvisionalLoad() { void RenderFrameImpl::WillCommitProvisionalLoad() {
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index 10b32b1254c6..6ba3dfbe9d15 100644 index f55d956f05ec..ec2292acb1c3 100644
--- content/renderer/render_thread_impl.cc --- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc +++ content/renderer/render_thread_impl.cc
@@ -819,6 +819,8 @@ void RenderThreadImpl::Init( @@ -822,6 +822,8 @@ void RenderThreadImpl::Init(
StartServiceManagerConnection(); StartServiceManagerConnection();
@ -445,10 +413,10 @@ index 10b32b1254c6..6ba3dfbe9d15 100644
base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest, base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
base::Unretained(this))); base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 3cd99e14d1d5..96e8d51625d7 100644 index 561593754e91..18273663e17e 100644
--- content/renderer/renderer_blink_platform_impl.cc --- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc +++ content/renderer/renderer_blink_platform_impl.cc
@@ -846,6 +846,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor( @@ -842,6 +842,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor(
void RendererBlinkPlatformImpl::GetPluginList( void RendererBlinkPlatformImpl::GetPluginList(
bool refresh, bool refresh,
@ -456,7 +424,7 @@ index 3cd99e14d1d5..96e8d51625d7 100644
const blink::WebSecurityOrigin& mainFrameOrigin, const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) { blink::WebPluginListBuilder* builder) {
#if BUILDFLAG(ENABLE_PLUGINS) #if BUILDFLAG(ENABLE_PLUGINS)
@@ -853,7 +854,8 @@ void RendererBlinkPlatformImpl::GetPluginList( @@ -849,7 +850,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
if (!plugin_refresh_allowed_) if (!plugin_refresh_allowed_)
refresh = false; refresh = false;
RenderThread::Get()->Send( RenderThread::Get()->Send(
@ -466,11 +434,26 @@ index 3cd99e14d1d5..96e8d51625d7 100644
for (const WebPluginInfo& plugin : plugins) { for (const WebPluginInfo& plugin : plugins) {
builder->AddPlugin(WebString::FromUTF16(plugin.name), builder->AddPlugin(WebString::FromUTF16(plugin.name),
WebString::FromUTF16(plugin.desc), WebString::FromUTF16(plugin.desc),
@@ -1424,6 +1426,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() {
base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
}
+void RendererBlinkPlatformImpl::DevToolsAgentAttached() {
+ GetContentClient()->renderer()->DevToolsAgentAttached();
+}
+
+void RendererBlinkPlatformImpl::DevToolsAgentDetached() {
+ GetContentClient()->renderer()->DevToolsAgentDetached();
+}
+
void RendererBlinkPlatformImpl::InitializeWebDatabaseHostIfNeeded() {
if (!web_database_host_) {
web_database_host_ = blink::mojom::ThreadSafeWebDatabaseHostPtr::Create(
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index 72649102bfcc..6067abc4c8c0 100644 index 65ddfde81aff..d92a0b316270 100644
--- content/renderer/renderer_blink_platform_impl.h --- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h +++ content/renderer/renderer_blink_platform_impl.h
@@ -130,6 +130,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { @@ -128,6 +128,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
viz::FrameSinkId GenerateFrameSinkId() override; viz::FrameSinkId GenerateFrameSinkId() override;
void GetPluginList(bool refresh, void GetPluginList(bool refresh,
@ -478,6 +461,16 @@ index 72649102bfcc..6067abc4c8c0 100644
const blink::WebSecurityOrigin& mainFrameOrigin, const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) override; blink::WebPluginListBuilder* builder) override;
blink::WebPublicSuffixList* PublicSuffixList() override; blink::WebPublicSuffixList* PublicSuffixList() override;
@@ -258,6 +259,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
mojo::ScopedDataPipeConsumerHandle handle) override;
void RequestPurgeMemory() override;
+ void DevToolsAgentAttached() override;
+ void DevToolsAgentDetached() override;
+
// Returns non-null.
// It is invalid to call this in an incomplete env where
// RenderThreadImpl::current() returns nullptr (e.g. in some tests).
diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc
index 3a48c59b7e3e..d10ef64adbba 100644 index 3a48c59b7e3e..d10ef64adbba 100644
--- content/shell/browser/shell_plugin_service_filter.cc --- content/shell/browser/shell_plugin_service_filter.cc
@ -527,10 +520,10 @@ index db23a83ed079..57a4c536118c 100644
const std::string& mime_type, const std::string& mime_type,
bool allow_wildcard, bool allow_wildcard,
diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc
index cb545a4ddea4..f21d056e50a2 100644 index ae5e6942fe34..a8fead11a023 100644
--- content/test/test_blink_web_unit_test_support.cc --- content/test/test_blink_web_unit_test_support.cc
+++ content/test/test_blink_web_unit_test_support.cc +++ content/test/test_blink_web_unit_test_support.cc
@@ -318,6 +318,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() { @@ -325,6 +325,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() {
void TestBlinkWebUnitTestSupport::GetPluginList( void TestBlinkWebUnitTestSupport::GetPluginList(
bool refresh, bool refresh,
@ -539,10 +532,10 @@ index cb545a4ddea4..f21d056e50a2 100644
blink::WebPluginListBuilder* builder) { blink::WebPluginListBuilder* builder) {
builder->AddPlugin("pdf", "pdf", "pdf-files"); builder->AddPlugin("pdf", "pdf", "pdf-files");
diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h diff --git content/test/test_blink_web_unit_test_support.h content/test/test_blink_web_unit_test_support.h
index 200f40eb51f5..afba549f0cdf 100644 index 9b5c0a94fa7f..f31678481f0f 100644
--- content/test/test_blink_web_unit_test_support.h --- content/test/test_blink_web_unit_test_support.h
+++ content/test/test_blink_web_unit_test_support.h +++ content/test/test_blink_web_unit_test_support.h
@@ -70,6 +70,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl { @@ -72,6 +72,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {
const blink::WebSize& size) override; const blink::WebSize& size) override;
void GetPluginList(bool refresh, void GetPluginList(bool refresh,

View File

@ -1,5 +1,5 @@
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
index 631772316423..f00a94403c61 100644 index 5e0eabb..f862908 100644
--- chrome/common/crash_keys.cc --- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc +++ chrome/common/crash_keys.cc
@@ -4,6 +4,8 @@ @@ -4,6 +4,8 @@
@ -10,45 +10,17 @@ index 631772316423..f00a94403c61 100644
+ +
#include "base/base_switches.h" #include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/format_macros.h" #include "base/logging.h"
@@ -84,7 +86,7 @@ const char kViewCount[] = "view-count"; @@ -26,7 +28,7 @@
const char kUserCloudPolicyManagerConnectTrace[] =
"user-cloud-policy-manager-connect-trace";
-size_t RegisterChromeCrashKeys() { namespace crash_keys {
+void GetChromeCrashKeys(std::vector<base::debug::CrashKey>& keys) {
// The following keys may be chunked by the underlying crash logging system,
// but ultimately constitute a single key-value pair.
//
@@ -200,10 +202,16 @@ size_t RegisterChromeCrashKeys() {
// This dynamic set of keys is used for sets of key value pairs when gathering
// a collection of data, like command line switches or extension IDs.
- std::vector<base::debug::CrashKey> keys(
- fixed_keys, fixed_keys + arraysize(fixed_keys));
+ keys.reserve(keys.size() + arraysize(fixed_keys));
+ std::copy(fixed_keys, fixed_keys + arraysize(fixed_keys),
+ std::back_inserter(keys));
crash_keys::GetCrashKeysForCommandLineSwitches(&keys);
+}
+
+size_t RegisterChromeCrashKeys() {
+ std::vector<base::debug::CrashKey> keys;
+ GetChromeCrashKeys(keys);
// Register the extension IDs.
{
@@ -237,7 +245,7 @@ size_t RegisterChromeCrashKeys() {
return base::debug::InitCrashKeys(&keys.at(0), keys.size(), kChunkMaxLength);
}
-static bool IsBoringSwitch(const std::string& flag) { -static bool IsBoringSwitch(const std::string& flag) {
+bool IsBoringChromeSwitch(const std::string& flag) { +bool IsBoringChromeSwitch(const std::string& flag) {
static const char* const kIgnoreSwitches[] = { static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging, switches::kEnableLogging,
switches::kFlagSwitchesBegin, switches::kFlagSwitchesBegin,
@@ -292,7 +300,7 @@ static bool IsBoringSwitch(const std::string& flag) { @@ -81,7 +83,7 @@ static bool IsBoringSwitch(const std::string& flag) {
} }
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) { void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
@ -58,30 +30,22 @@ index 631772316423..f00a94403c61 100644
void SetActiveExtensions(const std::set<std::string>& extensions) { void SetActiveExtensions(const std::set<std::string>& extensions) {
diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
index 38e43f247477..62fe45582661 100644 index a18c8fc..011bcc2 100644
--- chrome/common/crash_keys.h --- chrome/common/crash_keys.h
+++ chrome/common/crash_keys.h +++ chrome/common/crash_keys.h
@@ -22,10 +22,18 @@ class CommandLine; @@ -16,6 +16,10 @@ class CommandLine;
}
namespace crash_keys { namespace crash_keys {
+// Returns the list of potential crash keys that can be sent to the crash
+// server.
+void GetChromeCrashKeys(std::vector<base::debug::CrashKey>& keys);
+ +
// Registers all of the potential crash keys that can be sent to the crash
// reporting server. Returns the size of the union of all keys.
size_t RegisterChromeCrashKeys();
+// Returns true if the specified command-line flag should be excluded from +// Returns true if the specified command-line flag should be excluded from
+// crash reporting. +// crash reporting.
+bool IsBoringChromeSwitch(const std::string& flag); +bool IsBoringChromeSwitch(const std::string& flag);
+
// Sets the kNumSwitches key and the set of keys named using kSwitchFormat based // Sets the kNumSwitches key and the set of keys named using kSwitchFormat based
// on the given |command_line|. // on the given |command_line|.
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line);
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
index 60c6636bddf2..7e582f797653 100644 index fd5a28b..df46cb0 100644
--- chrome_elf/BUILD.gn --- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn +++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
@ -92,7 +56,7 @@ index 60c6636bddf2..7e582f797653 100644
import("//chrome/process_version_rc_template.gni") import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni") import("//testing/test.gni")
@@ -174,9 +175,6 @@ static_library("blacklist") { @@ -181,9 +182,6 @@ static_library("blacklist") {
static_library("crash") { static_library("crash") {
sources = [ sources = [
@ -102,7 +66,7 @@ index 60c6636bddf2..7e582f797653 100644
"crash/crash_helper.cc", "crash/crash_helper.cc",
"crash/crash_helper.h", "crash/crash_helper.h",
] ]
@@ -184,6 +182,7 @@ static_library("crash") { @@ -191,6 +189,7 @@ static_library("crash") {
":hook_util", ":hook_util",
"//base", # This needs to go. DEP of app, crash_keys, client. "//base", # This needs to go. DEP of app, crash_keys, client.
"//base:base_static", # pe_image "//base:base_static", # pe_image
@ -110,8 +74,8 @@ index 60c6636bddf2..7e582f797653 100644
"//chrome/install_static:install_static_util", "//chrome/install_static:install_static_util",
"//components/crash/content/app", "//components/crash/content/app",
"//components/crash/core/common", # crash_keys "//components/crash/core/common", # crash_keys
@@ -192,6 +191,17 @@ static_library("crash") { @@ -198,6 +197,17 @@ static_library("crash") {
"//gpu/config:crash_keys", "//content/public/common:result_codes",
"//third_party/crashpad/crashpad/client", # DumpWithoutCrash "//third_party/crashpad/crashpad/client", # DumpWithoutCrash
] ]
+ +
@ -129,7 +93,7 @@ index 60c6636bddf2..7e582f797653 100644
static_library("hook_util") { static_library("hook_util") {
diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc
index e8e27dc4ebd7..7cb2149ec41d 100644 index e8e27dc..7cb2149 100644
--- chrome_elf/crash/crash_helper.cc --- chrome_elf/crash/crash_helper.cc
+++ chrome_elf/crash/crash_helper.cc +++ chrome_elf/crash/crash_helper.cc
@@ -11,12 +11,17 @@ @@ -11,12 +11,17 @@
@ -163,18 +127,18 @@ index e8e27dc4ebd7..7cb2149ec41d 100644
g_crash_helper_enabled = true; g_crash_helper_enabled = true;
return true; return true;
diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc
index 42a50e8381c1..718f945573a3 100644 index c72cd36..e9a79dd 100644
--- components/crash/content/app/breakpad_linux.cc --- components/crash/content/app/breakpad_linux.cc
+++ components/crash/content/app/breakpad_linux.cc +++ components/crash/content/app/breakpad_linux.cc
@@ -29,6 +29,7 @@ @@ -28,6 +28,7 @@
#include "base/base_switches.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/debug/crash_logging.h"
#include "base/debug/dump_without_crashing.h" #include "base/debug/dump_without_crashing.h"
+#include "base/debug/leak_annotations.h" +#include "base/debug/leak_annotations.h"
#include "base/files/file_path.h" #include "base/files/file_path.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/linux_util.h" #include "base/linux_util.h"
@@ -89,6 +90,7 @@ namespace { @@ -88,6 +89,7 @@ namespace {
#if !defined(OS_CHROMEOS) #if !defined(OS_CHROMEOS)
const char kUploadURL[] = "https://clients2.google.com/cr/report"; const char kUploadURL[] = "https://clients2.google.com/cr/report";
@ -182,7 +146,7 @@ index 42a50e8381c1..718f945573a3 100644
#endif #endif
bool g_is_crash_reporter_enabled = false; bool g_is_crash_reporter_enabled = false;
@@ -686,7 +688,7 @@ bool CrashDone(const MinidumpDescriptor& minidump, @@ -685,7 +687,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
info.process_type_length = 7; info.process_type_length = 7;
info.distro = base::g_linux_distro; info.distro = base::g_linux_distro;
info.distro_length = my_strlen(base::g_linux_distro); info.distro_length = my_strlen(base::g_linux_distro);
@ -191,7 +155,7 @@ index 42a50e8381c1..718f945573a3 100644
info.process_start_time = g_process_start_time; info.process_start_time = g_process_start_time;
info.oom_size = base::g_oom_size; info.oom_size = base::g_oom_size;
info.pid = g_pid; info.pid = g_pid;
@@ -1356,7 +1358,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info, @@ -1341,7 +1343,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
header_content_encoding, header_content_encoding,
header_content_type, header_content_type,
post_file, post_file,
@ -200,16 +164,16 @@ index 42a50e8381c1..718f945573a3 100644
"--timeout=10", // Set a timeout so we don't hang forever. "--timeout=10", // Set a timeout so we don't hang forever.
"--tries=1", // Don't retry if the upload fails. "--tries=1", // Don't retry if the upload fails.
"-O", // Output reply to the file descriptor path. "-O", // Output reply to the file descriptor path.
@@ -1696,10 +1698,19 @@ void HandleCrashDump(const BreakpadInfo& info) { @@ -1681,10 +1683,19 @@ void HandleCrashDump(const BreakpadInfo& info) {
GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version); GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version);
writer.AddBoundary(); writer.AddBoundary();
- writer.AddPairString("prod", product_name); - writer.AddPairString("prod", product_name);
+ writer.AddPairString("product", product_name); + writer.AddPairString("product", product_name);
writer.AddBoundary(); + writer.AddBoundary();
- writer.AddPairString("ver", version);
+ writer.AddPairString("version", version); + writer.AddPairString("version", version);
writer.AddBoundary(); writer.AddBoundary();
- writer.AddPairString("ver", version);
+ +
+#if defined(ARCH_CPU_32_BITS) +#if defined(ARCH_CPU_32_BITS)
+ const char* platform = "linux32"; + const char* platform = "linux32";
@ -217,13 +181,35 @@ index 42a50e8381c1..718f945573a3 100644
+ const char* platform = "linux64"; + const char* platform = "linux64";
+#endif +#endif
+ writer.AddPairString("platform", platform); + writer.AddPairString("platform", platform);
+ writer.AddBoundary(); writer.AddBoundary();
+ +
if (info.pid > 0) { if (info.pid > 0) {
char pid_value_buf[kUint64StringSize]; char pid_value_buf[kUint64StringSize];
uint64_t pid_value_len = my_uint64_len(info.pid); uint64_t pid_value_len = my_uint64_len(info.pid);
@@ -2017,6 +2028,17 @@ void InitCrashReporter(const std::string& process_type) { @@ -1789,10 +1800,20 @@ void HandleCrashDump(const BreakpadInfo& info) {
PostEnableBreakpadInitialization(); crash_reporter::internal::TransitionalCrashKeyStorage;
CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys);
const CrashKeyStorage::Entry* entry;
+
+ crash_reporter::CrashReporterClient::ParameterMap parameters;
+
while ((entry = crash_key_iterator.Next())) {
if (g_use_crash_key_white_list && !IsInWhiteList(entry->key))
continue;
- writer.AddPairString(entry->key, entry->value);
+ parameters.insert(std::make_pair(entry->key, entry->value));
+ }
+
+ if (!parameters.empty())
+ parameters = GetCrashReporterClient()->FilterParameters(parameters);
+
+ for (const auto& param : parameters) {
+ writer.AddPairString(param.first.c_str(), param.second.c_str());
writer.AddBoundary();
writer.Flush();
}
@@ -2002,6 +2023,17 @@ void SetChannelCrashKey(const std::string& channel) {
channel_key.Set(channel);
} }
+void SetCrashServerURL(const std::string& url) { +void SetCrashServerURL(const std::string& url) {
@ -241,12 +227,12 @@ index 42a50e8381c1..718f945573a3 100644
void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) { void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) {
SanitizationInfo sanitization_info; SanitizationInfo sanitization_info;
diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h
index 4a2a429fc052..70f3adbc73cf 100644 index 9ee8555..7af55dd 100644
--- components/crash/content/app/breakpad_linux.h --- components/crash/content/app/breakpad_linux.h
+++ components/crash/content/app/breakpad_linux.h +++ components/crash/content/app/breakpad_linux.h
@@ -16,6 +16,9 @@ namespace breakpad { @@ -19,6 +19,9 @@ extern void InitCrashReporter(const std::string& process_type);
// Turns on the crash reporter in any process. // Sets the product/distribution channel crash key.
extern void InitCrashReporter(const std::string& process_type); void SetChannelCrashKey(const std::string& channel);
+// Set the crash server URL. +// Set the crash server URL.
+void SetCrashServerURL(const std::string& url); +void SetCrashServerURL(const std::string& url);
@ -255,7 +241,7 @@ index 4a2a429fc052..70f3adbc73cf 100644
extern void InitCrashKeysForTesting(); extern void InitCrashKeysForTesting();
diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc
index 72849b964f1c..6a78f9b9c832 100644 index a37619c..e13a0f7 100644
--- components/crash/content/app/crash_reporter_client.cc --- components/crash/content/app/crash_reporter_client.cc
+++ components/crash/content/app/crash_reporter_client.cc +++ components/crash/content/app/crash_reporter_client.cc
@@ -88,11 +88,12 @@ int CrashReporterClient::GetResultCodeRespawnFailed() { @@ -88,11 +88,12 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
@ -280,7 +266,7 @@ index 72849b964f1c..6a78f9b9c832 100644
#if defined(OS_WIN) #if defined(OS_WIN)
bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) { bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) {
@@ -149,6 +151,32 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) { @@ -145,6 +147,32 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
} }
#endif #endif
@ -313,29 +299,36 @@ index 72849b964f1c..6a78f9b9c832 100644
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
int CrashReporterClient::GetAndroidMinidumpDescriptor() { int CrashReporterClient::GetAndroidMinidumpDescriptor() {
return 0; return 0;
@@ -179,9 +207,4 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() { @@ -175,9 +203,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
} }
#endif #endif
-bool CrashReporterClient::EnableBreakpadForProcess( -bool CrashReporterClient::EnableBreakpadForProcess(
- const std::string& process_type) { - const std::string& process_type) {
- return false; - return false;
-} +#if defined(OS_POSIX) && !defined(OS_MACOSX)
- +CrashReporterClient::ParameterMap
+CrashReporterClient::FilterParameters(const ParameterMap& parameters) {
+ return parameters;
}
+#endif
} // namespace crash_reporter } // namespace crash_reporter
diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h
index d2a805289c0d..25d026583c37 100644 index 75d3d6d..aa86f45 100644
--- components/crash/content/app/crash_reporter_client.h --- components/crash/content/app/crash_reporter_client.h
+++ components/crash/content/app/crash_reporter_client.h +++ components/crash/content/app/crash_reporter_client.h
@@ -8,6 +8,7 @@ @@ -5,7 +5,9 @@
#include <stddef.h> #ifndef COMPONENTS_CRASH_CONTENT_APP_CRASH_REPORTER_CLIENT_H_
#define COMPONENTS_CRASH_CONTENT_APP_CRASH_REPORTER_CLIENT_H_
+#include <map>
#include <string> #include <string>
+#include <vector> +#include <vector>
#include "base/strings/string16.h" #include "base/strings/string16.h"
#include "build/build_config.h" #include "build/build_config.h"
@@ -93,12 +94,13 @@ class CrashReporterClient { @@ -91,12 +93,13 @@ class CrashReporterClient {
virtual int GetResultCodeRespawnFailed(); virtual int GetResultCodeRespawnFailed();
#endif #endif
@ -350,15 +343,15 @@ index d2a805289c0d..25d026583c37 100644
virtual base::FilePath GetReporterLogFilename(); virtual base::FilePath GetReporterLogFilename();
// Custom crash minidump handler after the minidump is generated. // Custom crash minidump handler after the minidump is generated.
@@ -107,6 +109,7 @@ class CrashReporterClient { @@ -106,6 +109,7 @@ class CrashReporterClient {
// WARNING: this handler runs in a compromised context. It may not call into
// libc nor allocate memory normally. // libc nor allocate memory normally.
virtual bool HandleCrashDump(const char* crashdump_filename); virtual bool HandleCrashDump(const char* crashdump_filename);
+#endif
#endif #endif
+#endif
// The location where minidump files should be written. Returns true if // The location where minidump files should be written. Returns true if
@@ -186,6 +189,23 @@ class CrashReporterClient { // |crash_dir| was set. Windows has to use base::string16 because this code
@@ -180,6 +184,30 @@ class CrashReporterClient {
// Returns true if breakpad should run in the given process type. // Returns true if breakpad should run in the given process type.
virtual bool EnableBreakpadForProcess(const std::string& process_type); virtual bool EnableBreakpadForProcess(const std::string& process_type);
@ -378,26 +371,33 @@ index d2a805289c0d..25d026583c37 100644
+ // Returns true if forwarding of crashes to the system crash reporter is + // Returns true if forwarding of crashes to the system crash reporter is
+ // enabled for the browser process. + // enabled for the browser process.
+ virtual bool EnableBrowserCrashForwarding(); + virtual bool EnableBrowserCrashForwarding();
+#endif
+
+#if defined(OS_POSIX) && !defined(OS_MACOSX)
+ // Provides an oportunity to modify the parameters that will be sent with a
+ // crash upload.
+ using ParameterMap = std::map<std::string, std::string>;
+ virtual ParameterMap FilterParameters(const ParameterMap& parameters);
+#endif +#endif
}; };
} // namespace crash_reporter } // namespace crash_reporter
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
index 6949d5e7dcc4..d9b052382a6a 100644 index dde11ea..1a1f8b0 100644
--- components/crash/content/app/crashpad.cc --- components/crash/content/app/crashpad.cc
+++ components/crash/content/app/crashpad.cc +++ components/crash/content/app/crashpad.cc
@@ -137,7 +137,8 @@ void InitializeCrashpadImpl(bool initial_client, @@ -133,7 +133,8 @@ void InitializeCrashpadImpl(bool initial_client,
// fallback. Forwarding is turned off for debug-mode builds even for the // fallback. Forwarding is turned off for debug-mode builds even for the
// browser process, because the system's crash reporter can take a very long // browser process, because the system's crash reporter can take a very long
// time to chew on symbols. // time to chew on symbols.
- if (!browser_process || is_debug_build) { - if (!browser_process || is_debug_build) {
+ if (!browser_process || is_debug_build || + if (!browser_process || is_debug_build ||
+ !crash_reporter_client->EnableBrowserCrashForwarding()) { + !crash_reporter_client->EnableBrowserCrashForwarding()) {
crashpad_info->set_system_crash_reporter_forwarding( crashpad::CrashpadInfo::GetCrashpadInfo()
crashpad::TriState::kDisabled); ->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
} }
diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm
index 485c2b4b3e98..3b5f3eaa3926 100644 index 6508c2a..f51ce5a 100644
--- components/crash/content/app/crashpad_mac.mm --- components/crash/content/app/crashpad_mac.mm
+++ components/crash/content/app/crashpad_mac.mm +++ components/crash/content/app/crashpad_mac.mm
@@ -16,11 +16,14 @@ @@ -16,11 +16,14 @@
@ -415,7 +415,7 @@ index 485c2b4b3e98..3b5f3eaa3926 100644
#include "third_party/crashpad/crashpad/client/crash_report_database.h" #include "third_party/crashpad/crashpad/client/crash_report_database.h"
#include "third_party/crashpad/crashpad/client/crashpad_client.h" #include "third_party/crashpad/crashpad/client/crashpad_client.h"
#include "third_party/crashpad/crashpad/client/crashpad_info.h" #include "third_party/crashpad/crashpad/client/crashpad_info.h"
@@ -42,9 +45,10 @@ base::FilePath PlatformCrashpadInitialization( @@ -41,9 +44,10 @@ base::FilePath PlatformCrashpadInitialization(
if (initial_client) { if (initial_client) {
@autoreleasepool { @autoreleasepool {
@ -429,7 +429,7 @@ index 485c2b4b3e98..3b5f3eaa3926 100644
// Is there a way to recover if this fails? // Is there a way to recover if this fails?
CrashReporterClient* crash_reporter_client = GetCrashReporterClient(); CrashReporterClient* crash_reporter_client = GetCrashReporterClient();
@@ -56,16 +60,27 @@ base::FilePath PlatformCrashpadInitialization( @@ -55,16 +59,27 @@ base::FilePath PlatformCrashpadInitialization(
// crash server won't have symbols for any other build types. // crash server won't have symbols for any other build types.
std::string url = "https://clients2.google.com/cr/report"; std::string url = "https://clients2.google.com/cr/report";
#else #else
@ -462,7 +462,7 @@ index 485c2b4b3e98..3b5f3eaa3926 100644
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
// Empty means stable. // Empty means stable.
@@ -81,12 +96,16 @@ base::FilePath PlatformCrashpadInitialization( @@ -80,12 +95,16 @@ base::FilePath PlatformCrashpadInitialization(
process_annotations["channel"] = ""; process_annotations["channel"] = "";
} }
@ -484,7 +484,7 @@ index 485c2b4b3e98..3b5f3eaa3926 100644
std::vector<std::string> arguments; std::vector<std::string> arguments;
@@ -108,6 +127,12 @@ base::FilePath PlatformCrashpadInitialization( @@ -107,6 +126,12 @@ base::FilePath PlatformCrashpadInitialization(
"--reset-own-crash-exception-port-to-system-default"); "--reset-own-crash-exception-port-to-system-default");
} }
@ -498,7 +498,7 @@ index 485c2b4b3e98..3b5f3eaa3926 100644
handler_path, database_path, metrics_path, url, process_annotations, handler_path, database_path, metrics_path, url, process_annotations,
arguments, true, false); arguments, true, false);
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
index 3a33c9bb8e92..961d600f7452 100644 index a5d1afc..91815d9 100644
--- components/crash/content/app/crashpad_win.cc --- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc +++ components/crash/content/app/crashpad_win.cc
@@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations( @@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations(
@ -568,7 +568,7 @@ index 3a33c9bb8e92..961d600f7452 100644
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) { if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
index 46954327b9c7..62a7ce8d4e46 100644 index 4695432..62a7ce8 100644
--- content/browser/frame_host/debug_urls.cc --- content/browser/frame_host/debug_urls.cc
+++ content/browser/frame_host/debug_urls.cc +++ content/browser/frame_host/debug_urls.cc
@@ -139,7 +139,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) { @@ -139,7 +139,9 @@ bool HandleDebugURL(const GURL& url, ui::PageTransition transition) {

View File

@ -146,7 +146,7 @@ index b64f74fbaf28..0c3c22e215b6 100644
struct Data; struct Data;
diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn
index 05f554b73036..5b6d1a2a98e1 100644 index 71037bb04d5d..61f7e8ca04ca 100644
--- third_party/crashpad/crashpad/handler/BUILD.gn --- third_party/crashpad/crashpad/handler/BUILD.gn
+++ third_party/crashpad/crashpad/handler/BUILD.gn +++ third_party/crashpad/crashpad/handler/BUILD.gn
@@ -12,6 +12,7 @@ @@ -12,6 +12,7 @@
@ -154,13 +154,13 @@ index 05f554b73036..5b6d1a2a98e1 100644
# limitations under the License. # limitations under the License.
+import("//cef/libcef/features/features.gni") +import("//cef/libcef/features/features.gni")
import("//testing/test.gni") import("../build/crashpad_buildconfig.gni")
static_library("handler") { static_library("handler") {
@@ -56,8 +57,18 @@ static_library("handler") { @@ -75,8 +76,20 @@ static_library("handler") {
"../third_party/mini_chromium:base",
"../tools:tool_support", "../tools:tool_support",
"../util", "../util",
"//base",
+ "//cef/libcef/features", + "//cef/libcef/features",
] ]
@ -168,19 +168,42 @@ index 05f554b73036..5b6d1a2a98e1 100644
+ sources += [ + sources += [
+ "//cef/libcef/common/cef_crash_report_upload_thread.cc", + "//cef/libcef/common/cef_crash_report_upload_thread.cc",
+ "//cef/libcef/common/cef_crash_report_upload_thread.h", + "//cef/libcef/common/cef_crash_report_upload_thread.h",
+ "//cef/libcef/common/cef_crash_report_utils.cc",
+ "//cef/libcef/common/cef_crash_report_utils.h",
+ ] + ]
+ +
+ configs += [ "//cef/libcef/features:config" ] + configs += [ "//cef/libcef/features:config" ]
+ } + }
+ +
if (is_win) { if (crashpad_is_win) {
cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union cflags = [ "/wd4201" ] # nonstandard extension used : nameless struct/union
} }
diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
index 7505524b693b..4f8ceaa43bd6 100644
--- third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
+++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.cc
@@ -302,6 +302,8 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
if (minidump_process_snapshot.Initialize(&minidump_file_reader)) {
parameters =
BreakpadHTTPFormParametersFromMinidump(&minidump_process_snapshot);
+ if (!parameters.empty())
+ parameters = FilterParameters(parameters);
}
if (!minidump_file_reader.SeekSet(start_offset)) {
diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.h third_party/crashpad/crashpad/handler/crash_report_upload_thread.h diff --git third_party/crashpad/crashpad/handler/crash_report_upload_thread.h third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
index cdd1502b7e2f..db47f0a8b559 100644 index cdd1502b7e2f..cb8450a892ba 100644
--- third_party/crashpad/crashpad/handler/crash_report_upload_thread.h --- third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
+++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.h +++ third_party/crashpad/crashpad/handler/crash_report_upload_thread.h
@@ -99,7 +99,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate { @@ -15,6 +15,7 @@
#ifndef CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_
#define CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_
+#include <map>
#include <memory>
#include <string>
@@ -99,7 +100,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! This method may be called from any thread. //! This method may be called from any thread.
void ReportPending(const UUID& report_uuid); void ReportPending(const UUID& report_uuid);
@ -189,7 +212,7 @@ index cdd1502b7e2f..db47f0a8b559 100644
//! \brief The result code from UploadReport(). //! \brief The result code from UploadReport().
enum class UploadResult { enum class UploadResult {
//! \brief The crash report was uploaded successfully. //! \brief The crash report was uploaded successfully.
@@ -127,7 +127,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate { @@ -127,7 +128,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! object was constructed with \a watch_pending_reports, it will also scan //! object was constructed with \a watch_pending_reports, it will also scan
//! the crash report database for other pending reports, and process those as //! the crash report database for other pending reports, and process those as
//! well. //! well.
@ -198,7 +221,7 @@ index cdd1502b7e2f..db47f0a8b559 100644
//! \brief Processes a single pending report from the database. //! \brief Processes a single pending report from the database.
//! //!
@@ -141,7 +141,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate { @@ -141,7 +142,7 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
//! remain in the “pending” state. If the upload fails and no more retries are //! remain in the “pending” state. If the upload fails and no more retries are
//! desired, or report upload is disabled, it will be marked as “completed” in //! desired, or report upload is disabled, it will be marked as “completed” in
//! the database without ever having been uploaded. //! the database without ever having been uploaded.
@ -207,8 +230,20 @@ index cdd1502b7e2f..db47f0a8b559 100644
//! \brief Attempts to upload a crash report. //! \brief Attempts to upload a crash report.
//! //!
@@ -158,6 +159,11 @@ class CrashReportUploadThread : public WorkerThread::Delegate {
UploadResult UploadReport(const CrashReportDatabase::Report* report,
std::string* response_body);
+ using ParameterMap = std::map<std::string, std::string>;
+ virtual ParameterMap FilterParameters(const ParameterMap& parameters) {
+ return parameters;
+ }
+
// WorkerThread::Delegate:
//! \brief Calls ProcessPendingReports() in response to ReportPending() having
//! been called on any thread, as well as periodically on a timer.
diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc diff --git third_party/crashpad/crashpad/handler/handler_main.cc third_party/crashpad/crashpad/handler/handler_main.cc
index 2e46f86a6522..faf4f1072ad0 100644 index f175fddf6084..d6285bbf28bf 100644
--- third_party/crashpad/crashpad/handler/handler_main.cc --- third_party/crashpad/crashpad/handler/handler_main.cc
+++ third_party/crashpad/crashpad/handler/handler_main.cc +++ third_party/crashpad/crashpad/handler/handler_main.cc
@@ -35,8 +35,10 @@ @@ -35,8 +35,10 @@
@ -222,8 +257,8 @@ index 2e46f86a6522..faf4f1072ad0 100644
#include "client/crash_report_database.h" #include "client/crash_report_database.h"
#include "client/crashpad_client.h" #include "client/crashpad_client.h"
#include "client/crashpad_info.h" #include "client/crashpad_info.h"
@@ -76,6 +78,10 @@ @@ -79,6 +81,10 @@
#include "util/win/session_end_watcher.h" #include "handler/fuchsia/exception_handler_server.h"
#endif // OS_MACOSX #endif // OS_MACOSX
+#if BUILDFLAG(ENABLE_CEF) +#if BUILDFLAG(ENABLE_CEF)
@ -233,7 +268,7 @@ index 2e46f86a6522..faf4f1072ad0 100644
namespace crashpad { namespace crashpad {
namespace { namespace {
@@ -151,6 +157,9 @@ struct Options { @@ -154,6 +160,9 @@ struct Options {
bool periodic_tasks; bool periodic_tasks;
bool rate_limit; bool rate_limit;
bool upload_gzip; bool upload_gzip;
@ -243,7 +278,7 @@ index 2e46f86a6522..faf4f1072ad0 100644
}; };
// Splits |key_value| on '=' and inserts the resulting key and value into |map|. // Splits |key_value| on '=' and inserts the resulting key and value into |map|.
@@ -438,6 +447,9 @@ int HandlerMain(int argc, @@ -451,6 +460,9 @@ int HandlerMain(int argc,
kOptionResetOwnCrashExceptionPortToSystemDefault, kOptionResetOwnCrashExceptionPortToSystemDefault,
#endif // OS_MACOSX #endif // OS_MACOSX
kOptionURL, kOptionURL,
@ -253,7 +288,7 @@ index 2e46f86a6522..faf4f1072ad0 100644
// Standard options. // Standard options.
kOptionHelp = -2, kOptionHelp = -2,
@@ -488,6 +500,9 @@ int HandlerMain(int argc, @@ -501,6 +513,9 @@ int HandlerMain(int argc,
{"url", required_argument, nullptr, kOptionURL}, {"url", required_argument, nullptr, kOptionURL},
{"help", no_argument, nullptr, kOptionHelp}, {"help", no_argument, nullptr, kOptionHelp},
{"version", no_argument, nullptr, kOptionVersion}, {"version", no_argument, nullptr, kOptionVersion},
@ -263,7 +298,7 @@ index 2e46f86a6522..faf4f1072ad0 100644
{nullptr, 0, nullptr, 0}, {nullptr, 0, nullptr, 0},
}; };
@@ -592,6 +607,27 @@ int HandlerMain(int argc, @@ -605,6 +620,27 @@ int HandlerMain(int argc,
options.url = optarg; options.url = optarg;
break; break;
} }
@ -291,7 +326,7 @@ index 2e46f86a6522..faf4f1072ad0 100644
case kOptionHelp: { case kOptionHelp: {
Usage(me); Usage(me);
MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly); MetricsRecordExit(Metrics::LifetimeMilestone::kExitedEarly);
@@ -757,15 +793,23 @@ int HandlerMain(int argc, @@ -772,15 +808,23 @@ int HandlerMain(int argc,
upload_thread_options.rate_limit = options.rate_limit; upload_thread_options.rate_limit = options.rate_limit;
upload_thread_options.upload_gzip = options.upload_gzip; upload_thread_options.upload_gzip = options.upload_gzip;
upload_thread_options.watch_pending_reports = options.periodic_tasks; upload_thread_options.watch_pending_reports = options.periodic_tasks;

View File

@ -1,8 +1,8 @@
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index 72ffe59f522b..dcefb6cd9bb4 100644 index 36525162ff0e..db28486fa6c0 100644
--- content/browser/devtools/devtools_http_handler.cc --- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc +++ content/browser/devtools/devtools_http_handler.cc
@@ -504,7 +504,7 @@ void DevToolsHttpHandler::OnJsonRequest( @@ -503,7 +503,7 @@ void DevToolsHttpHandler::OnJsonRequest(
version.SetString("Protocol-Version", version.SetString("Protocol-Version",
DevToolsAgentHost::GetProtocolVersion()); DevToolsAgentHost::GetProtocolVersion());
version.SetString("WebKit-Version", GetWebKitVersion()); version.SetString("WebKit-Version", GetWebKitVersion());
@ -12,10 +12,10 @@ index 72ffe59f522b..dcefb6cd9bb4 100644
version.SetString("V8-Version", V8_VERSION_STRING); version.SetString("V8-Version", V8_VERSION_STRING);
std::string host = info.headers["host"]; std::string host = info.headers["host"];
diff --git content/public/common/content_client.h content/public/common/content_client.h diff --git content/public/common/content_client.h content/public/common/content_client.h
index 48ca775aa88e..cb268f412f61 100644 index ea3c1ef6bb61..0c7d3199050f 100644
--- content/public/common/content_client.h --- content/public/common/content_client.h
+++ content/public/common/content_client.h +++ content/public/common/content_client.h
@@ -138,6 +138,10 @@ class CONTENT_EXPORT ContentClient { @@ -145,6 +145,10 @@ class CONTENT_EXPORT ContentClient {
// Used as part of the user agent string. // Used as part of the user agent string.
virtual std::string GetProduct() const; virtual std::string GetProduct() const;

View File

@ -1,8 +1,8 @@
diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc diff --git content/browser/frame_host/render_frame_host_manager.cc content/browser/frame_host/render_frame_host_manager.cc
index 0663535e3f81..e0e20722c820 100644 index 3263eb9e324a..b5bde4cea8f7 100644
--- content/browser/frame_host/render_frame_host_manager.cc --- content/browser/frame_host/render_frame_host_manager.cc
+++ content/browser/frame_host/render_frame_host_manager.cc +++ content/browser/frame_host/render_frame_host_manager.cc
@@ -1082,10 +1082,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation( @@ -890,10 +890,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
// TODO(alexmos): This check should've been enforced earlier in the // TODO(alexmos): This check should've been enforced earlier in the
// navigation, in chrome::Navigate(). Verify this, and then convert this to // navigation, in chrome::Navigate(). Verify this, and then convert this to
// a CHECK and remove the fallback. // a CHECK and remove the fallback.
@ -18,7 +18,7 @@ index 0663535e3f81..e0e20722c820 100644
return true; return true;
} }
@@ -1224,7 +1225,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation( @@ -1032,7 +1033,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
// Double-check that the new SiteInstance is associated with the right // Double-check that the new SiteInstance is associated with the right
// BrowserContext. // BrowserContext.
@ -26,13 +26,13 @@ index 0663535e3f81..e0e20722c820 100644
+ DCHECK(GetContentClient()->browser()->IsSameBrowserContext( + DCHECK(GetContentClient()->browser()->IsSameBrowserContext(
+ new_instance->GetBrowserContext(), browser_context)); + new_instance->GetBrowserContext(), browser_context));
// If |new_instance| is a new SiteInstance for a subframe with an isolated // If |new_instance| is a new SiteInstance for a subframe that requires a
// origin, set its process reuse policy so that such subframes are // dedicated process, set its process reuse policy so that such subframes are
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index e56b320170df..26aa6fe50311 100644 index 18767b608ce9..41f5dc26ffdc 100644
--- content/public/browser/content_browser_client.h --- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h +++ content/public/browser/content_browser_client.h
@@ -343,6 +343,13 @@ class CONTENT_EXPORT ContentBrowserClient { @@ -341,6 +341,13 @@ class CONTENT_EXPORT ContentBrowserClient {
const GURL& current_url, const GURL& current_url,
const GURL& new_url); const GURL& new_url);
@ -47,10 +47,10 @@ index e56b320170df..26aa6fe50311 100644
// current SiteInstance, if it does not yet have a site. // current SiteInstance, if it does not yet have a site.
virtual bool ShouldAssignSiteForURL(const GURL& url); virtual bool ShouldAssignSiteForURL(const GURL& url);
diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc
index e85940e1123a..7d4e3c13204b 100644 index d60c12116dcc..70d376348c46 100644
--- extensions/browser/extension_host.cc --- extensions/browser/extension_host.cc
+++ extensions/browser/extension_host.cc +++ extensions/browser/extension_host.cc
@@ -69,11 +69,12 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -68,11 +68,12 @@ ExtensionHost::ExtensionHost(const Extension* extension,
DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE ||
host_type == VIEW_TYPE_EXTENSION_DIALOG || host_type == VIEW_TYPE_EXTENSION_DIALOG ||
host_type == VIEW_TYPE_EXTENSION_POPUP); host_type == VIEW_TYPE_EXTENSION_POPUP);
@ -67,7 +67,7 @@ index e85940e1123a..7d4e3c13204b 100644
render_view_host_ = host_contents_->GetRenderViewHost(); render_view_host_ = host_contents_->GetRenderViewHost();
@@ -88,6 +89,48 @@ ExtensionHost::ExtensionHost(const Extension* extension, @@ -87,6 +88,48 @@ ExtensionHost::ExtensionHost(const Extension* extension,
dispatcher()->set_delegate(this); dispatcher()->set_delegate(this);
} }
@ -152,7 +152,7 @@ index 34812c083bf5..1ccfaf6e1c45 100644
// A weak pointer to the current or pending RenderViewHost. We don't access // A weak pointer to the current or pending RenderViewHost. We don't access
// this through the host_contents because we want to deal with the pending // this through the host_contents because we want to deal with the pending
diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h
index 69434c704f2f..f31b65fcd192 100644 index 267a40121d8e..fc68e632465c 100644
--- extensions/browser/extensions_browser_client.h --- extensions/browser/extensions_browser_client.h
+++ extensions/browser/extensions_browser_client.h +++ extensions/browser/extensions_browser_client.h
@@ -53,6 +53,7 @@ class ComponentExtensionResourceManager; @@ -53,6 +53,7 @@ class ComponentExtensionResourceManager;
@ -191,10 +191,10 @@ index 69434c704f2f..f31b65fcd192 100644
// once each time the extensions system is loaded per browser_context. The // once each time the extensions system is loaded per browser_context. The
// implementation may wish to use the BrowserContext to record the current // implementation may wish to use the BrowserContext to record the current
diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc
index 5a06db3d4495..b960853f02b2 100644 index fec28715c0fe..74564954904f 100644
--- extensions/browser/process_manager.cc --- extensions/browser/process_manager.cc
+++ extensions/browser/process_manager.cc +++ extensions/browser/process_manager.cc
@@ -349,9 +349,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension, @@ -351,9 +351,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
return true; // TODO(kalman): return false here? It might break things... return true; // TODO(kalman): return false here? It might break things...
DVLOG(1) << "CreateBackgroundHost " << extension->id(); DVLOG(1) << "CreateBackgroundHost " << extension->id();

View File

@ -1,8 +1,8 @@
diff --git .gn .gn diff --git .gn .gn
index db85e5f4092f..779c93c07523 100644 index 20f642efb056..7f73f53c70ad 100644
--- .gn --- .gn
+++ .gn +++ .gn
@@ -230,6 +230,8 @@ exec_script_whitelist = @@ -234,6 +234,8 @@ exec_script_whitelist =
# in the Chromium repo outside of //build. # in the Chromium repo outside of //build.
"//build_overrides/build.gni", "//build_overrides/build.gni",
@ -12,13 +12,13 @@ index db85e5f4092f..779c93c07523 100644
# https://crbug.com/474506. # https://crbug.com/474506.
"//clank/java/BUILD.gn", "//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn diff --git BUILD.gn BUILD.gn
index 5c26c723bf8b..fa4994456865 100644 index 92a8578280e6..11eb3b16a812 100644
--- BUILD.gn --- BUILD.gn
+++ BUILD.gn +++ BUILD.gn
@@ -179,6 +179,7 @@ group("gn_all") { @@ -183,6 +183,7 @@ group("gn_all") {
if (!is_ios && !is_fuchsia) { if (!is_ios && !is_fuchsia) {
deps += [ deps += [
"//cc:cc_unittests",
+ "//cef", + "//cef",
"//chrome/test:telemetry_perf_unittests", "//chrome/test:telemetry_perf_unittests",
"//chrome/test:unit_tests", "//chrome/test:unit_tests",
@ -96,7 +96,7 @@ index a1d2ea4b2394..50514a54e64f 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py diff --git build/vs_toolchain.py build/vs_toolchain.py
index 7a258ed1dacc..4165c1f9d07b 100755 index 0a54e113f30f..d8ff277fcda6 100755
--- build/vs_toolchain.py --- build/vs_toolchain.py
+++ build/vs_toolchain.py +++ build/vs_toolchain.py
@@ -81,11 +81,18 @@ def SetEnvironmentAndGetRuntimeDllDirs(): @@ -81,11 +81,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@ -132,7 +132,7 @@ index bd0fc70bb87f..79315464c57b 100644
if (is_mac) { if (is_mac) {
output_locales = locales_as_mac_outputs output_locales = locales_as_mac_outputs
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
index 88a6d8627d51..4a25b5d1b713 100644 index 3f65aa27ca38..3227cb17e460 100644
--- chrome/installer/mini_installer/BUILD.gn --- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn +++ chrome/installer/mini_installer/BUILD.gn
@@ -130,7 +130,7 @@ template("generate_mini_installer") { @@ -130,7 +130,7 @@ template("generate_mini_installer") {
@ -143,4 +143,4 @@ index 88a6d8627d51..4a25b5d1b713 100644
+ "$root_out_dir/chrome/locales/en-US.pak", + "$root_out_dir/chrome/locales/en-US.pak",
"$root_out_dir/setup.exe", "$root_out_dir/setup.exe",
"$root_out_dir/v8_context_snapshot.bin", "$root_out_dir/v8_context_snapshot.bin",
release_file, "//chrome/tools/build/win/makecab.py",

View File

@ -1,8 +1,8 @@
diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids diff --git tools/gritsettings/resource_ids tools/gritsettings/resource_ids
index e95450a1ff2b..5fee0604be15 100644 index fc1c4aa91190..dfa9e7a43799 100644
--- tools/gritsettings/resource_ids --- tools/gritsettings/resource_ids
+++ tools/gritsettings/resource_ids +++ tools/gritsettings/resource_ids
@@ -390,4 +390,11 @@ @@ -393,4 +393,11 @@
# Please read the header and find the right section above instead. # Please read the header and find the right section above instead.
# Resource ids starting at 31000 are reserved for projects built on Chromium. # Resource ids starting at 31000 are reserved for projects built on Chromium.

View File

@ -1,8 +1,8 @@
diff --git ui/base/ime/input_method_win.cc ui/base/ime/input_method_win.cc diff --git ui/base/ime/input_method_win.cc ui/base/ime/input_method_win.cc
index 3e33b5a74170..6b425cc0fbee 100644 index 06f8831222dd..68297ba47dd3 100644
--- ui/base/ime/input_method_win.cc --- ui/base/ime/input_method_win.cc
+++ ui/base/ime/input_method_win.cc +++ ui/base/ime/input_method_win.cc
@@ -688,8 +688,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const { @@ -685,8 +685,9 @@ bool InputMethodWin::IsWindowFocused(const TextInputClient* client) const {
// receiving keyboard input as long as it is an active window. This works well // receiving keyboard input as long as it is an active window. This works well
// even when the |attached_window_handle| becomes active but has not received // even when the |attached_window_handle| becomes active but has not received
// WM_FOCUS yet. // WM_FOCUS yet.

View File

@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index fff8488778d7..0443bcace1d4 100644 index 2673c6a79889..ca5726966ac0 100644
--- build/config/compiler/BUILD.gn --- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn +++ build/config/compiler/BUILD.gn
@@ -399,7 +399,7 @@ config("compiler") { @@ -443,7 +443,7 @@ config("compiler") {
# chromeos binutils has been patched with the fix, so always use icf there. # chromeos binutils has been patched with the fix, so always use icf there.
# The bug only affects x86 and x64, so we can still use ICF when targeting # The bug only affects x86 and x64, so we can still use ICF when targeting
# other architectures. # other architectures.
@ -11,53 +11,52 @@ index fff8488778d7..0443bcace1d4 100644
!(current_cpu == "x86" || current_cpu == "x64")) { !(current_cpu == "x86" || current_cpu == "x64")) {
ldflags += [ "-Wl,--icf=all" ] ldflags += [ "-Wl,--icf=all" ]
} }
diff --git chrome/browser/ui/libgtkui/gtk_ui.cc chrome/browser/ui/libgtkui/gtk_ui.cc diff --git chrome/browser/ui/libgtkui/gtk_util.cc chrome/browser/ui/libgtkui/gtk_util.cc
index bf37dd5c3799..ad5693e38487 100644 index fc6ffb9d..f6c22e5 100644
--- chrome/browser/ui/libgtkui/gtk_ui.cc --- chrome/browser/ui/libgtkui/gtk_util.cc
+++ chrome/browser/ui/libgtkui/gtk_ui.cc +++ chrome/browser/ui/libgtkui/gtk_util.cc
@@ -404,11 +404,13 @@ SkColor GetToolbarTopSeparatorColor(SkColor header_fg, @@ -56,6 +56,7 @@ void CommonInitFromCommandLine(const base::CommandLine& command_line,
}
} }
#endif
+#if GTK_MAJOR_VERSION >= 3 +#if GTK_MAJOR_VERSION > 2
using GdkSetAllowedBackendsFn = void (*)(const gchar*); using GtkSetState = void (*)(GtkWidgetPath*, gint, GtkStateFlags);
// Place this function pointers in read-only memory after being resolved to PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetState>
// prevent it being tampered with. See crbug.com/771365 for details. _gtk_widget_path_iter_set_state;
PROTECTED_MEMORY_SECTION base::ProtectedMemory<GdkSetAllowedBackendsFn> @@ -63,6 +64,7 @@ PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetState>
g_gdk_set_allowed_backends; using GtkSetObjectName = void (*)(GtkWidgetPath*, gint, const char*);
PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetObjectName>
_gtk_widget_path_iter_set_object_name;
+#endif +#endif
} // namespace } // namespace
diff --git chrome/browser/ui/libgtkui/native_theme_gtk2.cc chrome/browser/ui/libgtkui/native_theme_gtk2.cc @@ -401,10 +403,12 @@ ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context,
index af67e8343f5a..1e6d1e5818e4 100644
--- chrome/browser/ui/libgtkui/native_theme_gtk2.cc
+++ chrome/browser/ui/libgtkui/native_theme_gtk2.cc
@@ -348,6 +348,7 @@ SkColor NativeThemeGtk2::GetSystemColor(ColorId color_id) const {
}
case kColorId_NumColors:
+ default:
NOTREACHED(); NOTREACHED();
break;
}
diff --git ui/accessibility/platform/atk_util_auralinux_gtk2.cc ui/accessibility/platform/atk_util_auralinux_gtk2.cc
index 9c50ead85605..54cbd52c7de0 100644
--- ui/accessibility/platform/atk_util_auralinux_gtk2.cc
+++ ui/accessibility/platform/atk_util_auralinux_gtk2.cc
@@ -56,6 +56,8 @@ void FinishAccessibilityInitOnMainThread(
init_func();
} }
} else {
+#if GTK_MAJOR_VERSION > 2
static base::ProtectedMemory<GtkSetObjectName>::Initializer init(
&_gtk_widget_path_iter_set_object_name,
reinterpret_cast<GtkSetObjectName>(dlsym(
GetGtkSharedLibrary(), "gtk_widget_path_iter_set_object_name")));
+#endif
switch (part_type) {
case CSS_NAME: {
if (GtkVersionCheck(3, 20)) {
@@ -449,6 +453,7 @@ ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context,
// widgets specially if they want to.
gtk_widget_path_iter_add_class(path, -1, "chromium");
+namespace ui { +#if GTK_MAJOR_VERSION > 2
+ if (GtkVersionCheck(3, 14)) {
bool AtkUtilAuraLinux::PlatformShouldEnableAccessibility() { static base::ProtectedMemory<GtkSetState>::Initializer init(
std::unique_ptr<base::Environment> env(base::Environment::Create()); &_gtk_widget_path_iter_set_state,
std::string gtk_modules; @@ -457,6 +462,7 @@ ScopedStyleContext AppendCssNodeToStyleContext(GtkStyleContext* context,
@@ -78,3 +80,6 @@ void AtkUtilAuraLinux::PlatformInitializeAsync() { DCHECK(*_gtk_widget_path_iter_set_state);
base::Bind(&GetAccessibilityModuleInitFunc), base::UnsanitizedCfiCall(_gtk_widget_path_iter_set_state)(path, -1, state);
base::Bind(&FinishAccessibilityInitOnMainThread));
} }
+ +#endif
+} // namespace ui
+ ScopedStyleContext child_context(gtk_style_context_new());
gtk_style_context_set_path(child_context, path);

View File

@ -1,15 +0,0 @@
diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn
index f35d81872096..d14e71e0319b 100644
--- third_party/widevine/cdm/BUILD.gn
+++ third_party/widevine/cdm/BUILD.gn
@@ -110,7 +110,9 @@ if (widevine_cdm_binary_files != []) {
"//build/config:exe_and_shlib_deps",
]
- if (is_posix && !is_mac) {
+ if (is_mac) {
+ ldflags = [ "-Wl,-install_name,@loader_path/libwidevinecdm.dylib" ]
+ } else if (is_posix) {
cflags = [ "-fvisibility=hidden" ]
}
}

View File

@ -1,5 +1,5 @@
diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h diff --git base/message_loop/message_loop.h base/message_loop/message_loop.h
index bff60ef11025..33b430dadaf7 100644 index 27ee7fe8155b..353a61c3badd 100644
--- base/message_loop/message_loop.h --- base/message_loop/message_loop.h
+++ base/message_loop/message_loop.h +++ base/message_loop/message_loop.h
@@ -266,6 +266,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, @@ -266,6 +266,16 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate,
@ -16,10 +16,10 @@ index bff60ef11025..33b430dadaf7 100644
+ } + }
+#endif // OS_WIN +#endif // OS_WIN
+ +
// Returns true if the message loop is "idle". Provided for testing. // Returns true if the message loop is idle (ignoring delayed tasks). This is
bool IsIdleForTesting(); // the same condition which triggers DoWork() to return false: i.e.
// out of tasks which can be processed at the current run-level -- there might
@@ -369,6 +379,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate, @@ -373,6 +383,12 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate,
// is known to generate a system-driven nested loop. // is known to generate a system-driven nested loop.
bool task_execution_allowed_ = true; bool task_execution_allowed_ = true;

View File

@ -55,10 +55,10 @@ index fb6f4847cfe9..aa4c1cdafb9f 100644
} // namespace net } // namespace net
diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc diff --git net/http/transport_security_state.cc net/http/transport_security_state.cc
index a433afd02178..ff92489ed243 100644 index 6eaa321ef4b8..9926ea6afc40 100644
--- net/http/transport_security_state.cc --- net/http/transport_security_state.cc
+++ net/http/transport_security_state.cc +++ net/http/transport_security_state.cc
@@ -1553,8 +1553,10 @@ void TransportSecurityState::ClearReportCachesForTesting() { @@ -1567,8 +1567,10 @@ void TransportSecurityState::ClearReportCachesForTesting() {
sent_expect_ct_reports_cache_.Clear(); sent_expect_ct_reports_cache_.Clear();
} }

View File

@ -1,8 +1,8 @@
diff --git net/url_request/url_request.h net/url_request/url_request.h diff --git net/url_request/url_request.h net/url_request/url_request.h
index 0635448f00a1..3d91e1d92d7f 100644 index 60fbf78c7886..9597011602ba 100644
--- net/url_request/url_request.h --- net/url_request/url_request.h
+++ net/url_request/url_request.h +++ net/url_request/url_request.h
@@ -684,10 +684,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData { @@ -693,10 +693,10 @@ class NET_EXPORT URLRequest : public base::SupportsUserData {
// called with a response from the server. // called with a response from the server.
void SetResponseHeadersCallback(ResponseHeadersCallback callback); void SetResponseHeadersCallback(ResponseHeadersCallback callback);

View File

@ -1,8 +1,8 @@
diff --git BUILD.gn BUILD.gn diff --git BUILD.gn BUILD.gn
index 6fb2bd888..b275bfd2b 100644 index c771b8191..6a5f1f3e4 100644
--- BUILD.gn --- BUILD.gn
+++ BUILD.gn +++ BUILD.gn
@@ -229,6 +229,10 @@ static_library("pdfium") { @@ -230,6 +230,10 @@ jumbo_static_library("pdfium") {
if (pdf_is_complete_lib) { if (pdf_is_complete_lib) {
complete_static_lib = true complete_static_lib = true
} }
@ -12,9 +12,9 @@ index 6fb2bd888..b275bfd2b 100644
+ ] + ]
} }
static_library("test_support") { jumbo_static_library("test_support") {
diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp diff --git fpdfsdk/fpdfview.cpp fpdfsdk/fpdfview.cpp
index 2736b8dd6..830f074b7 100644 index 97fc02a23..000b4a7d3 100644
--- fpdfsdk/fpdfview.cpp --- fpdfsdk/fpdfview.cpp
+++ fpdfsdk/fpdfview.cpp +++ fpdfsdk/fpdfview.cpp
@@ -36,6 +36,7 @@ @@ -36,6 +36,7 @@
@ -25,7 +25,7 @@ index 2736b8dd6..830f074b7 100644
#include "fxjs/ijs_runtime.h" #include "fxjs/ijs_runtime.h"
#include "public/fpdf_edit.h" #include "public/fpdf_edit.h"
#include "public/fpdf_ext.h" #include "public/fpdf_ext.h"
@@ -497,6 +498,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() { @@ -495,6 +496,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_DestroyLibrary() {
CPDF_ModuleMgr::Destroy(); CPDF_ModuleMgr::Destroy();
CFX_GEModule::Destroy(); CFX_GEModule::Destroy();

View File

@ -1,8 +1,8 @@
diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h diff --git content/public/common/common_param_traits_macros.h content/public/common/common_param_traits_macros.h
index 63a73ad504d5..9b8cde03ecf4 100644 index a714130a50d8..2a835d7282b3 100644
--- content/public/common/common_param_traits_macros.h --- content/public/common/common_param_traits_macros.h
+++ content/public/common/common_param_traits_macros.h +++ content/public/common/common_param_traits_macros.h
@@ -195,6 +195,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences) @@ -187,6 +187,7 @@ IPC_STRUCT_TRAITS_BEGIN(content::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes) IPC_STRUCT_TRAITS_MEMBER(main_frame_resizes_are_orientation_changes)
IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale) IPC_STRUCT_TRAITS_MEMBER(initialize_at_minimum_page_scale)
IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled) IPC_STRUCT_TRAITS_MEMBER(smart_insert_delete_enabled)
@ -11,7 +11,7 @@ index 63a73ad504d5..9b8cde03ecf4 100644
IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop) IPC_STRUCT_TRAITS_MEMBER(navigate_on_drag_drop)
IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled) IPC_STRUCT_TRAITS_MEMBER(spatial_navigation_enabled)
diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc diff --git content/public/common/web_preferences.cc content/public/common/web_preferences.cc
index cc20936125f4..a1cde3a9a2b2 100644 index 06069a576dfd..912155ebec7c 100644
--- content/public/common/web_preferences.cc --- content/public/common/web_preferences.cc
+++ content/public/common/web_preferences.cc +++ content/public/common/web_preferences.cc
@@ -178,6 +178,7 @@ WebPreferences::WebPreferences() @@ -178,6 +178,7 @@ WebPreferences::WebPreferences()
@ -23,10 +23,10 @@ index cc20936125f4..a1cde3a9a2b2 100644
record_whole_document(false), record_whole_document(false),
save_previous_document_resources(SavePreviousDocumentResources::NEVER), save_previous_document_resources(SavePreviousDocumentResources::NEVER),
diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h diff --git content/public/common/web_preferences.h content/public/common/web_preferences.h
index 361505babff0..341873d000bc 100644 index 49be57cd2aad..417be7a55184 100644
--- content/public/common/web_preferences.h --- content/public/common/web_preferences.h
+++ content/public/common/web_preferences.h +++ content/public/common/web_preferences.h
@@ -197,6 +197,7 @@ struct CONTENT_EXPORT WebPreferences { @@ -198,6 +198,7 @@ struct CONTENT_EXPORT WebPreferences {
bool spatial_navigation_enabled; bool spatial_navigation_enabled;
bool use_solid_color_scrollbars; bool use_solid_color_scrollbars;
bool navigate_on_drag_drop; bool navigate_on_drag_drop;
@ -35,10 +35,10 @@ index 361505babff0..341873d000bc 100644
bool record_whole_document; bool record_whole_document;
SavePreviousDocumentResources save_previous_document_resources; SavePreviousDocumentResources save_previous_document_resources;
diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc diff --git content/renderer/render_view_impl.cc content/renderer/render_view_impl.cc
index 0f5f1d8e1649..ae5c98646619 100644 index 1d136aa56ff4..23c00d73b8ed 100644
--- content/renderer/render_view_impl.cc --- content/renderer/render_view_impl.cc
+++ content/renderer/render_view_impl.cc +++ content/renderer/render_view_impl.cc
@@ -1250,6 +1250,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal( @@ -1261,6 +1261,8 @@ void RenderViewImpl::ApplyWebPreferencesInternal(
blink::WebView* web_view, blink::WebView* web_view,
CompositorDependencies* compositor_deps) { CompositorDependencies* compositor_deps) {
ApplyWebPreferences(prefs, web_view); ApplyWebPreferences(prefs, web_view);

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index 02b2c4212767..5a89d17b06a4 100644 index 1a43eba4852b..eccb01ca818e 100644
--- chrome/browser/ui/BUILD.gn --- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn +++ chrome/browser/ui/BUILD.gn
@@ -344,6 +344,7 @@ split_static_library("ui") { @@ -344,6 +344,7 @@ split_static_library("ui") {
@ -81,31 +81,31 @@ index 45644030eb24..c894209e1530 100644
} }
} // namespace settings } // namespace settings
diff --git chrome/common/chrome_utility_printing_messages.h chrome/common/chrome_utility_printing_messages.h diff --git chrome/utility/printing_handler.cc chrome/utility/printing_handler.cc
index cb6092794c46..2db218d9f140 100644 index 1eb818639134..4525da919180 100644
--- chrome/common/chrome_utility_printing_messages.h --- chrome/utility/printing_handler.cc
+++ chrome/common/chrome_utility_printing_messages.h +++ chrome/utility/printing_handler.cc
@@ -27,7 +27,6 @@ @@ -23,6 +23,7 @@ namespace printing {
#define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart
// Preview and Cloud Print messages. namespace {
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
IPC_ENUM_TRAITS_MAX_VALUE(printing::PdfRenderSettings::Mode,
printing::PdfRenderSettings::Mode::LAST)
@@ -39,6 +38,7 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PdfRenderSettings)
IPC_STRUCT_TRAITS_MEMBER(mode)
IPC_STRUCT_TRAITS_END()
+#if BUILDFLAG(ENABLE_PRINT_PREVIEW) +#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) bool Send(IPC::Message* message) {
IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) return content::UtilityThread::Get()->Send(message);
IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) }
@@ -30,6 +31,7 @@ bool Send(IPC::Message* message) {
void ReleaseProcess() {
content::UtilityThread::Get()->ReleaseProcess();
}
+#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
} // namespace
diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc diff --git components/printing/common/print_messages.cc components/printing/common/print_messages.cc
index 5ccf87b28860..48e557d84d5e 100644 index ef1e25b11afe..a12e21450a59 100644
--- components/printing/common/print_messages.cc --- components/printing/common/print_messages.cc
+++ components/printing/common/print_messages.cc +++ components/printing/common/print_messages.cc
@@ -125,7 +125,6 @@ void PrintMsg_PrintPages_Params::Reset() { @@ -129,7 +129,6 @@ void PrintMsg_PrintPages_Params::Reset() {
pages = std::vector<int>(); pages = std::vector<int>();
} }
@ -113,16 +113,16 @@ index 5ccf87b28860..48e557d84d5e 100644
PrintHostMsg_RequestPrintPreview_Params:: PrintHostMsg_RequestPrintPreview_Params::
PrintHostMsg_RequestPrintPreview_Params() PrintHostMsg_RequestPrintPreview_Params()
: is_modifiable(false), : is_modifiable(false),
@@ -147,4 +146,3 @@ PrintHostMsg_SetOptionsFromDocument_Params:: @@ -151,4 +150,3 @@ PrintHostMsg_SetOptionsFromDocument_Params::
PrintHostMsg_SetOptionsFromDocument_Params:: PrintHostMsg_SetOptionsFromDocument_Params::
~PrintHostMsg_SetOptionsFromDocument_Params() { ~PrintHostMsg_SetOptionsFromDocument_Params() {
} }
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h diff --git components/printing/common/print_messages.h components/printing/common/print_messages.h
index 339e63c3294b..75673f2de92f 100644 index 6d02771d018d..cb8608f5b523 100644
--- components/printing/common/print_messages.h --- components/printing/common/print_messages.h
+++ components/printing/common/print_messages.h +++ components/printing/common/print_messages.h
@@ -77,7 +77,6 @@ struct PrintMsg_PrintPages_Params { @@ -79,7 +79,6 @@ struct PrintMsg_PrintPages_Params {
std::vector<int> pages; std::vector<int> pages;
}; };
@ -130,7 +130,7 @@ index 339e63c3294b..75673f2de92f 100644
struct PrintHostMsg_RequestPrintPreview_Params { struct PrintHostMsg_RequestPrintPreview_Params {
PrintHostMsg_RequestPrintPreview_Params(); PrintHostMsg_RequestPrintPreview_Params();
~PrintHostMsg_RequestPrintPreview_Params(); ~PrintHostMsg_RequestPrintPreview_Params();
@@ -96,7 +95,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params { @@ -98,7 +97,6 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
printing::DuplexMode duplex; printing::DuplexMode duplex;
printing::PageRanges page_ranges; printing::PageRanges page_ranges;
}; };
@ -138,7 +138,7 @@ index 339e63c3294b..75673f2de92f 100644
#endif // INTERNAL_COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ #endif // INTERNAL_COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
@@ -181,7 +179,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) @@ -189,7 +187,6 @@ IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
IPC_STRUCT_TRAITS_MEMBER(to) IPC_STRUCT_TRAITS_MEMBER(to)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -146,7 +146,7 @@ index 339e63c3294b..75673f2de92f 100644
IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
IPC_STRUCT_TRAITS_MEMBER(is_modifiable) IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
IPC_STRUCT_TRAITS_MEMBER(webnode_only) IPC_STRUCT_TRAITS_MEMBER(webnode_only)
@@ -202,7 +199,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) @@ -210,7 +207,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
// Specifies page range to be printed. // Specifies page range to be printed.
IPC_STRUCT_TRAITS_MEMBER(page_ranges) IPC_STRUCT_TRAITS_MEMBER(page_ranges)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -154,7 +154,7 @@ index 339e63c3294b..75673f2de92f 100644
IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
IPC_STRUCT_TRAITS_MEMBER(content_width) IPC_STRUCT_TRAITS_MEMBER(content_width)
@@ -222,7 +218,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) @@ -230,7 +226,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
IPC_STRUCT_TRAITS_MEMBER(pages) IPC_STRUCT_TRAITS_MEMBER(pages)
IPC_STRUCT_TRAITS_END() IPC_STRUCT_TRAITS_END()
@ -162,15 +162,15 @@ index 339e63c3294b..75673f2de92f 100644
// Parameters to describe a rendered document. // Parameters to describe a rendered document.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
// A shared memory handle to metafile data. // A shared memory handle to metafile data.
@@ -273,7 +268,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params) @@ -281,7 +276,6 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
// Indicates whether the existing preview data needs to be cleared or not. // Indicates whether the existing preview data needs to be cleared or not.
IPC_STRUCT_MEMBER(bool, clear_preview_data) IPC_STRUCT_MEMBER(bool, clear_preview_data)
IPC_STRUCT_END() IPC_STRUCT_END()
-#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) -#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Parameters to describe a rendered page. // Parameters to describe a rendered page.
IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintDocument_Params)
@@ -316,22 +310,20 @@ IPC_STRUCT_END() @@ -321,10 +315,8 @@ IPC_STRUCT_END()
// Messages sent from the browser to the renderer. // Messages sent from the browser to the renderer.
@ -181,21 +181,7 @@ index 339e63c3294b..75673f2de92f 100644
// Tells the RenderFrame to initiate printing or print preview for a particular // Tells the RenderFrame to initiate printing or print preview for a particular
// node, depending on which mode the RenderFrame is in. // node, depending on which mode the RenderFrame is in.
IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) @@ -346,13 +338,13 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
-#if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Tells the renderer to print the print preview tab's PDF plugin without
// showing the print dialog. (This is the final step in the print preview
// workflow.)
IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview,
base::DictionaryValue /* settings */)
-#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Tells the RenderFrame to switch the CSS to print media type, renders every
@@ -349,13 +341,13 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
// Tells the RenderFrame whether printing is enabled or not. // Tells the RenderFrame whether printing is enabled or not.
IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */) IPC_MESSAGE_ROUTED1(PrintMsg_SetPrintingEnabled, bool /* enabled */)
@ -210,7 +196,7 @@ index 339e63c3294b..75673f2de92f 100644
// Tells the RenderFrame that print preview dialog was closed. // Tells the RenderFrame that print preview dialog was closed.
IPC_MESSAGE_ROUTED0(PrintMsg_ClosePrintPreviewDialog) IPC_MESSAGE_ROUTED0(PrintMsg_ClosePrintPreviewDialog)
#endif #endif
@@ -415,7 +407,6 @@ IPC_MESSAGE_CONTROL3(PrintHostMsg_TempFileForPrintingWritten, @@ -412,7 +404,6 @@ IPC_MESSAGE_CONTROL3(PrintHostMsg_TempFileForPrintingWritten,
int /* page count */) int /* page count */)
#endif // defined(OS_ANDROID) #endif // defined(OS_ANDROID)
@ -218,7 +204,7 @@ index 339e63c3294b..75673f2de92f 100644
// Asks the browser to do print preview. // Asks the browser to do print preview.
IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
PrintHostMsg_RequestPrintPreview_Params /* params */) PrintHostMsg_RequestPrintPreview_Params /* params */)
@@ -449,7 +440,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, @@ -446,7 +437,6 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
// The memory handle in this message is already valid in the browser process. // The memory handle in this message is already valid in the browser process.
IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
PrintHostMsg_DidPreviewDocument_Params /* params */) PrintHostMsg_DidPreviewDocument_Params /* params */)
@ -226,7 +212,7 @@ index 339e63c3294b..75673f2de92f 100644
// This is sent when there are invalid printer settings. // This is sent when there are invalid printer settings.
IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
@@ -458,7 +448,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) @@ -455,7 +445,6 @@ IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
int /* document cookie */) int /* document cookie */)
@ -234,7 +220,7 @@ index 339e63c3294b..75673f2de92f 100644
// Tell the browser print preview failed. // Tell the browser print preview failed.
IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
int /* document cookie */) int /* document cookie */)
@@ -485,6 +474,5 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, @@ -482,6 +471,5 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
// Notify the browser to set print presets based on source PDF document. // Notify the browser to set print presets based on source PDF document.
IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
PrintHostMsg_SetOptionsFromDocument_Params /* params */) PrintHostMsg_SetOptionsFromDocument_Params /* params */)
@ -242,10 +228,10 @@ index 339e63c3294b..75673f2de92f 100644
#endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
diff --git components/printing/renderer/print_render_frame_helper.cc components/printing/renderer/print_render_frame_helper.cc diff --git components/printing/renderer/print_render_frame_helper.cc components/printing/renderer/print_render_frame_helper.cc
index 663cd7748493..588797775ead 100644 index 86c3b7a291e3..7a645cea6ebe 100644
--- components/printing/renderer/print_render_frame_helper.cc --- components/printing/renderer/print_render_frame_helper.cc
+++ components/printing/renderer/print_render_frame_helper.cc +++ components/printing/renderer/print_render_frame_helper.cc
@@ -320,7 +320,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame, @@ -322,7 +322,6 @@ bool PrintingNodeOrPdfFrame(const blink::WebLocalFrame* frame,
return plugin && plugin->SupportsPaginatedPrint(); return plugin && plugin->SupportsPaginatedPrint();
} }
@ -253,7 +239,7 @@ index 663cd7748493..588797775ead 100644
// Returns true if the current destination printer is PRINT_TO_PDF. // Returns true if the current destination printer is PRINT_TO_PDF.
bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) { bool IsPrintToPdfRequested(const base::DictionaryValue& job_settings) {
bool print_to_pdf = false; bool print_to_pdf = false;
@@ -342,7 +341,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame, @@ -344,7 +343,6 @@ bool PrintingFrameHasPageSizeStyle(blink::WebLocalFrame* frame,
} }
return frame_has_custom_page_size_style; return frame_has_custom_page_size_style;
} }
@ -261,7 +247,7 @@ index 663cd7748493..588797775ead 100644
#if BUILDFLAG(ENABLE_PRINTING) #if BUILDFLAG(ENABLE_PRINTING)
// Disable scaling when either: // Disable scaling when either:
@@ -399,7 +397,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame, @@ -401,7 +399,6 @@ MarginType GetMarginsForPdf(blink::WebLocalFrame* frame,
} }
#endif #endif
@ -269,7 +255,7 @@ index 663cd7748493..588797775ead 100644
bool FitToPageEnabled(const base::DictionaryValue& job_settings) { bool FitToPageEnabled(const base::DictionaryValue& job_settings) {
bool fit_to_paper_size = false; bool fit_to_paper_size = false;
if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) { if (!job_settings.GetBoolean(kSettingFitToPageEnabled, &fit_to_paper_size)) {
@@ -441,7 +438,6 @@ blink::WebPrintScalingOption GetPrintScalingOption( @@ -443,7 +440,6 @@ blink::WebPrintScalingOption GetPrintScalingOption(
} }
return blink::kWebPrintScalingOptionFitToPrintableArea; return blink::kWebPrintScalingOptionFitToPrintableArea;
} }
@ -277,15 +263,15 @@ index 663cd7748493..588797775ead 100644
// Helper function to scale and round an integer value with a double valued // Helper function to scale and round an integer value with a double valued
// scaling. // scaling.
@@ -948,6 +944,7 @@ PrintRenderFrameHelper::PrintRenderFrameHelper( @@ -952,6 +948,7 @@ PrintRenderFrameHelper::PrintRenderFrameHelper(
print_for_preview_(false), notify_browser_of_print_failure_(true),
delegate_(std::move(delegate)), delegate_(std::move(delegate)),
print_node_in_progress_(false), print_node_in_progress_(false),
+ force_print_preview_(false), + force_print_preview_(false),
is_loading_(false), is_loading_(false),
is_scripted_preview_delayed_(false), is_scripted_preview_delayed_(false),
ipc_nesting_level_(0), ipc_nesting_level_(0),
@@ -1009,10 +1006,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) { @@ -1013,10 +1010,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
return; return;
if (g_is_preview_enabled) { if (g_is_preview_enabled) {
@ -296,13 +282,10 @@ index 663cd7748493..588797775ead 100644
} else { } else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
auto weak_this = weak_ptr_factory_.GetWeakPtr(); auto weak_this = weak_ptr_factory_.GetWeakPtr();
@@ -1044,13 +1039,11 @@ bool PrintRenderFrameHelper::OnMessageReceived(const IPC::Message& message) { @@ -1048,10 +1043,10 @@ bool PrintRenderFrameHelper::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages) IPC_MESSAGE_HANDLER(PrintMsg_PrintPages, OnPrintPages)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog) IPC_MESSAGE_HANDLER(PrintMsg_PrintForSystemDialog, OnPrintForSystemDialog)
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
-#if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
IPC_MESSAGE_HANDLER(PrintMsg_PrintForPrintPreview, OnPrintForPrintPreview)
-#endif
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) -#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
IPC_MESSAGE_HANDLER(PrintMsg_InitiatePrintPreview, OnInitiatePrintPreview) IPC_MESSAGE_HANDLER(PrintMsg_InitiatePrintPreview, OnInitiatePrintPreview)
IPC_MESSAGE_HANDLER(PrintMsg_PrintPreview, OnPrintPreview) IPC_MESSAGE_HANDLER(PrintMsg_PrintPreview, OnPrintPreview)
@ -311,23 +294,7 @@ index 663cd7748493..588797775ead 100644
IPC_MESSAGE_HANDLER(PrintMsg_ClosePrintPreviewDialog, IPC_MESSAGE_HANDLER(PrintMsg_ClosePrintPreviewDialog,
OnClosePrintPreviewDialog) OnClosePrintPreviewDialog)
#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -1110,7 +1103,6 @@ void PrintRenderFrameHelper::OnPrintForSystemDialog() { @@ -1134,7 +1129,6 @@ void PrintRenderFrameHelper::UpdateFrameMarginsCssInfo(
}
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
-#if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintRenderFrameHelper::OnPrintForPrintPreview(
const base::DictionaryValue& job_settings) {
CHECK_LE(ipc_nesting_level_, 1);
@@ -1170,7 +1162,6 @@ void PrintRenderFrameHelper::OnPrintForPrintPreview(
DidFinishPrinting(FAIL_PRINT);
}
}
-#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintRenderFrameHelper::GetPageSizeAndContentAreaFromPageLayout(
const PageSizeMargins& page_layout_in_points,
@@ -1195,7 +1186,6 @@ void PrintRenderFrameHelper::UpdateFrameMarginsCssInfo(
ignore_css_margins_ = (margins_type != DEFAULT_MARGINS); ignore_css_margins_ = (margins_type != DEFAULT_MARGINS);
} }
@ -335,7 +302,7 @@ index 663cd7748493..588797775ead 100644
void PrintRenderFrameHelper::OnPrintPreview( void PrintRenderFrameHelper::OnPrintPreview(
const base::DictionaryValue& settings) { const base::DictionaryValue& settings) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
@@ -1387,7 +1377,7 @@ bool PrintRenderFrameHelper::CreatePreviewDocument() { @@ -1326,7 +1320,7 @@ bool PrintRenderFrameHelper::CreatePreviewDocument() {
return true; return true;
} }
@ -344,7 +311,7 @@ index 663cd7748493..588797775ead 100644
bool PrintRenderFrameHelper::RenderPreviewPage( bool PrintRenderFrameHelper::RenderPreviewPage(
int page_number, int page_number,
const PrintMsg_Print_Params& print_params) { const PrintMsg_Print_Params& print_params) {
@@ -1417,7 +1407,7 @@ bool PrintRenderFrameHelper::RenderPreviewPage( @@ -1356,7 +1350,7 @@ bool PrintRenderFrameHelper::RenderPreviewPage(
} }
return PreviewPageRendered(page_number, draft_metafile.get()); return PreviewPageRendered(page_number, draft_metafile.get());
} }
@ -353,7 +320,7 @@ index 663cd7748493..588797775ead 100644
bool PrintRenderFrameHelper::FinalizePrintReadyDocument() { bool PrintRenderFrameHelper::FinalizePrintReadyDocument() {
DCHECK(!is_print_ready_metafile_sent_); DCHECK(!is_print_ready_metafile_sent_);
@@ -1446,7 +1436,6 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() { @@ -1385,7 +1379,6 @@ bool PrintRenderFrameHelper::FinalizePrintReadyDocument() {
Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params)); Send(new PrintHostMsg_MetafileReadyForPrinting(routing_id(), preview_params));
return true; return true;
} }
@ -361,7 +328,7 @@ index 663cd7748493..588797775ead 100644
void PrintRenderFrameHelper::OnPrintingDone(bool success) { void PrintRenderFrameHelper::OnPrintingDone(bool success) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
@@ -1461,7 +1450,6 @@ void PrintRenderFrameHelper::OnSetPrintingEnabled(bool enabled) { @@ -1400,7 +1393,6 @@ void PrintRenderFrameHelper::OnSetPrintingEnabled(bool enabled) {
is_printing_enabled_ = enabled; is_printing_enabled_ = enabled;
} }
@ -369,7 +336,7 @@ index 663cd7748493..588797775ead 100644
void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
@@ -1472,7 +1460,9 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { @@ -1411,7 +1403,9 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
// that instead. // that instead.
auto plugin = delegate_->GetPdfElement(frame); auto plugin = delegate_->GetPdfElement(frame);
if (!plugin.IsNull()) { if (!plugin.IsNull()) {
@ -379,7 +346,7 @@ index 663cd7748493..588797775ead 100644
return; return;
} }
print_preview_context_.InitWithFrame(frame); print_preview_context_.InitWithFrame(frame);
@@ -1481,10 +1471,11 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) { @@ -1420,10 +1414,11 @@ void PrintRenderFrameHelper::OnInitiatePrintPreview(bool has_selection) {
: PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME); : PRINT_PREVIEW_USER_INITIATED_ENTIRE_FRAME);
} }
@ -392,7 +359,7 @@ index 663cd7748493..588797775ead 100644
bool PrintRenderFrameHelper::IsPrintingEnabled() const { bool PrintRenderFrameHelper::IsPrintingEnabled() const {
return is_printing_enabled_; return is_printing_enabled_;
@@ -1506,11 +1497,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) { @@ -1445,11 +1440,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
print_node_in_progress_ = true; print_node_in_progress_ = true;
@ -405,7 +372,7 @@ index 663cd7748493..588797775ead 100644
} else { } else {
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
// Make a copy of the node, in case RenderView::OnContextMenuClosed() resets // Make a copy of the node, in case RenderView::OnContextMenuClosed() resets
@@ -1600,7 +1589,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) { @@ -1539,7 +1532,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
} }
break; break;
@ -413,7 +380,7 @@ index 663cd7748493..588797775ead 100644
case FAIL_PREVIEW: case FAIL_PREVIEW:
if (!is_print_ready_metafile_sent_) { if (!is_print_ready_metafile_sent_) {
if (notify_browser_of_print_failure_) { if (notify_browser_of_print_failure_) {
@@ -1617,7 +1605,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) { @@ -1556,7 +1548,6 @@ void PrintRenderFrameHelper::DidFinishPrinting(PrintingResult result) {
cookie)); cookie));
print_preview_context_.Failed(false); print_preview_context_.Failed(false);
break; break;
@ -421,7 +388,7 @@ index 663cd7748493..588797775ead 100644
} }
prep_frame_view_.reset(); prep_frame_view_.reset();
print_pages_params_.reset(); print_pages_params_.reset();
@@ -1798,7 +1785,6 @@ bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame, @@ -1727,7 +1718,6 @@ bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
return true; return true;
} }
@ -429,7 +396,7 @@ index 663cd7748493..588797775ead 100644
bool PrintRenderFrameHelper::SetOptionsFromPdfDocument( bool PrintRenderFrameHelper::SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options) { PrintHostMsg_SetOptionsFromDocument_Params* options) {
blink::WebLocalFrame* source_frame = print_preview_context_.source_frame(); blink::WebLocalFrame* source_frame = print_preview_context_.source_frame();
@@ -1905,7 +1891,6 @@ bool PrintRenderFrameHelper::UpdatePrintSettings( @@ -1821,7 +1811,6 @@ bool PrintRenderFrameHelper::UpdatePrintSettings(
print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS); print_preview_context_.set_error(PREVIEW_ERROR_INVALID_PRINTER_SETTINGS);
return false; return false;
} }
@ -437,7 +404,7 @@ index 663cd7748493..588797775ead 100644
#if BUILDFLAG(ENABLE_BASIC_PRINTING) #if BUILDFLAG(ENABLE_BASIC_PRINTING)
void PrintRenderFrameHelper::GetPrintSettingsFromUser( void PrintRenderFrameHelper::GetPrintSettingsFromUser(
@@ -2058,7 +2043,6 @@ bool PrintRenderFrameHelper::CopyMetafileDataToSharedMem( @@ -1977,7 +1966,6 @@ bool PrintRenderFrameHelper::CopyMetafileDataToReadOnlySharedMem(
return true; return true;
} }
@ -445,7 +412,7 @@ index 663cd7748493..588797775ead 100644
void PrintRenderFrameHelper::ShowScriptedPrintPreview() { void PrintRenderFrameHelper::ShowScriptedPrintPreview() {
if (is_scripted_preview_delayed_) { if (is_scripted_preview_delayed_) {
is_scripted_preview_delayed_ = false; is_scripted_preview_delayed_ = false;
@@ -2193,7 +2177,6 @@ bool PrintRenderFrameHelper::PreviewPageRendered(int page_number, @@ -2112,7 +2100,6 @@ bool PrintRenderFrameHelper::PreviewPageRendered(int page_number,
Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params)); Send(new PrintHostMsg_DidPreviewPage(routing_id(), preview_page_params));
return true; return true;
} }
@ -454,7 +421,7 @@ index 663cd7748493..588797775ead 100644
PrintRenderFrameHelper::PrintPreviewContext::PrintPreviewContext() PrintRenderFrameHelper::PrintPreviewContext::PrintPreviewContext()
: total_page_count_(0), : total_page_count_(0),
diff --git components/printing/renderer/print_render_frame_helper.h components/printing/renderer/print_render_frame_helper.h diff --git components/printing/renderer/print_render_frame_helper.h components/printing/renderer/print_render_frame_helper.h
index cd174ca65085..bbef96f246ef 100644 index b087b9efe6ca..338710326b17 100644
--- components/printing/renderer/print_render_frame_helper.h --- components/printing/renderer/print_render_frame_helper.h
+++ components/printing/renderer/print_render_frame_helper.h +++ components/printing/renderer/print_render_frame_helper.h
@@ -147,10 +147,8 @@ class PrintRenderFrameHelper @@ -147,10 +147,8 @@ class PrintRenderFrameHelper
@ -468,9 +435,9 @@ index cd174ca65085..bbef96f246ef 100644
}; };
enum PrintPreviewErrorBuckets { enum PrintPreviewErrorBuckets {
@@ -187,9 +185,9 @@ class PrintRenderFrameHelper @@ -186,9 +184,9 @@ class PrintRenderFrameHelper
void OnPrintPages();
void OnPrintForSystemDialog(); void OnPrintForSystemDialog();
void OnPrintForPrintPreview(const base::DictionaryValue& job_settings);
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING) #endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
-#if BUILDFLAG(ENABLE_PRINT_PREVIEW) -#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void OnInitiatePrintPreview(bool has_selection); void OnInitiatePrintPreview(bool has_selection);
@ -479,7 +446,7 @@ index cd174ca65085..bbef96f246ef 100644
void OnClosePrintPreviewDialog(); void OnClosePrintPreviewDialog();
#endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW)
void OnPrintingDone(bool success); void OnPrintingDone(bool success);
@@ -204,7 +202,6 @@ class PrintRenderFrameHelper @@ -203,7 +201,6 @@ class PrintRenderFrameHelper
// Update |ignore_css_margins_| based on settings. // Update |ignore_css_margins_| based on settings.
void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings); void UpdateFrameMarginsCssInfo(const base::DictionaryValue& settings);
@ -487,7 +454,7 @@ index cd174ca65085..bbef96f246ef 100644
// Prepare frame for creating preview document. // Prepare frame for creating preview document.
void PrepareFrameForPreviewDocument(); void PrepareFrameForPreviewDocument();
@@ -221,7 +218,6 @@ class PrintRenderFrameHelper @@ -220,7 +217,6 @@ class PrintRenderFrameHelper
// Finalize the print ready preview document. // Finalize the print ready preview document.
bool FinalizePrintReadyDocument(); bool FinalizePrintReadyDocument();
@ -495,7 +462,7 @@ index cd174ca65085..bbef96f246ef 100644
// Enable/Disable printing. // Enable/Disable printing.
void OnSetPrintingEnabled(bool enabled); void OnSetPrintingEnabled(bool enabled);
@@ -251,7 +247,6 @@ class PrintRenderFrameHelper @@ -250,7 +246,6 @@ class PrintRenderFrameHelper
const blink::WebNode& node, const blink::WebNode& node,
int* number_of_pages); int* number_of_pages);
@ -503,7 +470,7 @@ index cd174ca65085..bbef96f246ef 100644
// Set options for print preset from source PDF document. // Set options for print preset from source PDF document.
bool SetOptionsFromPdfDocument( bool SetOptionsFromPdfDocument(
PrintHostMsg_SetOptionsFromDocument_Params* options); PrintHostMsg_SetOptionsFromDocument_Params* options);
@@ -262,7 +257,6 @@ class PrintRenderFrameHelper @@ -261,7 +256,6 @@ class PrintRenderFrameHelper
bool UpdatePrintSettings(blink::WebLocalFrame* frame, bool UpdatePrintSettings(blink::WebLocalFrame* frame,
const blink::WebNode& node, const blink::WebNode& node,
const base::DictionaryValue& passed_job_settings); const base::DictionaryValue& passed_job_settings);
@ -527,7 +494,7 @@ index cd174ca65085..bbef96f246ef 100644
void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings); void SetPrintPagesParams(const PrintMsg_PrintPages_Params& settings);
@@ -526,6 +518,7 @@ class PrintRenderFrameHelper @@ -523,6 +515,7 @@ class PrintRenderFrameHelper
ScriptingThrottler scripting_throttler_; ScriptingThrottler scripting_throttler_;
bool print_node_in_progress_; bool print_node_in_progress_;

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc diff --git chrome/browser/printing/print_job_worker.cc chrome/browser/printing/print_job_worker.cc
index 6f185aef2feb..1c2e0fae7f47 100644 index 4f093cb61d69..60bb7a4f40ea 100644
--- chrome/browser/printing/print_job_worker.cc --- chrome/browser/printing/print_job_worker.cc
+++ chrome/browser/printing/print_job_worker.cc +++ chrome/browser/printing/print_job_worker.cc
@@ -129,6 +129,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id, @@ -140,6 +140,7 @@ PrintJobWorker::PrintJobWorker(int render_process_id,
weak_factory_(this) { weak_factory_(this) {
// The object is created in the IO thread. // The object is created in the IO thread.
DCHECK(owner_->RunsTasksInCurrentSequence()); DCHECK(owner_->RunsTasksInCurrentSequence());

View File

@ -1,8 +1,8 @@
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
index 3adf96eda163..673f4c689fcb 100644 index 5bebf776d70d..7e7eba1be689 100644
--- content/browser/renderer_host/render_widget_host_view_aura.cc --- content/browser/renderer_host/render_widget_host_view_aura.cc
+++ content/browser/renderer_host/render_widget_host_view_aura.cc +++ content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -435,13 +435,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura( @@ -434,13 +434,6 @@ RenderWidgetHostViewAura::RenderWidgetHostViewAura(
selection_controller_client_.reset( selection_controller_client_.reset(
new TouchSelectionControllerClientAura(this)); new TouchSelectionControllerClientAura(this));
CreateSelectionController(); CreateSelectionController();
@ -16,7 +16,7 @@ index 3adf96eda163..673f4c689fcb 100644
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
@@ -775,8 +768,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer( @@ -780,8 +773,10 @@ void RenderWidgetHostViewAura::UpdateBackgroundColorFromRenderer(
background_color_ = color; background_color_ = color;
bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE; bool opaque = SkColorGetA(color) == SK_AlphaOPAQUE;
@ -29,7 +29,7 @@ index 3adf96eda163..673f4c689fcb 100644
} }
bool RenderWidgetHostViewAura::IsMouseLocked() { bool RenderWidgetHostViewAura::IsMouseLocked() {
@@ -1961,6 +1956,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) { @@ -1937,6 +1932,15 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
window_->Init(ui::LAYER_SOLID_COLOR); window_->Init(ui::LAYER_SOLID_COLOR);
window_->layer()->SetColor(background_color_); window_->layer()->SetColor(background_color_);

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/spellchecker/spellcheck_factory.cc chrome/browser/spellchecker/spellcheck_factory.cc diff --git chrome/browser/spellchecker/spellcheck_factory.cc chrome/browser/spellchecker/spellcheck_factory.cc
index 148ec2086d1f..cc7f9ac83481 100644 index f02ff11f8500..640ada6c2ce1 100644
--- chrome/browser/spellchecker/spellcheck_factory.cc --- chrome/browser/spellchecker/spellcheck_factory.cc
+++ chrome/browser/spellchecker/spellcheck_factory.cc +++ chrome/browser/spellchecker/spellcheck_factory.cc
@@ -18,6 +18,13 @@ @@ -18,6 +18,13 @@

View File

@ -13,8 +13,22 @@ index 71bf90c54ae5..d3308da307d7 100644
appcache_proxies_.push_back(proxy); appcache_proxies_.push_back(proxy);
} }
diff --git content/browser/background_fetch/background_fetch_service_impl.cc content/browser/background_fetch/background_fetch_service_impl.cc
index be53f5115d3d..92f09f04f3a1 100644
--- content/browser/background_fetch/background_fetch_service_impl.cc
+++ content/browser/background_fetch/background_fetch_service_impl.cc
@@ -38,8 +38,7 @@ void BackgroundFetchServiceImpl::Create(
BrowserThread::IO, FROM_HERE,
base::BindOnce(
BackgroundFetchServiceImpl::CreateOnIoThread,
- WrapRefCounted(static_cast<StoragePartitionImpl*>(
- render_process_host->GetStoragePartition())
+ WrapRefCounted(render_process_host->GetStoragePartition()
->GetBackgroundFetchContext()),
origin, std::move(request)));
}
diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc diff --git content/browser/blob_storage/chrome_blob_storage_context.cc content/browser/blob_storage/chrome_blob_storage_context.cc
index bf41a25bcd29..9e6dd89497e7 100644 index 0478c2f4dccf..4faa6c1d4b46 100644
--- content/browser/blob_storage/chrome_blob_storage_context.cc --- content/browser/blob_storage/chrome_blob_storage_context.cc
+++ content/browser/blob_storage/chrome_blob_storage_context.cc +++ content/browser/blob_storage/chrome_blob_storage_context.cc
@@ -76,6 +76,11 @@ class BlobHandleImpl : public BlobHandle { @@ -76,6 +76,11 @@ class BlobHandleImpl : public BlobHandle {
@ -30,10 +44,10 @@ index bf41a25bcd29..9e6dd89497e7 100644
BrowserContext* context) { BrowserContext* context) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h diff --git content/browser/blob_storage/chrome_blob_storage_context.h content/browser/blob_storage/chrome_blob_storage_context.h
index 2412f15c5fb7..3434d129af64 100644 index 8c5b031e1e65..bbe6fa6525a6 100644
--- content/browser/blob_storage/chrome_blob_storage_context.h --- content/browser/blob_storage/chrome_blob_storage_context.h
+++ content/browser/blob_storage/chrome_blob_storage_context.h +++ content/browser/blob_storage/chrome_blob_storage_context.h
@@ -47,6 +47,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext @@ -50,6 +50,8 @@ class CONTENT_EXPORT ChromeBlobStorageContext
public: public:
ChromeBlobStorageContext(); ChromeBlobStorageContext();
@ -97,7 +111,7 @@ index 125078b9cb44..b24609a807ba 100644
CHECK(GetUserData(kMojoWasInitialized)) CHECK(GetUserData(kMojoWasInitialized))
<< "Attempting to destroy a BrowserContext that never called " << "Attempting to destroy a BrowserContext that never called "
diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc diff --git content/browser/devtools/protocol/service_worker_handler.cc content/browser/devtools/protocol/service_worker_handler.cc
index d2478ae31473..5fd30c1cd72c 100644 index 64dff1f030bb..244f62ec40dc 100644
--- content/browser/devtools/protocol/service_worker_handler.cc --- content/browser/devtools/protocol/service_worker_handler.cc
+++ content/browser/devtools/protocol/service_worker_handler.cc +++ content/browser/devtools/protocol/service_worker_handler.cc
@@ -337,8 +337,7 @@ Response ServiceWorkerHandler::DispatchSyncEvent( @@ -337,8 +337,7 @@ Response ServiceWorkerHandler::DispatchSyncEvent(
@ -111,12 +125,12 @@ index d2478ae31473..5fd30c1cd72c 100644
BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc diff --git content/browser/download/download_manager_impl.cc content/browser/download/download_manager_impl.cc
index 0992aad5fe6c..788d432c48d9 100644 index 11eb1d3b732a..52962a868999 100644
--- content/browser/download/download_manager_impl.cc --- content/browser/download/download_manager_impl.cc
+++ content/browser/download/download_manager_impl.cc +++ content/browser/download/download_manager_impl.cc
@@ -83,9 +83,9 @@ WebContents* GetWebContents(int render_process_id, @@ -73,9 +73,9 @@
return WebContents::FromFrameTreeNodeId(frame_tree_node_id); namespace content {
} namespace {
-StoragePartitionImpl* GetStoragePartition(BrowserContext* context, -StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
- int render_process_id, - int render_process_id,
@ -127,7 +141,7 @@ index 0992aad5fe6c..788d432c48d9 100644
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
SiteInstance* site_instance = nullptr; SiteInstance* site_instance = nullptr;
@@ -95,8 +95,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context, @@ -85,8 +85,7 @@ StoragePartitionImpl* GetStoragePartition(BrowserContext* context,
if (render_frame_host_) if (render_frame_host_)
site_instance = render_frame_host_->GetSiteInstance(); site_instance = render_frame_host_->GetSiteInstance();
} }
@ -137,52 +151,49 @@ index 0992aad5fe6c..788d432c48d9 100644
} }
bool CanRequestURLFromRenderer(int render_process_id, GURL url) { bool CanRequestURLFromRenderer(int render_process_id, GURL url) {
@@ -987,16 +986,17 @@ void DownloadManagerImpl::BeginDownloadInternal( @@ -1069,7 +1068,7 @@ void DownloadManagerImpl::BeginDownloadInternal(
if (base::FeatureList::IsEnabled(features::kNetworkService)) { if (base::FeatureList::IsEnabled(features::kNetworkService)) {
std::unique_ptr<ResourceRequest> request = CreateResourceRequest( std::unique_ptr<network::ResourceRequest> request =
params.get()); CreateResourceRequest(params.get());
- StoragePartitionImpl* storage_partition = - StoragePartitionImpl* storage_partition =
+ StoragePartition* storage_partition = + StoragePartition* storage_partition =
GetStoragePartition(browser_context_, params->render_process_host_id(), GetStoragePartition(browser_context_, params->render_process_host_id(),
params->render_frame_host_routing_id()); params->render_frame_host_routing_id());
BrowserThread::PostTaskAndReplyWithResult(
@@ -1090,7 +1089,8 @@ void DownloadManagerImpl::BeginDownloadInternal(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
base::BindOnce( base::BindOnce(
&BeginResourceDownload, std::move(params), std::move(request), &BeginResourceDownload, std::move(params), std::move(request),
- storage_partition->url_loader_factory_getter(), - storage_partition->url_loader_factory_getter(),
- base::WrapRefCounted(storage_partition->GetFileSystemContext()),
- id, weak_factory_.GetWeakPtr()),
+ base::WrapRefCounted( + base::WrapRefCounted(
+ storage_partition->url_loader_factory_getter()), + storage_partition->url_loader_factory_getter()),
+ base::WrapRefCounted(storage_partition->GetFileSystemContext()), base::WrapRefCounted(storage_partition->GetFileSystemContext()), id,
+ id, weak_factory_.GetWeakPtr()), weak_factory_.GetWeakPtr(), site_url, tab_url, tab_referrer_url),
base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler, base::BindOnce(&DownloadManagerImpl::AddUrlDownloadHandler,
weak_factory_.GetWeakPtr()));
} else {
diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc diff --git content/browser/loader/navigation_url_loader_network_service.cc content/browser/loader/navigation_url_loader_network_service.cc
index 70148056059b..599b068dfdea 100644 index d9297fa8365e..38a3fb629a7a 100644
--- content/browser/loader/navigation_url_loader_network_service.cc --- content/browser/loader/navigation_url_loader_network_service.cc
+++ content/browser/loader/navigation_url_loader_network_service.cc +++ content/browser/loader/navigation_url_loader_network_service.cc
@@ -615,11 +615,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService( @@ -868,11 +868,12 @@ NavigationURLLoaderNetworkService::NavigationURLLoaderNetworkService(
.PassInterface();
g_next_request_id--; }
- auto* partition = static_cast<StoragePartitionImpl*>(storage_partition); - auto* partition = static_cast<StoragePartitionImpl*>(storage_partition);
+ auto* partition = storage_partition; + auto* partition = storage_partition;
DCHECK(!request_controller_); DCHECK(!request_controller_);
request_controller_ = std::make_unique<URLLoaderRequestController>( request_controller_ = std::make_unique<URLLoaderRequestController>(
std::move(initial_handlers), std::move(new_request), resource_context, std::move(initial_handlers), std::move(new_request), resource_context,
- partition->url_loader_factory_getter(), weak_factory_.GetWeakPtr()); - partition->url_loader_factory_getter(), request_info->common_params.url,
+ base::WrapRefCounted(partition->url_loader_factory_getter()), + base::WrapRefCounted(partition->url_loader_factory_getter()),
+ weak_factory_.GetWeakPtr()); + request_info->common_params.url,
BrowserThread::PostTask( request_info->begin_params->initiator_origin,
BrowserThread::IO, FROM_HERE, request_info->begin_params->suggested_filename,
base::BindOnce(&URLLoaderRequestController::Start, weak_factory_.GetWeakPtr());
diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc diff --git content/browser/payments/payment_app_provider_impl.cc content/browser/payments/payment_app_provider_impl.cc
index 8816724941ff..6b9a26b7c615 100644 index b9d2670514c0..004939aa055a 100644
--- content/browser/payments/payment_app_provider_impl.cc --- content/browser/payments/payment_app_provider_impl.cc
+++ content/browser/payments/payment_app_provider_impl.cc +++ content/browser/payments/payment_app_provider_impl.cc
@@ -329,10 +329,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context, @@ -328,10 +328,11 @@ void StartServiceWorkerForDispatch(BrowserContext* browser_context,
ServiceWorkerStartCallback callback) { ServiceWorkerStartCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -197,7 +208,7 @@ index 8816724941ff..6b9a26b7c615 100644
BrowserThread::PostTask( BrowserThread::PostTask(
BrowserThread::IO, FROM_HERE, BrowserThread::IO, FROM_HERE,
@@ -358,8 +359,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps( @@ -357,8 +358,8 @@ void PaymentAppProviderImpl::GetAllPaymentApps(
GetAllPaymentAppsCallback callback) { GetAllPaymentAppsCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -209,10 +220,10 @@ index 8816724941ff..6b9a26b7c615 100644
partition->GetPaymentAppContext(); partition->GetPaymentAppContext();
diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc diff --git content/browser/renderer_host/render_process_host_impl.cc content/browser/renderer_host/render_process_host_impl.cc
index a61b8ab0886e..5be550085df1 100644 index 22c72f3ac929..c12815670521 100644
--- content/browser/renderer_host/render_process_host_impl.cc --- content/browser/renderer_host/render_process_host_impl.cc
+++ content/browser/renderer_host/render_process_host_impl.cc +++ content/browser/renderer_host/render_process_host_impl.cc
@@ -500,9 +500,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver { @@ -497,9 +497,8 @@ class SpareRenderProcessHostManager : public RenderProcessHostObserver {
SpareRenderProcessHostManager() {} SpareRenderProcessHostManager() {}
void WarmupSpareRenderProcessHost(BrowserContext* browser_context) { void WarmupSpareRenderProcessHost(BrowserContext* browser_context) {
@ -224,7 +235,7 @@ index a61b8ab0886e..5be550085df1 100644
if (spare_render_process_host_ && if (spare_render_process_host_ &&
matching_browser_context_ == browser_context && matching_browser_context_ == browser_context &&
@@ -641,11 +640,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data, @@ -638,11 +637,10 @@ class DefaultSubframeProcessHostHolder : public base::SupportsUserData::Data,
// Gets the correct render process to use for this SiteInstance. // Gets the correct render process to use for this SiteInstance.
RenderProcessHost* GetProcessHost(SiteInstance* site_instance, RenderProcessHost* GetProcessHost(SiteInstance* site_instance,
bool is_for_guests_only) { bool is_for_guests_only) {
@ -240,7 +251,7 @@ index a61b8ab0886e..5be550085df1 100644
// Is this the default storage partition? If it isn't, then just give it its // Is this the default storage partition? If it isn't, then just give it its
// own non-shared process. // own non-shared process.
@@ -1240,7 +1238,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) { @@ -1237,7 +1235,7 @@ void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
// static // static
RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
BrowserContext* browser_context, BrowserContext* browser_context,
@ -249,7 +260,7 @@ index a61b8ab0886e..5be550085df1 100644
SiteInstance* site_instance, SiteInstance* site_instance,
bool is_for_guests_only) { bool is_for_guests_only) {
if (g_render_process_host_factory_) { if (g_render_process_host_factory_) {
@@ -1249,8 +1247,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( @@ -1246,8 +1244,8 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
} }
if (!storage_partition_impl) { if (!storage_partition_impl) {
@ -258,9 +269,9 @@ index a61b8ab0886e..5be550085df1 100644
+ storage_partition_impl = + storage_partition_impl =
+ BrowserContext::GetStoragePartition(browser_context, site_instance); + BrowserContext::GetStoragePartition(browser_context, site_instance);
} }
// If we've made a StoragePartition for guests (e.g., for the <webview> tag),
return new RenderProcessHostImpl(browser_context, storage_partition_impl, // stash the Site URL on it. This way, when we start a service worker inside
@@ -1260,7 +1258,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost( @@ -1269,7 +1267,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateRenderProcessHost(
// static // static
RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
BrowserContext* browser_context, BrowserContext* browser_context,
@ -269,7 +280,7 @@ index a61b8ab0886e..5be550085df1 100644
SiteInstance* site_instance, SiteInstance* site_instance,
bool is_for_guests_only) { bool is_for_guests_only) {
RenderProcessHost* render_process_host = RenderProcessHost* render_process_host =
@@ -1280,7 +1278,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost( @@ -1289,7 +1287,7 @@ RenderProcessHost* RenderProcessHostImpl::CreateOrUseSpareRenderProcessHost(
RenderProcessHostImpl::RenderProcessHostImpl( RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context, BrowserContext* browser_context,
@ -278,7 +289,7 @@ index a61b8ab0886e..5be550085df1 100644
bool is_for_guests_only) bool is_for_guests_only)
: fast_shutdown_started_(false), : fast_shutdown_started_(false),
deleting_soon_(false), deleting_soon_(false),
@@ -1316,7 +1314,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( @@ -1322,7 +1320,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
indexed_db_factory_(new IndexedDBDispatcherHost( indexed_db_factory_(new IndexedDBDispatcherHost(
id_, id_,
storage_partition_impl_->GetURLRequestContext(), storage_partition_impl_->GetURLRequestContext(),
@ -288,7 +299,7 @@ index a61b8ab0886e..5be550085df1 100644
ChromeBlobStorageContext::GetFor(browser_context_))), ChromeBlobStorageContext::GetFor(browser_context_))),
channel_connected_(false), channel_connected_(false),
sent_render_process_ready_(false), sent_render_process_ready_(false),
@@ -1350,7 +1349,8 @@ RenderProcessHostImpl::RenderProcessHostImpl( @@ -1356,7 +1355,8 @@ RenderProcessHostImpl::RenderProcessHostImpl(
} }
push_messaging_manager_.reset(new PushMessagingManager( push_messaging_manager_.reset(new PushMessagingManager(
@ -298,7 +309,7 @@ index a61b8ab0886e..5be550085df1 100644
AddObserver(indexed_db_factory_.get()); AddObserver(indexed_db_factory_.get());
@@ -1665,6 +1665,20 @@ void RenderProcessHostImpl::ResetChannelProxy() { @@ -1671,6 +1671,20 @@ void RenderProcessHostImpl::ResetChannelProxy() {
void RenderProcessHostImpl::CreateMessageFilters() { void RenderProcessHostImpl::CreateMessageFilters() {
DCHECK_CURRENTLY_ON(BrowserThread::UI); DCHECK_CURRENTLY_ON(BrowserThread::UI);
@ -319,7 +330,7 @@ index a61b8ab0886e..5be550085df1 100644
AddFilter(new ResourceSchedulerFilter(GetID())); AddFilter(new ResourceSchedulerFilter(GetID()));
MediaInternals* media_internals = MediaInternals::GetInstance(); MediaInternals* media_internals = MediaInternals::GetInstance();
// Add BrowserPluginMessageFilter to ensure it gets the first stab at messages // Add BrowserPluginMessageFilter to ensure it gets the first stab at messages
@@ -1679,8 +1693,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { @@ -1685,8 +1699,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
new RenderMessageFilter( new RenderMessageFilter(
GetID(), GetBrowserContext(), request_context.get(), GetID(), GetBrowserContext(), request_context.get(),
widget_helper_.get(), media_internals, widget_helper_.get(), media_internals,
@ -330,7 +341,7 @@ index a61b8ab0886e..5be550085df1 100644
AddFilter(render_message_filter.get()); AddFilter(render_message_filter.get());
render_frame_message_filter_ = new RenderFrameMessageFilter( render_frame_message_filter_ = new RenderFrameMessageFilter(
@@ -1709,10 +1723,10 @@ void RenderProcessHostImpl::CreateMessageFilters() { @@ -1715,10 +1729,10 @@ void RenderProcessHostImpl::CreateMessageFilters() {
ChromeBlobStorageContext::GetFor(browser_context); ChromeBlobStorageContext::GetFor(browser_context);
resource_message_filter_ = new ResourceMessageFilter( resource_message_filter_ = new ResourceMessageFilter(
@ -343,19 +354,17 @@ index a61b8ab0886e..5be550085df1 100644
BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); BrowserThread::GetTaskRunnerForThread(BrowserThread::IO));
AddFilter(resource_message_filter_.get()); AddFilter(resource_message_filter_.get());
@@ -1735,9 +1749,9 @@ void RenderProcessHostImpl::CreateMessageFilters() { @@ -1743,8 +1757,7 @@ void RenderProcessHostImpl::CreateMessageFilters() {
}
AddFilter( AddFilter(
new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service())); new MidiHost(GetID(), BrowserMainLoop::GetInstance()->midi_service()));
AddFilter(new AppCacheDispatcherHost( - AddFilter(new DOMStorageMessageFilter(
- storage_partition_impl_->GetAppCacheService(), GetID()));
+ app_cache_service, GetID()));
AddFilter(new DOMStorageMessageFilter(
- storage_partition_impl_->GetDOMStorageContext())); - storage_partition_impl_->GetDOMStorageContext()));
+ dom_storage_context)); + AddFilter(new DOMStorageMessageFilter(dom_storage_context));
#if BUILDFLAG(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
peer_connection_tracker_host_ = new PeerConnectionTrackerHost( peer_connection_tracker_host_ = new PeerConnectionTrackerHost(GetID());
@@ -1765,13 +1779,12 @@ void RenderProcessHostImpl::CreateMessageFilters() { @@ -1767,13 +1780,12 @@ void RenderProcessHostImpl::CreateMessageFilters() {
scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter = scoped_refptr<CacheStorageDispatcherHost> cache_storage_filter =
new CacheStorageDispatcherHost(); new CacheStorageDispatcherHost();
@ -371,7 +380,7 @@ index a61b8ab0886e..5be550085df1 100644
AddFilter(service_worker_filter.get()); AddFilter(service_worker_filter.get());
#if BUILDFLAG(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
@@ -1783,11 +1796,8 @@ void RenderProcessHostImpl::CreateMessageFilters() { @@ -1785,11 +1797,8 @@ void RenderProcessHostImpl::CreateMessageFilters() {
AddFilter(new TraceMessageFilter(GetID())); AddFilter(new TraceMessageFilter(GetID()));
AddFilter(new ResolveProxyMsgHelper(request_context.get())); AddFilter(new ResolveProxyMsgHelper(request_context.get()));
@ -384,11 +393,21 @@ index a61b8ab0886e..5be550085df1 100644
resource_context, service_worker_context, browser_context); resource_context, service_worker_context, browser_context);
AddFilter(notification_message_filter_.get()); AddFilter(notification_message_filter_.get());
@@ -1931,7 +1940,8 @@ void RenderProcessHostImpl::RegisterMojoInterfaces() {
registry->AddInterface(base::BindRepeating(
&AppCacheDispatcherHost::Create,
- base::Unretained(storage_partition_impl_->GetAppCacheService()),
+ base::Unretained(static_cast<ChromeAppCacheService*>(
+ storage_partition_impl_->GetAppCacheService())),
GetID()));
AddUIThreadInterface(registry.get(), base::Bind(&FieldTrialRecorder::Create));
diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h diff --git content/browser/renderer_host/render_process_host_impl.h content/browser/renderer_host/render_process_host_impl.h
index b5528d49e678..aaecb9f0b0f7 100644 index f81189990b1f..39afa6c9ecfd 100644
--- content/browser/renderer_host/render_process_host_impl.h --- content/browser/renderer_host/render_process_host_impl.h
+++ content/browser/renderer_host/render_process_host_impl.h +++ content/browser/renderer_host/render_process_host_impl.h
@@ -84,7 +84,6 @@ class ResourceMessageFilter; @@ -83,7 +83,6 @@ class ResourceMessageFilter;
class SiteInstance; class SiteInstance;
class SiteInstanceImpl; class SiteInstanceImpl;
class StoragePartition; class StoragePartition;
@ -396,7 +415,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
#if BUILDFLAG(ENABLE_WEBRTC) #if BUILDFLAG(ENABLE_WEBRTC)
class MediaStreamDispatcherHost; class MediaStreamDispatcherHost;
@@ -128,7 +127,7 @@ class CONTENT_EXPORT RenderProcessHostImpl @@ -127,7 +126,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// legal). // legal).
static RenderProcessHost* CreateOrUseSpareRenderProcessHost( static RenderProcessHost* CreateOrUseSpareRenderProcessHost(
BrowserContext* browser_context, BrowserContext* browser_context,
@ -405,7 +424,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
SiteInstance* site_instance, SiteInstance* site_instance,
bool is_for_guests_only); bool is_for_guests_only);
@@ -140,7 +139,7 @@ class CONTENT_EXPORT RenderProcessHostImpl @@ -139,7 +138,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// null. // null.
static RenderProcessHost* CreateRenderProcessHost( static RenderProcessHost* CreateRenderProcessHost(
BrowserContext* browser_context, BrowserContext* browser_context,
@ -414,7 +433,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
SiteInstance* site_instance, SiteInstance* site_instance,
bool is_for_guests_only); bool is_for_guests_only);
@@ -422,7 +421,7 @@ class CONTENT_EXPORT RenderProcessHostImpl @@ -420,7 +419,7 @@ class CONTENT_EXPORT RenderProcessHostImpl
// Use CreateRenderProcessHost() instead of calling this constructor // Use CreateRenderProcessHost() instead of calling this constructor
// directly. // directly.
RenderProcessHostImpl(BrowserContext* browser_context, RenderProcessHostImpl(BrowserContext* browser_context,
@ -423,7 +442,7 @@ index b5528d49e678..aaecb9f0b0f7 100644
bool is_for_guests_only); bool is_for_guests_only);
// Initializes a new IPC::ChannelProxy in |channel_|, which will be connected // Initializes a new IPC::ChannelProxy in |channel_|, which will be connected
@@ -657,10 +656,10 @@ class CONTENT_EXPORT RenderProcessHostImpl @@ -656,10 +655,10 @@ class CONTENT_EXPORT RenderProcessHostImpl
// called. // called.
int instance_id_ = 1; int instance_id_ = 1;
@ -437,10 +456,10 @@ index b5528d49e678..aaecb9f0b0f7 100644
// The observers watching our lifetime. // The observers watching our lifetime.
base::ObserverList<RenderProcessHostObserver> observers_; base::ObserverList<RenderProcessHostObserver> observers_;
diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc diff --git content/browser/renderer_interface_binders.cc content/browser/renderer_interface_binders.cc
index 082e5c990dcc..8398a8613b08 100644 index 01ba96322f69..6dde251b3d1b 100644
--- content/browser/renderer_interface_binders.cc --- content/browser/renderer_interface_binders.cc
+++ content/browser/renderer_interface_binders.cc +++ content/browser/renderer_interface_binders.cc
@@ -112,7 +112,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { @@ -133,7 +133,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface( parameterized_binder_registry_.AddInterface(
base::Bind([](payments::mojom::PaymentManagerRequest request, base::Bind([](payments::mojom::PaymentManagerRequest request,
RenderProcessHost* host, const url::Origin& origin) { RenderProcessHost* host, const url::Origin& origin) {
@ -449,7 +468,16 @@ index 082e5c990dcc..8398a8613b08 100644
->GetPaymentAppContext() ->GetPaymentAppContext()
->CreatePaymentManager(std::move(request)); ->CreatePaymentManager(std::move(request));
})); }));
@@ -128,9 +128,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() { @@ -147,7 +147,7 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface(base::BindRepeating(
[](blink::mojom::LockManagerRequest request, RenderProcessHost* host,
const url::Origin& origin) {
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition())
+ host->GetStoragePartition()
->GetLockManager()
->CreateService(std::move(request), origin);
}));
@@ -156,9 +156,10 @@ void RendererInterfaceBinders::InitializeParameterizedBinderRegistry() {
parameterized_binder_registry_.AddInterface( parameterized_binder_registry_.AddInterface(
base::Bind([](blink::mojom::NotificationServiceRequest request, base::Bind([](blink::mojom::NotificationServiceRequest request,
RenderProcessHost* host, const url::Origin& origin) { RenderProcessHost* host, const url::Origin& origin) {
@ -461,77 +489,43 @@ index 082e5c990dcc..8398a8613b08 100644
+ ->GetPlatformNotificationContext()) + ->GetPlatformNotificationContext())
+ ->CreateService(host->GetID(), origin, std::move(request)); + ->CreateService(host->GetID(), origin, std::move(request));
})); }));
} parameterized_binder_registry_.AddInterface(
base::BindRepeating(&BackgroundFetchServiceImpl::Create));
diff --git content/browser/shared_worker/shared_worker_connector_impl.cc content/browser/shared_worker/shared_worker_connector_impl.cc diff --git content/browser/shared_worker/shared_worker_connector_impl.cc content/browser/shared_worker/shared_worker_connector_impl.cc
index 4fb7fcdb85c9..bf0155992715 100644 index 1e95910e7168..45adb88b1e96 100644
--- content/browser/shared_worker/shared_worker_connector_impl.cc --- content/browser/shared_worker/shared_worker_connector_impl.cc
+++ content/browser/shared_worker/shared_worker_connector_impl.cc +++ content/browser/shared_worker/shared_worker_connector_impl.cc
@@ -23,20 +23,22 @@ void SharedWorkerConnectorImpl::Create( @@ -34,10 +34,9 @@ void SharedWorkerConnectorImpl::Connect(
RenderProcessHost* host = RenderProcessHost::FromID(process_id); mojom::SharedWorkerClientPtr client,
ResourceContext* resource_context = blink::mojom::SharedWorkerCreationContextType creation_context_type,
host->GetBrowserContext()->GetResourceContext(); mojo::ScopedMessagePipeHandle message_port) {
- StoragePartitionImpl* storage_partition_impl = - SharedWorkerServiceImpl* service =
- static_cast<StoragePartitionImpl*>(host->GetStoragePartition()); - static_cast<StoragePartitionImpl*>(
+ StoragePartition* storage_partition_impl = host->GetStoragePartition(); - RenderProcessHost::FromID(process_id_)->GetStoragePartition())
- ->GetSharedWorkerService();
// TODO(darin): Surely there can be a better way to extract a comparable + SharedWorkerServiceImpl* service = static_cast<SharedWorkerServiceImpl*>(
// identifier from a StoragePartition instance. + RenderProcessHost::FromID(process_id_)->GetStoragePartition()
WorkerStoragePartition worker_storage_partition( + ->GetSharedWorkerService());
storage_partition_impl->GetURLRequestContext(), service->ConnectToWorker(process_id_, frame_id_, std::move(info),
storage_partition_impl->GetMediaURLRequestContext(), std::move(client), creation_context_type,
- storage_partition_impl->GetAppCacheService(), blink::MessagePortChannel(std::move(message_port)));
+ static_cast<ChromeAppCacheService*>(
+ storage_partition_impl->GetAppCacheService()),
storage_partition_impl->GetQuotaManager(),
storage_partition_impl->GetFileSystemContext(),
storage_partition_impl->GetDatabaseTracker(),
- storage_partition_impl->GetIndexedDBContext(),
- storage_partition_impl->GetServiceWorkerContext());
+ static_cast<IndexedDBContextImpl*>(
+ storage_partition_impl->GetIndexedDBContext()),
+ static_cast<ServiceWorkerContextWrapper*>(
+ storage_partition_impl->GetServiceWorkerContext()));
CreateInternal(process_id, frame_id, resource_context,
worker_storage_partition, std::move(request));
diff --git content/browser/shared_worker/shared_worker_service_impl.cc content/browser/shared_worker/shared_worker_service_impl.cc
index ecf29e7851da..bba93010b3ad 100644
--- content/browser/shared_worker/shared_worker_service_impl.cc
+++ content/browser/shared_worker/shared_worker_service_impl.cc
@@ -63,17 +63,19 @@ bool SharedWorkerServiceImpl::TerminateWorker(
const url::Origin& constructor_origin,
StoragePartition* storage_partition,
ResourceContext* resource_context) {
- StoragePartitionImpl* storage_partition_impl =
- static_cast<StoragePartitionImpl*>(storage_partition);
+ StoragePartition* storage_partition_impl = storage_partition;
WorkerStoragePartitionId partition_id(WorkerStoragePartition(
storage_partition_impl->GetURLRequestContext(),
storage_partition_impl->GetMediaURLRequestContext(),
- storage_partition_impl->GetAppCacheService(),
+ static_cast<ChromeAppCacheService*>(
+ storage_partition_impl->GetAppCacheService()),
storage_partition_impl->GetQuotaManager(),
storage_partition_impl->GetFileSystemContext(),
storage_partition_impl->GetDatabaseTracker(),
- storage_partition_impl->GetIndexedDBContext(),
- storage_partition_impl->GetServiceWorkerContext()));
+ static_cast<IndexedDBContextImpl*>(
+ storage_partition_impl->GetIndexedDBContext()),
+ static_cast<ServiceWorkerContextWrapper*>(
+ storage_partition_impl->GetServiceWorkerContext())));
for (const auto& iter : worker_hosts_) {
SharedWorkerHost* host = iter.second.get();
diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h diff --git content/browser/storage_partition_impl.h content/browser/storage_partition_impl.h
index 54818f596e4c..58bd25f9bd24 100644 index 4fb38a200f04..182f14ead806 100644
--- content/browser/storage_partition_impl.h --- content/browser/storage_partition_impl.h
+++ content/browser/storage_partition_impl.h +++ content/browser/storage_partition_impl.h
@@ -119,13 +119,13 @@ class CONTENT_EXPORT StoragePartitionImpl @@ -87,7 +87,7 @@ class CONTENT_EXPORT StoragePartitionImpl
storage::FileSystemContext* GetFileSystemContext() override;
storage::DatabaseTracker* GetDatabaseTracker() override;
DOMStorageContextWrapper* GetDOMStorageContext() override;
- LockManager* GetLockManager(); // override; TODO: Add to interface
+ LockManager* GetLockManager() override;
IndexedDBContextImpl* GetIndexedDBContext() override;
CacheStorageContextImpl* GetCacheStorageContext() override;
ServiceWorkerContextWrapper* GetServiceWorkerContext() override;
@@ -124,13 +124,13 @@ class CONTENT_EXPORT StoragePartitionImpl
void ClearBluetoothAllowedDevicesMapForTesting() override; void ClearBluetoothAllowedDevicesMapForTesting() override;
void SetNetworkFactoryForTesting( void FlushNetworkInterfaceForTesting() override;
mojom::URLLoaderFactory* test_factory) override;
- BackgroundFetchContext* GetBackgroundFetchContext(); - BackgroundFetchContext* GetBackgroundFetchContext();
- BackgroundSyncContext* GetBackgroundSyncContext(); - BackgroundSyncContext* GetBackgroundSyncContext();
- PaymentAppContextImpl* GetPaymentAppContext(); - PaymentAppContextImpl* GetPaymentAppContext();
@ -549,7 +543,7 @@ index 54818f596e4c..58bd25f9bd24 100644
// mojom::StoragePartitionService interface. // mojom::StoragePartitionService interface.
void OpenLocalStorage( void OpenLocalStorage(
@@ -136,18 +136,18 @@ class CONTENT_EXPORT StoragePartitionImpl @@ -141,18 +141,18 @@ class CONTENT_EXPORT StoragePartitionImpl
const url::Origin& origin, const url::Origin& origin,
mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override; mojo::InterfaceRequest<mojom::LevelDBWrapper> request) override;
@ -572,6 +566,20 @@ index 54818f596e4c..58bd25f9bd24 100644
auto& bindings_for_testing() { return bindings_; } auto& bindings_for_testing() { return bindings_; }
@@ -163,10 +163,11 @@ class CONTENT_EXPORT StoragePartitionImpl
// one must use the "chrome-guest://blahblah" site URL to ensure that the
// service worker stays in this StoragePartition. This is an empty GURL if
// this StoragePartition is not for guests.
- void set_site_for_service_worker(const GURL& site_for_service_worker) {
+ void set_site_for_service_worker(
+ const GURL& site_for_service_worker) override {
site_for_service_worker_ = site_for_service_worker;
}
- const GURL& site_for_service_worker() const {
+ const GURL& site_for_service_worker() const override {
return site_for_service_worker_;
}
diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc diff --git content/browser/streams/stream_context.cc content/browser/streams/stream_context.cc
index 7aafca3aafcd..aac07962f6a5 100644 index 7aafca3aafcd..aac07962f6a5 100644
--- content/browser/streams/stream_context.cc --- content/browser/streams/stream_context.cc
@ -601,7 +609,7 @@ index 075ae3e7431e..57fb5fd2c4a8 100644
void InitializeOnIOThread(); void InitializeOnIOThread();
diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc diff --git content/browser/webui/web_ui_url_loader_factory.cc content/browser/webui/web_ui_url_loader_factory.cc
index 8996f11d328e..75b658f5a2d2 100644 index 53845bd346ed..e2c023cd688e 100644
--- content/browser/webui/web_ui_url_loader_factory.cc --- content/browser/webui/web_ui_url_loader_factory.cc
+++ content/browser/webui/web_ui_url_loader_factory.cc +++ content/browser/webui/web_ui_url_loader_factory.cc
@@ -20,13 +20,13 @@ @@ -20,13 +20,13 @@
@ -618,8 +626,8 @@ index 8996f11d328e..75b658f5a2d2 100644
+#include "content/public/browser/storage_partition.h" +#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "content/public/common/network_service.mojom.h" #include "content/public/common/url_constants.h"
@@ -296,9 +296,8 @@ class WebUIURLLoaderFactory : public mojom::URLLoaderFactory, @@ -302,9 +302,8 @@ class WebUIURLLoaderFactory : public network::mojom::URLLoaderFactory,
const std::string& scheme() const { return scheme_; } const std::string& scheme() const { return scheme_; }
private: private:
@ -660,18 +668,18 @@ index f75be61ccdef..84f1063fb081 100644
std::map<std::string, service_manager::EmbeddedServiceInfo>; std::map<std::string, service_manager::EmbeddedServiceInfo>;
diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h diff --git content/public/browser/storage_partition.h content/public/browser/storage_partition.h
index fa9a14e82472..7ed0814308aa 100644 index 9bf0a872f380..73ede1ccdedf 100644
--- content/public/browser/storage_partition.h --- content/public/browser/storage_partition.h
+++ content/public/browser/storage_partition.h +++ content/public/browser/storage_partition.h
@@ -14,6 +14,7 @@ @@ -13,6 +13,7 @@
#include "base/files/file_path.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
#include "content/public/common/url_loader_factory.mojom.h"
+#include "mojo/public/cpp/bindings/binding_set.h" +#include "mojo/public/cpp/bindings/binding_set.h"
#include "net/cookies/cookie_store.h" #include "net/cookies/cookie_store.h"
class GURL; class GURL;
@@ -42,12 +43,20 @@ class DatabaseTracker; @@ -49,13 +50,22 @@ class DatabaseTracker;
namespace content { namespace content {
class AppCacheService; class AppCacheService;
@ -685,29 +693,38 @@ index fa9a14e82472..7ed0814308aa 100644
class CacheStorageContext; class CacheStorageContext;
class DOMStorageContext; class DOMStorageContext;
class IndexedDBContext; class IndexedDBContext;
+class LockManager;
+class PaymentAppContextImpl; +class PaymentAppContextImpl;
class PlatformNotificationContext; class PlatformNotificationContext;
class ServiceWorkerContext; class ServiceWorkerContext;
class SharedWorkerService;
+class URLLoaderFactoryGetter; +class URLLoaderFactoryGetter;
#if !defined(OS_ANDROID) #if !defined(OS_ANDROID)
class HostZoomLevelContext; class HostZoomLevelContext;
@@ -60,6 +69,11 @@ class NetworkContext; @@ -63,6 +73,10 @@ class HostZoomMap;
class URLLoaderFactory; class ZoomLevelDelegate;
} #endif // !defined(OS_ANDROID)
+namespace mojom { +namespace mojom {
+class NetworkContext;
+class StoragePartitionService; +class StoragePartitionService;
+} +}
+ +
// Defines what persistent state a child process can access. // Defines what persistent state a child process can access.
// //
// The StoragePartition defines the view each child process has of the // The StoragePartition defines the view each child process has of the
@@ -92,6 +106,13 @@ class CONTENT_EXPORT StoragePartition { @@ -88,6 +102,7 @@ class CONTENT_EXPORT StoragePartition {
virtual ZoomLevelDelegate* GetZoomLevelDelegate() = 0; virtual storage::FileSystemContext* GetFileSystemContext() = 0;
#endif // !defined(OS_ANDROID) virtual storage::DatabaseTracker* GetDatabaseTracker() = 0;
virtual PlatformNotificationContext* GetPlatformNotificationContext() = 0; virtual DOMStorageContext* GetDOMStorageContext() = 0;
+ virtual LockManager* GetLockManager() = 0;
virtual IndexedDBContext* GetIndexedDBContext() = 0;
virtual ServiceWorkerContext* GetServiceWorkerContext() = 0;
virtual SharedWorkerService* GetSharedWorkerService() = 0;
@@ -204,6 +219,25 @@ class CONTENT_EXPORT StoragePartition {
// use only.
virtual void FlushNetworkInterfaceForTesting() = 0;
+ virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0; + virtual BackgroundFetchContext* GetBackgroundFetchContext() = 0;
+ virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0; + virtual BackgroundSyncContext* GetBackgroundSyncContext() = 0;
+ virtual PaymentAppContextImpl* GetPaymentAppContext() = 0; + virtual PaymentAppContextImpl* GetPaymentAppContext() = 0;
@ -715,29 +732,26 @@ index fa9a14e82472..7ed0814308aa 100644
+ virtual BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() = 0; + virtual BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() = 0;
+ virtual BlobURLLoaderFactory* GetBlobURLLoaderFactory() = 0; + virtual BlobURLLoaderFactory* GetBlobURLLoaderFactory() = 0;
+ virtual BlobRegistryWrapper* GetBlobRegistry() = 0; + virtual BlobRegistryWrapper* GetBlobRegistry() = 0;
+
enum : uint32_t {
REMOVE_DATA_MASK_APPCACHE = 1 << 0,
@@ -200,6 +221,14 @@ class CONTENT_EXPORT StoragePartition {
virtual void SetNetworkFactoryForTesting(
mojom::URLLoaderFactory* test_factory) = 0;
+ virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0; + virtual URLLoaderFactoryGetter* url_loader_factory_getter() = 0;
+ virtual BrowserContext* browser_context() const = 0; + virtual BrowserContext* browser_context() const = 0;
+ +
+ // Called by each renderer process once.
+ virtual mojo::BindingId Bind( + virtual mojo::BindingId Bind(
+ int process_id, + int process_id,
+ mojo::InterfaceRequest<mojom::StoragePartitionService> request) = 0; + mojo::InterfaceRequest<mojom::StoragePartitionService> request) = 0;
+
+ virtual void set_site_for_service_worker(
+ const GURL& site_for_service_worker) = 0;
+ virtual const GURL& site_for_service_worker() const = 0;
+ +
protected: protected:
virtual ~StoragePartition() {} virtual ~StoragePartition() {}
}; };
diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc diff --git storage/browser/database/database_tracker.cc storage/browser/database/database_tracker.cc
index e4ee15fd49ab..5adc8867d6df 100644 index e1e508e205be..10432c7d833e 100644
--- storage/browser/database/database_tracker.cc --- storage/browser/database/database_tracker.cc
+++ storage/browser/database/database_tracker.cc +++ storage/browser/database/database_tracker.cc
@@ -492,7 +492,7 @@ bool DatabaseTracker::LazyInit() { @@ -491,7 +491,7 @@ bool DatabaseTracker::LazyInit() {
meta_table_.reset(new sql::MetaTable()); meta_table_.reset(new sql::MetaTable());
is_initialized_ = is_initialized_ =

View File

@ -39,10 +39,10 @@ index 0755f2752f1d..0322b8c638e7 100644
virtual void MenuWillShow() {} virtual void MenuWillShow() {}
diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc diff --git ui/gfx/render_text.cc ui/gfx/render_text.cc
index cb77d5b27ccf..4abcb5712945 100644 index b5f58764ecb9..37359d823c57 100644
--- ui/gfx/render_text.cc --- ui/gfx/render_text.cc
+++ ui/gfx/render_text.cc +++ ui/gfx/render_text.cc
@@ -501,6 +501,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) { @@ -513,6 +513,14 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) {
} }
} }
@ -57,7 +57,7 @@ index cb77d5b27ccf..4abcb5712945 100644
void RenderText::SetDisplayRect(const Rect& r) { void RenderText::SetDisplayRect(const Rect& r) {
if (r != display_rect_) { if (r != display_rect_) {
display_rect_ = r; display_rect_ = r;
@@ -1448,6 +1456,19 @@ void RenderText::OnTextAttributeChanged() { @@ -1465,6 +1473,19 @@ void RenderText::OnTextAttributeChanged() {
if (!multiline_ && replace_newline_chars_with_symbols_) if (!multiline_ && replace_newline_chars_with_symbols_)
base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_); base::ReplaceChars(layout_text_, kNewline, kNewlineSymbol, &layout_text_);
@ -78,10 +78,10 @@ index cb77d5b27ccf..4abcb5712945 100644
} }
diff --git ui/gfx/render_text.h ui/gfx/render_text.h diff --git ui/gfx/render_text.h ui/gfx/render_text.h
index 259f39b2825b..5b71cd6c6a46 100644 index 0b8b82a2bc80..f0eba4248c56 100644
--- ui/gfx/render_text.h --- ui/gfx/render_text.h
+++ ui/gfx/render_text.h +++ ui/gfx/render_text.h
@@ -283,6 +283,10 @@ class GFX_EXPORT RenderText { @@ -293,6 +293,10 @@ class GFX_EXPORT RenderText {
void SetElideBehavior(ElideBehavior elide_behavior); void SetElideBehavior(ElideBehavior elide_behavior);
ElideBehavior elide_behavior() const { return elide_behavior_; } ElideBehavior elide_behavior() const { return elide_behavior_; }
@ -92,7 +92,7 @@ index 259f39b2825b..5b71cd6c6a46 100644
const Rect& display_rect() const { return display_rect_; } const Rect& display_rect() const { return display_rect_; }
void SetDisplayRect(const Rect& r); void SetDisplayRect(const Rect& r);
@@ -840,6 +844,8 @@ class GFX_EXPORT RenderText { @@ -850,6 +854,8 @@ class GFX_EXPORT RenderText {
// Extra spacing placed between glyphs; used for obscured text styling. // Extra spacing placed between glyphs; used for obscured text styling.
int glyph_spacing_ = 0; int glyph_spacing_ = 0;
@ -115,7 +115,7 @@ index 8ac475fa752c..ec58c2b28441 100644
static constexpr int kInkDropSmallCornerRadius = 2; static constexpr int kInkDropSmallCornerRadius = 2;
static constexpr int kInkDropLargeCornerRadius = 4; static constexpr int kInkDropLargeCornerRadius = 4;
diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc diff --git ui/views/controls/button/label_button.cc ui/views/controls/button/label_button.cc
index 57e2b0a910f0..6a17ba24a7d3 100644 index 6fc12bbc6f9b..a82c282a7c31 100644
--- ui/views/controls/button/label_button.cc --- ui/views/controls/button/label_button.cc
+++ ui/views/controls/button/label_button.cc +++ ui/views/controls/button/label_button.cc
@@ -188,6 +188,7 @@ gfx::Size LabelButton::CalculatePreferredSize() const { @@ -188,6 +188,7 @@ gfx::Size LabelButton::CalculatePreferredSize() const {
@ -126,7 +126,7 @@ index 57e2b0a910f0..6a17ba24a7d3 100644
if (style_ == STYLE_BUTTON) { if (style_ == STYLE_BUTTON) {
// Some text appears wider when rendered normally than when rendered bold. // Some text appears wider when rendered normally than when rendered bold.
@@ -400,6 +401,12 @@ std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight() @@ -398,6 +399,12 @@ std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight()
gfx::RectF(image()->GetMirroredBounds()).CenterPoint()); gfx::RectF(image()->GetMirroredBounds()).CenterPoint());
} }
@ -140,10 +140,10 @@ index 57e2b0a910f0..6a17ba24a7d3 100644
const gfx::Size previous_image_size(image_->GetPreferredSize()); const gfx::Size previous_image_size(image_->GetPreferredSize());
UpdateImage(); UpdateImage();
diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h diff --git ui/views/controls/button/label_button.h ui/views/controls/button/label_button.h
index 259c355b1d2d..d86f909d95ed 100644 index b2323dae3d9e..4b9546ca1a61 100644
--- ui/views/controls/button/label_button.h --- ui/views/controls/button/label_button.h
+++ ui/views/controls/button/label_button.h +++ ui/views/controls/button/label_button.h
@@ -105,6 +105,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate { @@ -102,6 +102,9 @@ class VIEWS_EXPORT LabelButton : public Button, public NativeThemeDelegate {
std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override; std::unique_ptr<InkDropRipple> CreateInkDropRipple() const override;
std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override; std::unique_ptr<InkDropHighlight> CreateInkDropHighlight() const override;
@ -154,10 +154,10 @@ index 259c355b1d2d..d86f909d95ed 100644
ImageView* image() const { return image_; } ImageView* image() const { return image_; }
Label* label() const; Label* label() const;
diff --git ui/views/controls/button/menu_button.cc ui/views/controls/button/menu_button.cc diff --git ui/views/controls/button/menu_button.cc ui/views/controls/button/menu_button.cc
index 8a823199304a..c1c6d3d8972d 100644 index 536fd0159e28..4c6402a29596 100644
--- ui/views/controls/button/menu_button.cc --- ui/views/controls/button/menu_button.cc
+++ ui/views/controls/button/menu_button.cc +++ ui/views/controls/button/menu_button.cc
@@ -186,7 +186,7 @@ bool MenuButton::IsTriggerableEventType(const ui::Event& event) { @@ -178,7 +178,7 @@ bool MenuButton::IsTriggerableEventType(const ui::Event& event) {
gfx::Size MenuButton::CalculatePreferredSize() const { gfx::Size MenuButton::CalculatePreferredSize() const {
gfx::Size prefsize = LabelButton::CalculatePreferredSize(); gfx::Size prefsize = LabelButton::CalculatePreferredSize();
if (show_menu_marker_) { if (show_menu_marker_) {
@ -166,7 +166,7 @@ index 8a823199304a..c1c6d3d8972d 100644
kMenuMarkerPaddingRight, kMenuMarkerPaddingRight,
0); 0);
} }
@@ -316,7 +316,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() { @@ -311,7 +311,7 @@ gfx::Rect MenuButton::GetChildAreaBounds() {
gfx::Size s = size(); gfx::Size s = size();
if (show_menu_marker_) { if (show_menu_marker_) {
@ -175,7 +175,7 @@ index 8a823199304a..c1c6d3d8972d 100644
kMenuMarkerPaddingRight); kMenuMarkerPaddingRight);
} }
@@ -413,4 +413,10 @@ int MenuButton::GetMaximumScreenXCoordinate() { @@ -408,4 +408,10 @@ int MenuButton::GetMaximumScreenXCoordinate() {
return monitor_bounds.right() - 1; return monitor_bounds.right() - 1;
} }
@ -187,7 +187,7 @@ index 8a823199304a..c1c6d3d8972d 100644
+ +
} // namespace views } // namespace views
diff --git ui/views/controls/button/menu_button.h ui/views/controls/button/menu_button.h diff --git ui/views/controls/button/menu_button.h ui/views/controls/button/menu_button.h
index e38200b8a43a..f40b079f82ec 100644 index 8fb11e1cf9cb..bd2951bd948b 100644
--- ui/views/controls/button/menu_button.h --- ui/views/controls/button/menu_button.h
+++ ui/views/controls/button/menu_button.h +++ ui/views/controls/button/menu_button.h
@@ -57,6 +57,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton { @@ -57,6 +57,9 @@ class VIEWS_EXPORT MenuButton : public LabelButton {
@ -211,7 +211,7 @@ index e38200b8a43a..f40b079f82ec 100644
// The time is used for simulating menu behavior for the menu button; that // The time is used for simulating menu behavior for the menu button; that
// is, if the menu is shown and the button is pressed, we need to close the // is, if the menu is shown and the button is pressed, we need to close the
diff --git ui/views/controls/label.cc ui/views/controls/label.cc diff --git ui/views/controls/label.cc ui/views/controls/label.cc
index df6851e8d212..8f5047f4aec7 100644 index 5fb2a8667c81..f725a0209267 100644
--- ui/views/controls/label.cc --- ui/views/controls/label.cc
+++ ui/views/controls/label.cc +++ ui/views/controls/label.cc
@@ -25,6 +25,7 @@ @@ -25,6 +25,7 @@
@ -243,7 +243,7 @@ index df6851e8d212..8f5047f4aec7 100644
} // namespace } // namespace
const char Label::kViewClassName[] = "Label"; const char Label::kViewClassName[] = "Label";
@@ -224,6 +239,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) { @@ -223,6 +238,15 @@ void Label::SetElideBehavior(gfx::ElideBehavior elide_behavior) {
ResetLayout(); ResetLayout();
} }
@ -252,21 +252,21 @@ index df6851e8d212..8f5047f4aec7 100644
+ return; + return;
+ is_first_paint_text_ = true; + is_first_paint_text_ = true;
+ draw_strings_flags_ = flags; + draw_strings_flags_ = flags;
+ render_text_->SetDrawStringsFlags(draw_strings_flags_); + full_text_->SetDrawStringsFlags(draw_strings_flags_);
+ ResetLayout(); + ResetLayout();
+} +}
+ +
void Label::SetTooltipText(const base::string16& tooltip_text) { void Label::SetTooltipText(const base::string16& tooltip_text) {
DCHECK(handles_tooltips_); DCHECK(handles_tooltips_);
tooltip_text_ = tooltip_text; tooltip_text_ = tooltip_text;
@@ -460,7 +484,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText( @@ -447,7 +471,19 @@ std::unique_ptr<gfx::RenderText> Label::CreateRenderText() const {
render_text->SetFontList(font_list()); render_text->SetFontList(font_list());
render_text->set_shadows(shadows()); render_text->set_shadows(shadows());
render_text->SetCursorEnabled(false); render_text->SetCursorEnabled(false);
- render_text->SetText(text); - render_text->SetText(text());
+ +
+ if (draw_strings_flags_ != 0) { + if (draw_strings_flags_ != 0) {
+ base::string16 text_str = text; + base::string16 text_str = text();
+ gfx::Range range = StripAcceleratorChars(draw_strings_flags_, &text_str); + gfx::Range range = StripAcceleratorChars(draw_strings_flags_, &text_str);
+ render_text->SetText(text_str); + render_text->SetText(text_str);
+ if (range.IsValid()) { + if (range.IsValid()) {
@ -274,14 +274,14 @@ index df6851e8d212..8f5047f4aec7 100644
+ render_text->ApplyStyle(gfx::UNDERLINE, true, range); + render_text->ApplyStyle(gfx::UNDERLINE, true, range);
+ } + }
+ } else { + } else {
+ render_text->SetText(text); + render_text->SetText(text());
+ } + }
+ +
return render_text; render_text->SetMultiline(multi_line());
} render_text->SetMaxLines(multi_line() ? max_lines() : 0);
render_text->SetWordWrapBehavior(full_text_->word_wrap_behavior());
diff --git ui/views/controls/label.h ui/views/controls/label.h diff --git ui/views/controls/label.h ui/views/controls/label.h
index ab6487ee6a60..0b105a658e8f 100644 index 1cee72792720..c212350b706f 100644
--- ui/views/controls/label.h --- ui/views/controls/label.h
+++ ui/views/controls/label.h +++ ui/views/controls/label.h
@@ -151,6 +151,10 @@ class VIEWS_EXPORT Label : public View, @@ -151,6 +151,10 @@ class VIEWS_EXPORT Label : public View,
@ -295,7 +295,7 @@ index ab6487ee6a60..0b105a658e8f 100644
// Sets the tooltip text. Default behavior for a label (single-line) is to // Sets the tooltip text. Default behavior for a label (single-line) is to
// show the full text if it is wider than its bounds. Calling this overrides // show the full text if it is wider than its bounds. Calling this overrides
// the default behavior and lets you set a custom tooltip. To revert to // the default behavior and lets you set a custom tooltip. To revert to
@@ -372,6 +376,7 @@ class VIEWS_EXPORT Label : public View, @@ -365,6 +369,7 @@ class VIEWS_EXPORT Label : public View,
bool collapse_when_hidden_; bool collapse_when_hidden_;
int fixed_width_; int fixed_width_;
int max_width_; int max_width_;
@ -552,7 +552,7 @@ index 875ac82283b3..44424b2ce138 100644
// Move the cursor because EnterNotify/LeaveNotify are generated with the // Move the cursor because EnterNotify/LeaveNotify are generated with the
// current mouse position as a result of XGrabPointer() // current mouse position as a result of XGrabPointer()
diff --git ui/views/view.h ui/views/view.h diff --git ui/views/view.h ui/views/view.h
index da4b110ecec8..f03291dcd330 100644 index f3075731dd61..5cb0d7211560 100644
--- ui/views/view.h --- ui/views/view.h
+++ ui/views/view.h +++ ui/views/view.h
@@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@

View File

@ -1,5 +1,5 @@
diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc diff --git content/browser/renderer_host/render_widget_host_view_base.cc content/browser/renderer_host/render_widget_host_view_base.cc
index 34248e7b2ef8..8ed9c3759202 100644 index 6dc8047e8a51..dfe15c9500d5 100644
--- content/browser/renderer_host/render_widget_host_view_base.cc --- content/browser/renderer_host/render_widget_host_view_base.cc
+++ content/browser/renderer_host/render_widget_host_view_base.cc +++ content/browser/renderer_host/render_widget_host_view_base.cc
@@ -326,6 +326,14 @@ void RenderWidgetHostViewBase::GetScreenInfo(ScreenInfo* screen_info) { @@ -326,6 +326,14 @@ void RenderWidgetHostViewBase::GetScreenInfo(ScreenInfo* screen_info) {
@ -18,7 +18,7 @@ index 34248e7b2ef8..8ed9c3759202 100644
return renderer_frame_number_; return renderer_frame_number_;
} }
diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h diff --git content/browser/renderer_host/render_widget_host_view_base.h content/browser/renderer_host/render_widget_host_view_base.h
index aac5858b18d8..652b07955fe8 100644 index 1115afb8a798..905572d2b8f1 100644
--- content/browser/renderer_host/render_widget_host_view_base.h --- content/browser/renderer_host/render_widget_host_view_base.h
+++ content/browser/renderer_host/render_widget_host_view_base.h +++ content/browser/renderer_host/render_widget_host_view_base.h
@@ -83,6 +83,7 @@ class BrowserAccessibilityManager; @@ -83,6 +83,7 @@ class BrowserAccessibilityManager;
@ -29,7 +29,7 @@ index aac5858b18d8..652b07955fe8 100644
class SyntheticGestureTarget; class SyntheticGestureTarget;
class TextInputManager; class TextInputManager;
class TouchSelectionControllerClientManager; class TouchSelectionControllerClientManager;
@@ -100,6 +101,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -99,6 +100,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
float current_device_scale_factor() const { float current_device_scale_factor() const {
return current_device_scale_factor_; return current_device_scale_factor_;
} }
@ -39,7 +39,7 @@ index aac5858b18d8..652b07955fe8 100644
// Returns the focused RenderWidgetHost inside this |view|'s RWH. // Returns the focused RenderWidgetHost inside this |view|'s RWH.
RenderWidgetHostImpl* GetFocusedWidget() const; RenderWidgetHostImpl* GetFocusedWidget() const;
@@ -130,6 +134,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -129,6 +133,8 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
void FocusedNodeTouched(const gfx::Point& location_dips_screen, void FocusedNodeTouched(const gfx::Point& location_dips_screen,
bool editable) override; bool editable) override;
void GetScreenInfo(ScreenInfo* screen_info) override; void GetScreenInfo(ScreenInfo* screen_info) override;
@ -48,7 +48,7 @@ index aac5858b18d8..652b07955fe8 100644
TouchSelectionControllerClientManager* TouchSelectionControllerClientManager*
GetTouchSelectionControllerClientManager() override; GetTouchSelectionControllerClientManager() override;
@@ -396,6 +402,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -409,6 +415,12 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
// helps to position the full screen widget on the correct monitor. // helps to position the full screen widget on the correct monitor.
virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0; virtual void InitAsFullscreen(RenderWidgetHostView* reference_host_view) = 0;
@ -61,7 +61,7 @@ index aac5858b18d8..652b07955fe8 100644
// Sets the cursor for this view to the one associated with the specified // Sets the cursor for this view to the one associated with the specified
// cursor_type. // cursor_type.
virtual void UpdateCursor(const WebCursor& cursor) = 0; virtual void UpdateCursor(const WebCursor& cursor) = 0;
@@ -542,6 +554,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView, @@ -554,6 +566,10 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView,
WebContentsAccessibility* web_contents_accessibility_; WebContentsAccessibility* web_contents_accessibility_;
@ -73,7 +73,7 @@ index aac5858b18d8..652b07955fe8 100644
#if defined(USE_AURA) #if defined(USE_AURA)
void OnDidScheduleEmbed(int routing_id, void OnDidScheduleEmbed(int routing_id,
diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc diff --git content/browser/renderer_host/render_widget_host_view_event_handler.cc content/browser/renderer_host/render_widget_host_view_event_handler.cc
index 8302a8563d85..7ae0a870071c 100644 index 5a751783f1af..7e71a7227e5f 100644
--- content/browser/renderer_host/render_widget_host_view_event_handler.cc --- content/browser/renderer_host/render_widget_host_view_event_handler.cc
+++ content/browser/renderer_host/render_widget_host_view_event_handler.cc +++ content/browser/renderer_host/render_widget_host_view_event_handler.cc
@@ -28,6 +28,10 @@ @@ -28,6 +28,10 @@
@ -87,7 +87,7 @@ index 8302a8563d85..7ae0a870071c 100644
#if defined(OS_WIN) #if defined(OS_WIN)
#include "content/browser/frame_host/render_frame_host_impl.h" #include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/public/common/context_menu_params.h" #include "content/public/common/context_menu_params.h"
@@ -857,6 +861,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() { @@ -880,6 +884,14 @@ void RenderWidgetHostViewEventHandler::SetKeyboardFocus() {
::SetFocus(hwnd); ::SetFocus(hwnd);
} }
} }
@ -103,10 +103,10 @@ index 8302a8563d85..7ae0a870071c 100644
// TODO(wjmaclean): can host_ ever be null? // TODO(wjmaclean): can host_ ever be null?
if (host_ && set_focus_on_mouse_down_or_key_event_) { if (host_ && set_focus_on_mouse_down_or_key_event_) {
diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h diff --git content/public/browser/render_widget_host_view.h content/public/browser/render_widget_host_view.h
index 6aa5a869ddc3..e00559a2958a 100644 index 70e4636903f2..3ada5a504fdb 100644
--- content/public/browser/render_widget_host_view.h --- content/public/browser/render_widget_host_view.h
+++ content/public/browser/render_widget_host_view.h +++ content/public/browser/render_widget_host_view.h
@@ -248,6 +248,14 @@ class CONTENT_EXPORT RenderWidgetHostView { @@ -251,6 +251,14 @@ class CONTENT_EXPORT RenderWidgetHostView {
// This method returns the ScreenInfo used by the view to render. // This method returns the ScreenInfo used by the view to render.
virtual void GetScreenInfo(ScreenInfo* screen_info) = 0; virtual void GetScreenInfo(ScreenInfo* screen_info) = 0;
@ -119,8 +119,8 @@ index 6aa5a869ddc3..e00559a2958a 100644
+ virtual bool HasExternalParent() const = 0; + virtual bool HasExternalParent() const = 0;
+ +
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Return the accelerated widget which hosts the CALayers that draw the // Set the view's active state (i.e., tint state of controls).
// content of the view in GetNativeView. This may be null. virtual void SetActive(bool active) = 0;
diff --git ui/views/widget/desktop_aura/desktop_screen_win.cc ui/views/widget/desktop_aura/desktop_screen_win.cc diff --git ui/views/widget/desktop_aura/desktop_screen_win.cc ui/views/widget/desktop_aura/desktop_screen_win.cc
index f772f64d656e..7d13f9f81b6c 100644 index f772f64d656e..7d13f9f81b6c 100644
--- ui/views/widget/desktop_aura/desktop_screen_win.cc --- ui/views/widget/desktop_aura/desktop_screen_win.cc
@ -135,7 +135,7 @@ index f772f64d656e..7d13f9f81b6c 100644
return host ? host->GetAcceleratedWidget() : NULL; return host ? host->GetAcceleratedWidget() : NULL;
} }
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
index 2128b18525f1..66420b860fc1 100644 index 1bf5a5e2ca59..f29f473ceca2 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc --- ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
@@ -84,6 +84,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin( @@ -84,6 +84,7 @@ DesktopWindowTreeHostWin::DesktopWindowTreeHostWin(
@ -160,7 +160,7 @@ index 2128b18525f1..66420b860fc1 100644
remove_standard_frame_ = params.remove_standard_frame; remove_standard_frame_ = params.remove_standard_frame;
has_non_client_view_ = Widget::RequiresNonClientView(params.type); has_non_client_view_ = Widget::RequiresNonClientView(params.type);
@@ -832,11 +837,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() { @@ -834,11 +839,15 @@ void DesktopWindowTreeHostWin::HandleFrameChanged() {
} }
void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) { void DesktopWindowTreeHostWin::HandleNativeFocus(HWND last_focused_window) {
@ -194,10 +194,10 @@ index db66147f0e9c..2b9bdfa2ec53 100644
// a reference. // a reference.
corewm::TooltipWin* tooltip_; corewm::TooltipWin* tooltip_;
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
index 88486500f8d8..b1743e330a3d 100644 index deaf9cbc13cc..57f8c4f44a29 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc
@@ -147,6 +147,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -143,6 +143,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
use_native_frame_(false), use_native_frame_(false),
should_maximize_after_map_(false), should_maximize_after_map_(false),
use_argb_visual_(false), use_argb_visual_(false),
@ -205,7 +205,7 @@ index 88486500f8d8..b1743e330a3d 100644
drag_drop_client_(NULL), drag_drop_client_(NULL),
native_widget_delegate_(native_widget_delegate), native_widget_delegate_(native_widget_delegate),
desktop_native_widget_aura_(desktop_native_widget_aura), desktop_native_widget_aura_(desktop_native_widget_aura),
@@ -160,6 +161,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11( @@ -156,6 +157,7 @@ DesktopWindowTreeHostX11::DesktopWindowTreeHostX11(
has_window_focus_(false), has_window_focus_(false),
has_pointer_focus_(false), has_pointer_focus_(false),
modal_dialog_counter_(0), modal_dialog_counter_(0),
@ -213,7 +213,7 @@ index 88486500f8d8..b1743e330a3d 100644
close_widget_factory_(this), close_widget_factory_(this),
weak_factory_(this) {} weak_factory_(this) {}
@@ -195,6 +197,8 @@ std::vector<aura::Window*> DesktopWindowTreeHostX11::GetAllOpenWindows() { @@ -191,6 +193,8 @@ std::vector<aura::Window*> DesktopWindowTreeHostX11::GetAllOpenWindows() {
} }
gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const { gfx::Rect DesktopWindowTreeHostX11::GetX11RootWindowBounds() const {
@ -222,7 +222,7 @@ index 88486500f8d8..b1743e330a3d 100644
return bounds_in_pixels_; return bounds_in_pixels_;
} }
@@ -506,7 +510,8 @@ void DesktopWindowTreeHostX11::CloseNow() { @@ -502,7 +506,8 @@ void DesktopWindowTreeHostX11::CloseNow() {
// Actually free our native resources. // Actually free our native resources.
if (ui::PlatformEventSource::GetInstance()) if (ui::PlatformEventSource::GetInstance())
ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this); ui::PlatformEventSource::GetInstance()->RemovePlatformEventDispatcher(this);
@ -232,7 +232,7 @@ index 88486500f8d8..b1743e330a3d 100644
xwindow_ = x11::None; xwindow_ = x11::None;
desktop_native_widget_aura_->OnHostClosed(); desktop_native_widget_aura_->OnHostClosed();
@@ -647,6 +652,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement( @@ -643,6 +648,8 @@ void DesktopWindowTreeHostX11::GetWindowPlacement(
} }
gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const { gfx::Rect DesktopWindowTreeHostX11::GetWindowBoundsInScreen() const {
@ -241,7 +241,7 @@ index 88486500f8d8..b1743e330a3d 100644
return ToDIPRect(bounds_in_pixels_); return ToDIPRect(bounds_in_pixels_);
} }
@@ -1243,6 +1250,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels( @@ -1250,6 +1257,8 @@ void DesktopWindowTreeHostX11::SetBoundsInPixels(
} }
gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const { gfx::Point DesktopWindowTreeHostX11::GetLocationOnScreenInPixels() const {
@ -250,7 +250,7 @@ index 88486500f8d8..b1743e330a3d 100644
return bounds_in_pixels_.origin(); return bounds_in_pixels_.origin();
} }
@@ -1335,7 +1344,6 @@ void DesktopWindowTreeHostX11::InitX11Window( @@ -1344,7 +1353,6 @@ void DesktopWindowTreeHostX11::InitX11Window(
::Atom window_type; ::Atom window_type;
switch (params.type) { switch (params.type) {
case Widget::InitParams::TYPE_MENU: case Widget::InitParams::TYPE_MENU:
@ -258,7 +258,7 @@ index 88486500f8d8..b1743e330a3d 100644
window_type = gfx::GetAtom("_NET_WM_WINDOW_TYPE_MENU"); window_type = gfx::GetAtom("_NET_WM_WINDOW_TYPE_MENU");
break; break;
case Widget::InitParams::TYPE_TOOLTIP: case Widget::InitParams::TYPE_TOOLTIP:
@@ -1391,9 +1399,15 @@ void DesktopWindowTreeHostX11::InitX11Window( @@ -1400,9 +1408,15 @@ void DesktopWindowTreeHostX11::InitX11Window(
attribute_mask |= CWBorderPixel; attribute_mask |= CWBorderPixel;
swa.border_pixel = 0; swa.border_pixel = 0;
@ -275,7 +275,7 @@ index 88486500f8d8..b1743e330a3d 100644
bounds_in_pixels_.y(), bounds_in_pixels_.width(), bounds_in_pixels_.y(), bounds_in_pixels_.width(),
bounds_in_pixels_.height(), bounds_in_pixels_.height(),
0, // border width 0, // border width
@@ -2010,6 +2024,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent( @@ -2006,6 +2020,10 @@ uint32_t DesktopWindowTreeHostX11::DispatchEvent(
} }
break; break;
} }
@ -287,10 +287,10 @@ index 88486500f8d8..b1743e330a3d 100644
case FocusOut: case FocusOut:
OnFocusEvent(xev->type == FocusIn, event->xfocus.mode, OnFocusEvent(xev->type == FocusIn, event->xfocus.mode,
diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h diff --git ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
index fcf87700458c..9aecc0e48939 100644 index 674951e1c90e..bc74be16e94d 100644
--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h --- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
+++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h +++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h
@@ -84,6 +84,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -85,6 +85,12 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Disables event listening to make |dialog| modal. // Disables event listening to make |dialog| modal.
std::unique_ptr<base::Closure> DisableEventListening(); std::unique_ptr<base::Closure> DisableEventListening();
@ -303,7 +303,7 @@ index fcf87700458c..9aecc0e48939 100644
protected: protected:
// Overridden from DesktopWindowTreeHost: // Overridden from DesktopWindowTreeHost:
void Init(aura::Window* content_window, void Init(aura::Window* content_window,
@@ -301,6 +307,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -303,6 +309,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// The bounds of |xwindow_|. // The bounds of |xwindow_|.
gfx::Rect bounds_in_pixels_; gfx::Rect bounds_in_pixels_;
@ -313,7 +313,7 @@ index fcf87700458c..9aecc0e48939 100644
// Whenever the bounds are set, we keep the previous set of bounds around so // Whenever the bounds are set, we keep the previous set of bounds around so
// we can have a better chance of getting the real // we can have a better chance of getting the real
// |restored_bounds_in_pixels_|. Window managers tend to send a Configure // |restored_bounds_in_pixels_|. Window managers tend to send a Configure
@@ -340,6 +349,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -342,6 +351,10 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
// Whether we used an ARGB visual for our window. // Whether we used an ARGB visual for our window.
bool use_argb_visual_; bool use_argb_visual_;
@ -324,7 +324,7 @@ index fcf87700458c..9aecc0e48939 100644
DesktopDragDropClientAuraX11* drag_drop_client_; DesktopDragDropClientAuraX11* drag_drop_client_;
std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_; std::unique_ptr<ui::EventHandler> x11_non_client_event_filter_;
@@ -427,6 +440,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11 @@ -429,6 +442,9 @@ class VIEWS_EXPORT DesktopWindowTreeHostX11
uint32_t modal_dialog_counter_; uint32_t modal_dialog_counter_;
@ -427,7 +427,7 @@ index 163e4b54b033..58f594db5019 100644
if (native_widget_delegate->IsDialogBox()) { if (native_widget_delegate->IsDialogBox()) {
*style |= DS_MODALFRAME; *style |= DS_MODALFRAME;
diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc diff --git ui/views/win/hwnd_message_handler.cc ui/views/win/hwnd_message_handler.cc
index 60c6c0e235ea..7a08a49320a2 100644 index 5906900d721c..9dd0514b8cec 100644
--- ui/views/win/hwnd_message_handler.cc --- ui/views/win/hwnd_message_handler.cc
+++ ui/views/win/hwnd_message_handler.cc +++ ui/views/win/hwnd_message_handler.cc
@@ -2665,8 +2665,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message, @@ -2665,8 +2665,12 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,

View File

@ -1,8 +1,8 @@
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
index c1ae2a911735..933fb8153ef1 100644 index 3484edd85788..42d731e0882e 100644
--- content/browser/web_contents/web_contents_impl.cc --- content/browser/web_contents/web_contents_impl.cc
+++ content/browser/web_contents/web_contents_impl.cc +++ content/browser/web_contents/web_contents_impl.cc
@@ -1783,21 +1783,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { @@ -1759,21 +1759,30 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
std::string unique_name; std::string unique_name;
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name); frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
@ -45,7 +45,7 @@ index c1ae2a911735..933fb8153ef1 100644
CHECK(render_view_host_delegate_view_); CHECK(render_view_host_delegate_view_);
CHECK(view_.get()); CHECK(view_.get());
@@ -2349,6 +2358,15 @@ void WebContentsImpl::CreateNewWindow( @@ -2325,6 +2334,15 @@ void WebContentsImpl::CreateNewWindow(
create_params.renderer_initiated_creation = create_params.renderer_initiated_creation =
main_frame_route_id != MSG_ROUTING_NONE; main_frame_route_id != MSG_ROUTING_NONE;
@ -61,7 +61,7 @@ index c1ae2a911735..933fb8153ef1 100644
WebContentsImpl* new_contents = nullptr; WebContentsImpl* new_contents = nullptr;
if (!is_guest) { if (!is_guest) {
create_params.context = view_->GetNativeView(); create_params.context = view_->GetNativeView();
@@ -2378,7 +2396,7 @@ void WebContentsImpl::CreateNewWindow( @@ -2354,7 +2372,7 @@ void WebContentsImpl::CreateNewWindow(
// TODO(brettw): It seems bogus that we have to call this function on the // TODO(brettw): It seems bogus that we have to call this function on the
// newly created object and give it one of its own member variables. // newly created object and give it one of its own member variables.
new_view->CreateViewForWidget( new_view->CreateViewForWidget(
@ -70,7 +70,7 @@ index c1ae2a911735..933fb8153ef1 100644
} }
// Save the created window associated with the route so we can show it // Save the created window associated with the route so we can show it
// later. // later.
@@ -5546,7 +5564,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() { @@ -5531,7 +5549,7 @@ InterstitialPageImpl* WebContentsImpl::GetInterstitialForRenderManager() {
void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager( void WebContentsImpl::CreateRenderWidgetHostViewForRenderManager(
RenderViewHost* render_view_host) { RenderViewHost* render_view_host) {
RenderWidgetHostViewBase* rwh_view = RenderWidgetHostViewBase* rwh_view =
@ -95,7 +95,7 @@ index 53d56abb35a3..d7b955f42ca5 100644
WebContents::CreateParams::CreateParams(const CreateParams& other) = default; WebContents::CreateParams::CreateParams(const CreateParams& other) = default;
diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h diff --git content/public/browser/web_contents.h content/public/browser/web_contents.h
index d6252667ed68..83265f9b6b41 100644 index 6e628faf106c..3855673d976b 100644
--- content/public/browser/web_contents.h --- content/public/browser/web_contents.h
+++ content/public/browser/web_contents.h +++ content/public/browser/web_contents.h
@@ -68,9 +68,11 @@ class BrowserPluginGuestDelegate; @@ -68,9 +68,11 @@ class BrowserPluginGuestDelegate;
@ -122,10 +122,10 @@ index d6252667ed68..83265f9b6b41 100644
// Creates a new WebContents. // Creates a new WebContents.
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
index 37db677b7438..4f4a8574e47d 100644 index 0ad2e1d835a2..5e3f49cda5fa 100644
--- content/public/browser/web_contents_delegate.h --- content/public/browser/web_contents_delegate.h
+++ content/public/browser/web_contents_delegate.h +++ content/public/browser/web_contents_delegate.h
@@ -43,11 +43,13 @@ namespace content { @@ -44,11 +44,13 @@ namespace content {
class ColorChooser; class ColorChooser;
class JavaScriptDialogManager; class JavaScriptDialogManager;
class RenderFrameHost; class RenderFrameHost;
@ -136,10 +136,10 @@ index 37db677b7438..4f4a8574e47d 100644
class WebContents; class WebContents;
class WebContentsImpl; class WebContentsImpl;
+class WebContentsView; +class WebContentsView;
struct ColorSuggestion;
struct ContextMenuParams; struct ContextMenuParams;
struct DropData; struct DropData;
@@ -308,6 +310,14 @@ class CONTENT_EXPORT WebContentsDelegate { struct FileChooserParams;
@@ -307,6 +309,14 @@ class CONTENT_EXPORT WebContentsDelegate {
const std::string& partition_id, const std::string& partition_id,
SessionStorageNamespace* session_storage_namespace); SessionStorageNamespace* session_storage_namespace);

View File

@ -1,11 +1,11 @@
diff --git third_party/WebKit/Source/core/dom/DOMImplementation.cpp third_party/WebKit/Source/core/dom/DOMImplementation.cpp diff --git third_party/WebKit/Source/core/dom/DOMImplementation.cpp third_party/WebKit/Source/core/dom/DOMImplementation.cpp
index 1d861b036458..3b20c991659b 100644 index 8088169f0434..47cf612db044 100644
--- third_party/WebKit/Source/core/dom/DOMImplementation.cpp --- third_party/WebKit/Source/core/dom/DOMImplementation.cpp
+++ third_party/WebKit/Source/core/dom/DOMImplementation.cpp +++ third_party/WebKit/Source/core/dom/DOMImplementation.cpp
@@ -242,10 +242,11 @@ Document* DOMImplementation::createDocument(const String& type, @@ -243,10 +243,11 @@ Document* DOMImplementation::createDocument(const String& type,
// For that reason, the origin must be retrieved directly from init.url().
if (init.GetFrame()->IsMainFrame()) { if (init.GetFrame()->IsMainFrame()) {
scoped_refptr<SecurityOrigin> origin = SecurityOrigin::Create(init.Url()); scoped_refptr<const SecurityOrigin> origin =
SecurityOrigin::Create(init.Url());
- plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.get()); - plugin_data = init.GetFrame()->GetPage()->GetPluginData(origin.get());
+ plugin_data = init.GetFrame()->GetPage()->GetPluginData(true, + plugin_data = init.GetFrame()->GetPage()->GetPluginData(true,
+ origin.get()); + origin.get());
@ -16,11 +16,31 @@ index 1d861b036458..3b20c991659b 100644
->Tree() ->Tree()
.Top() .Top()
.GetSecurityContext() .GetSecurityContext()
diff --git third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
index 0fa2449c7f1c..8adf2d575e66 100644
--- third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
+++ third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
@@ -329,6 +329,7 @@ WebDevToolsAgentImpl::Session::Session(
host_ptr_.Bind(std::move(host_ptr_info));
host_ptr_.set_connection_error_handler(WTF::Bind(
&WebDevToolsAgentImpl::Session::Detach, WrapWeakPersistent(this)));
+ Platform::Current()->DevToolsAgentAttached();
}
void WebDevToolsAgentImpl::Session::Trace(blink::Visitor* visitor) {
@@ -347,6 +348,7 @@ void WebDevToolsAgentImpl::Session::Detach() {
io_session_->DeleteSoon();
io_session_ = nullptr;
inspector_session_->Dispose();
+ Platform::Current()->DevToolsAgentDetached();
}
void WebDevToolsAgentImpl::Session::DispatchProtocolMessage(
diff --git third_party/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp diff --git third_party/WebKit/Source/core/frame/LocalFrame.cpp third_party/WebKit/Source/core/frame/LocalFrame.cpp
index 123258b23cb2..f00869df94e3 100644 index b76797e978da..a784ce63c21d 100644
--- third_party/WebKit/Source/core/frame/LocalFrame.cpp --- third_party/WebKit/Source/core/frame/LocalFrame.cpp
+++ third_party/WebKit/Source/core/frame/LocalFrame.cpp +++ third_party/WebKit/Source/core/frame/LocalFrame.cpp
@@ -1046,7 +1046,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() { @@ -1084,7 +1084,7 @@ FrameResourceCoordinator* LocalFrame::GetFrameResourceCoordinator() {
PluginData* LocalFrame::GetPluginData() const { PluginData* LocalFrame::GetPluginData() const {
if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin)) if (!Loader().AllowPlugins(kNotAboutToInstantiatePlugin))
return nullptr; return nullptr;
@ -30,28 +50,28 @@ index 123258b23cb2..f00869df94e3 100644
} }
diff --git third_party/WebKit/Source/core/page/Page.cpp third_party/WebKit/Source/core/page/Page.cpp diff --git third_party/WebKit/Source/core/page/Page.cpp third_party/WebKit/Source/core/page/Page.cpp
index c6071e8ba68e..4304cc95ba2e 100644 index b864a731dc65..7fc8a6c023f1 100644
--- third_party/WebKit/Source/core/page/Page.cpp --- third_party/WebKit/Source/core/page/Page.cpp
+++ third_party/WebKit/Source/core/page/Page.cpp +++ third_party/WebKit/Source/core/page/Page.cpp
@@ -129,7 +129,8 @@ Page::Page(PageClients& page_clients) @@ -148,7 +148,8 @@ Page::Page(PageClients& page_clients)
overscroll_controller_( overscroll_controller_(
OverscrollController::Create(GetVisualViewport(), GetChromeClient())), OverscrollController::Create(GetVisualViewport(), GetChromeClient())),
main_frame_(nullptr), main_frame_(nullptr),
- plugin_data_(nullptr), - plugin_data_(nullptr),
+ plugin_data_main_frame_(nullptr), + plugin_data_main_frame_(nullptr),
+ plugin_data_sub_frame_(nullptr), + plugin_data_sub_frame_(nullptr),
editor_client_(page_clients.editor_client),
use_counter_(page_clients.chrome_client && use_counter_(page_clients.chrome_client &&
page_clients.chrome_client->IsSVGImageChromeClient() page_clients.chrome_client->IsSVGImageChromeClient()
@@ -303,21 +304,38 @@ void Page::RefreshPlugins() { ? UseCounter::kSVGImageContext
@@ -319,21 +320,40 @@ void Page::RefreshPlugins() {
PluginData::RefreshBrowserSidePluginCache(); PluginData::RefreshBrowserSidePluginCache();
} }
-PluginData* Page::GetPluginData(SecurityOrigin* main_frame_origin) { -PluginData* Page::GetPluginData(const SecurityOrigin* main_frame_origin) {
- if (!plugin_data_) - if (!plugin_data_)
- plugin_data_ = PluginData::Create(); - plugin_data_ = PluginData::Create();
+PluginData* Page::GetPluginData(bool is_main_frame, +PluginData* Page::GetPluginData(bool is_main_frame,
+ SecurityOrigin* main_frame_origin) { + const SecurityOrigin* main_frame_origin) {
+ if (is_main_frame) { + if (is_main_frame) {
+ if (!plugin_data_main_frame_) + if (!plugin_data_main_frame_)
+ plugin_data_main_frame_ = PluginData::Create(); + plugin_data_main_frame_ = PluginData::Create();
@ -61,19 +81,21 @@ index c6071e8ba68e..4304cc95ba2e 100644
- plugin_data_->UpdatePluginList(main_frame_origin); - plugin_data_->UpdatePluginList(main_frame_origin);
+ if (!plugin_data_main_frame_->Origin() || + if (!plugin_data_main_frame_->Origin() ||
+ !main_frame_origin->IsSameSchemeHostPort( + !main_frame_origin->IsSameSchemeHostPort(
+ plugin_data_main_frame_->Origin())) + plugin_data_main_frame_->Origin())) {
+ plugin_data_main_frame_->UpdatePluginList(true, main_frame_origin); + plugin_data_main_frame_->UpdatePluginList(true, main_frame_origin);
+ }
- return plugin_data_.Get(); +
+ return plugin_data_main_frame_.Get(); + return plugin_data_main_frame_.Get();
+ } else { + } else {
+ if (!plugin_data_sub_frame_) + if (!plugin_data_sub_frame_)
+ plugin_data_sub_frame_ = PluginData::Create(); + plugin_data_sub_frame_ = PluginData::Create();
+
- return plugin_data_.Get();
+ if (!plugin_data_sub_frame_->Origin() || + if (!plugin_data_sub_frame_->Origin() ||
+ !main_frame_origin->IsSameSchemeHostPort( + !main_frame_origin->IsSameSchemeHostPort(
+ plugin_data_sub_frame_->Origin())) + plugin_data_sub_frame_->Origin())) {
+ plugin_data_sub_frame_->UpdatePluginList(false, main_frame_origin); + plugin_data_sub_frame_->UpdatePluginList(false, main_frame_origin);
+ }
+ +
+ return plugin_data_sub_frame_.Get(); + return plugin_data_sub_frame_.Get();
+ } + }
@ -91,7 +113,7 @@ index c6071e8ba68e..4304cc95ba2e 100644
page->NotifyPluginsChanged(); page->NotifyPluginsChanged();
} }
} }
@@ -675,7 +693,8 @@ void Page::Trace(blink::Visitor* visitor) { @@ -706,7 +726,8 @@ void Page::Trace(blink::Visitor* visitor) {
visitor->Trace(visual_viewport_); visitor->Trace(visual_viewport_);
visitor->Trace(overscroll_controller_); visitor->Trace(overscroll_controller_);
visitor->Trace(main_frame_); visitor->Trace(main_frame_);
@ -102,20 +124,20 @@ index c6071e8ba68e..4304cc95ba2e 100644
visitor->Trace(use_counter_); visitor->Trace(use_counter_);
visitor->Trace(plugins_changed_observers_); visitor->Trace(plugins_changed_observers_);
diff --git third_party/WebKit/Source/core/page/Page.h third_party/WebKit/Source/core/page/Page.h diff --git third_party/WebKit/Source/core/page/Page.h third_party/WebKit/Source/core/page/Page.h
index 1a02eb31d52a..d7d2c372f0c9 100644 index d32684c1a180..f3d034d358a7 100644
--- third_party/WebKit/Source/core/page/Page.h --- third_party/WebKit/Source/core/page/Page.h
+++ third_party/WebKit/Source/core/page/Page.h +++ third_party/WebKit/Source/core/page/Page.h
@@ -135,7 +135,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>, @@ -137,7 +137,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
ViewportDescription GetViewportDescription() const; ViewportDescription GetViewportDescription() const;
// Returns the plugin data associated with |main_frame_origin|. // Returns the plugin data associated with |main_frame_origin|.
- PluginData* GetPluginData(SecurityOrigin* main_frame_origin); - PluginData* GetPluginData(const SecurityOrigin* main_frame_origin);
+ PluginData* GetPluginData(bool is_main_frame, + PluginData* GetPluginData(bool is_main_frame,
+ SecurityOrigin* main_frame_origin); + const SecurityOrigin* main_frame_origin);
// Refreshes the browser-side plugin cache. // Refreshes the browser-side plugin cache.
static void RefreshPlugins(); static void RefreshPlugins();
@@ -361,7 +362,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>, @@ -353,7 +354,8 @@ class CORE_EXPORT Page final : public GarbageCollectedFinalized<Page>,
// longer needed. // longer needed.
Member<Frame> main_frame_; Member<Frame> main_frame_;
@ -123,10 +145,10 @@ index 1a02eb31d52a..d7d2c372f0c9 100644
+ Member<PluginData> plugin_data_main_frame_; + Member<PluginData> plugin_data_main_frame_;
+ Member<PluginData> plugin_data_sub_frame_; + Member<PluginData> plugin_data_sub_frame_;
EditorClient* const editor_client_; Member<ValidationMessageClient> validation_message_client_;
SpellCheckStatus spell_check_status_ = SpellCheckStatus::kAutomatic;
diff --git third_party/WebKit/Source/platform/plugins/PluginData.cpp third_party/WebKit/Source/platform/plugins/PluginData.cpp diff --git third_party/WebKit/Source/platform/plugins/PluginData.cpp third_party/WebKit/Source/platform/plugins/PluginData.cpp
index 385972d2e150..88a8e018b2e2 100644 index cef04c3b20c7..6ab47bb7872a 100644
--- third_party/WebKit/Source/platform/plugins/PluginData.cpp --- third_party/WebKit/Source/platform/plugins/PluginData.cpp
+++ third_party/WebKit/Source/platform/plugins/PluginData.cpp +++ third_party/WebKit/Source/platform/plugins/PluginData.cpp
@@ -79,16 +79,18 @@ void PluginData::Trace(blink::Visitor* visitor) { @@ -79,16 +79,18 @@ void PluginData::Trace(blink::Visitor* visitor) {
@ -139,9 +161,9 @@ index 385972d2e150..88a8e018b2e2 100644
&builder); &builder);
} }
-void PluginData::UpdatePluginList(SecurityOrigin* main_frame_origin) { -void PluginData::UpdatePluginList(const SecurityOrigin* main_frame_origin) {
+void PluginData::UpdatePluginList(bool is_main_frame, +void PluginData::UpdatePluginList(bool is_main_frame,
+ SecurityOrigin* main_frame_origin) { + const SecurityOrigin* main_frame_origin) {
ResetPluginData(); ResetPluginData();
main_frame_origin_ = main_frame_origin; main_frame_origin_ = main_frame_origin;
PluginListBuilder builder(&plugins_); PluginListBuilder builder(&plugins_);
@ -152,23 +174,24 @@ index 385972d2e150..88a8e018b2e2 100644
for (PluginInfo* plugin_info : plugins_) { for (PluginInfo* plugin_info : plugins_) {
for (MimeClassInfo* mime_class_info : plugin_info->mimes_) for (MimeClassInfo* mime_class_info : plugin_info->mimes_)
diff --git third_party/WebKit/Source/platform/plugins/PluginData.h third_party/WebKit/Source/platform/plugins/PluginData.h diff --git third_party/WebKit/Source/platform/plugins/PluginData.h third_party/WebKit/Source/platform/plugins/PluginData.h
index c2bdba557a6b..039446cef015 100644 index bdd586bd9621..13efebb33a49 100644
--- third_party/WebKit/Source/platform/plugins/PluginData.h --- third_party/WebKit/Source/platform/plugins/PluginData.h
+++ third_party/WebKit/Source/platform/plugins/PluginData.h +++ third_party/WebKit/Source/platform/plugins/PluginData.h
@@ -95,7 +95,7 @@ class PLATFORM_EXPORT PluginData final @@ -95,7 +95,8 @@ class PLATFORM_EXPORT PluginData final
const HeapVector<Member<PluginInfo>>& Plugins() const { return plugins_; } const HeapVector<Member<PluginInfo>>& Plugins() const { return plugins_; }
const HeapVector<Member<MimeClassInfo>>& Mimes() const { return mimes_; } const HeapVector<Member<MimeClassInfo>>& Mimes() const { return mimes_; }
const SecurityOrigin* Origin() const { return main_frame_origin_.get(); } const SecurityOrigin* Origin() const { return main_frame_origin_.get(); }
- void UpdatePluginList(SecurityOrigin* main_frame_origin); - void UpdatePluginList(const SecurityOrigin* main_frame_origin);
+ void UpdatePluginList(bool is_main_frame, SecurityOrigin* main_frame_origin); + void UpdatePluginList(bool is_main_frame,
+ const SecurityOrigin* main_frame_origin);
void ResetPluginData(); void ResetPluginData();
bool SupportsMimeType(const String& mime_type) const; bool SupportsMimeType(const String& mime_type) const;
diff --git third_party/WebKit/public/platform/Platform.h third_party/WebKit/public/platform/Platform.h diff --git third_party/WebKit/public/platform/Platform.h third_party/WebKit/public/platform/Platform.h
index 09c2e1516512..00f634a16dc5 100644 index cc2a721a6ea3..2a843527f9d7 100644
--- third_party/WebKit/public/platform/Platform.h --- third_party/WebKit/public/platform/Platform.h
+++ third_party/WebKit/public/platform/Platform.h +++ third_party/WebKit/public/platform/Platform.h
@@ -377,6 +377,7 @@ class BLINK_PLATFORM_EXPORT Platform { @@ -376,6 +376,7 @@ class BLINK_PLATFORM_EXPORT Platform {
// satisfy this call. mainFrameOrigin is used by the browser process to // satisfy this call. mainFrameOrigin is used by the browser process to
// filter plugins from the plugin list based on content settings. // filter plugins from the plugin list based on content settings.
virtual void GetPluginList(bool refresh, virtual void GetPluginList(bool refresh,
@ -176,3 +199,15 @@ index 09c2e1516512..00f634a16dc5 100644
const WebSecurityOrigin& main_frame_origin, const WebSecurityOrigin& main_frame_origin,
WebPluginListBuilder*) {} WebPluginListBuilder*) {}
@@ -748,6 +749,11 @@ class BLINK_PLATFORM_EXPORT Platform {
// runs during Chromium's build step).
virtual bool IsTakingV8ContextSnapshot() { return false; }
+ // DevTools ------------------------------------------------------------
+
+ virtual void DevToolsAgentAttached() {}
+ virtual void DevToolsAgentDetached() {}
+
protected:
Platform();
virtual ~Platform();

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