Update to Chromium revision 66afc5e5 (#540276)

This commit is contained in:
Marshall Greenblatt
2018-03-20 16:15:08 -04:00
parent 4fb6e1ba29
commit 7a59914f97
128 changed files with 1921 additions and 1477 deletions

View File

@ -123,7 +123,7 @@ if (is_mac) {
import("//build/config/mac/rules.gni")
import("//build/mac/tweak_info_plist.gni")
import("//build/util/version.gni")
import("//media/cdm/ppapi/cdm_paths.gni")
import("//media/cdm/library_cdm/cdm_paths.gni")
}
if (is_win) {
import("//build/config/win/console_app.gni")
@ -266,7 +266,7 @@ if (is_win) {
"//components/crash/core/common", # crash_keys
# Required by chrome_switches.cc
"//chrome/common:features",
"//chrome/common:buildflags",
"//ppapi/features:features",
"//printing/features:features",
"//ui/base:ui_features",
@ -709,7 +709,7 @@ static_library("libcef_static") {
"//services/network:network_service",
"//services/network/public/cpp",
"//services/service_manager/embedder",
"//services/service_manager/public/interfaces",
"//services/service_manager/public/cpp",
"//services/service_manager/runner/common",
"//skia",
"//storage/browser",
@ -1023,6 +1023,7 @@ if (is_win) {
cef_packaged_services = [
"//chrome/app:chrome_manifest", # For spell checking.
"//chrome/app:chrome_renderer_manifest", # For spell checking.
"//chrome/services/printing:manifest",
"//services/metrics:manifest",
"//services/proxy_resolver:proxy_resolver_manifest",

View File

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

View File

@ -1379,38 +1379,49 @@ typedef enum {
///
// The main thread in the browser. This will be the same as the main
// application thread if CefInitialize() is called with a
// CefSettings.multi_threaded_message_loop value of false.
// CefSettings.multi_threaded_message_loop value of false. Do not perform
// blocking tasks on this thread. All tasks posted after
// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
// are guaranteed to run. This thread will outlive all other CEF threads.
///
TID_UI,
///
// Used to interact with the database.
// Used for blocking tasks (e.g. file system access) where the user won't
// notice if the task takes an arbitrarily long time to complete. All tasks
// posted after CefBrowserProcessHandler::OnContextInitialized() and before
// CefShutdown() are guaranteed to run.
///
TID_DB,
TID_FILE_BACKGROUND,
TID_FILE = TID_FILE_BACKGROUND,
///
// Used to interact with the file system.
// Used for blocking tasks (e.g. file system access) that affect UI or
// responsiveness of future user interactions. Do not use if an immediate
// response to a user interaction is expected. All tasks posted after
// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
// are guaranteed to run.
// Examples:
// - Updating the UI to reflect progress on a long task.
// - Loading data that might be shown in the UI after a future user
// interaction.
///
TID_FILE,
TID_FILE_USER_VISIBLE,
///
// Used for file system operations that block user interactions.
// Responsiveness of this thread affects users.
// Used for blocking tasks (e.g. file system access) that affect UI
// immediately after a user interaction. All tasks posted after
// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
// are guaranteed to run.
// Example: Generating data shown in the UI immediately after a click.
///
TID_FILE_USER_BLOCKING,
///
// Used to launch and terminate browser processes.
///
TID_PROCESS_LAUNCHER,
///
// Used to handle slow HTTP cache operations.
///
TID_CACHE,
///
// Used to process IPC and network messages.
// Used to process IPC and network messages. Do not perform blocking tasks on
// this thread. All tasks posted after
// CefBrowserProcessHandler::OnContextInitialized() and before CefShutdown()
// are guaranteed to run.
///
TID_IO,
@ -1418,6 +1429,10 @@ typedef enum {
///
// The main thread in the renderer. Used for all WebKit and V8 interaction.
// Tasks may be posted to this thread after
// CefRenderProcessHandler::OnRenderThreadCreated but are not guaranteed to
// run before sub-process termination (sub-processes may be killed at any time
// without warning).
///
TID_RENDERER,
} cef_thread_id_t;

View File

@ -39,8 +39,8 @@
#include "content/public/browser/storage_partition.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/common/constants.h"
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_service.h"
#include "net/proxy_resolution/proxy_config_service.h"
#include "net/proxy_resolution/proxy_service.h"
using content::BrowserThread;
@ -162,7 +162,7 @@ class CefVisitedLinkListener : public visitedlink::VisitedLinkMaster::Listener {
void CreateListenerForContext(const CefBrowserContext* context) {
CEF_REQUIRE_UIT();
auto listener = base::MakeUnique<visitedlink::VisitedLinkEventListener>(
auto listener = std::make_unique<visitedlink::VisitedLinkEventListener>(
const_cast<CefBrowserContext*>(context));
listener_map_.insert(std::make_pair(context, std::move(listener)));
}
@ -450,7 +450,8 @@ net::URLRequestContextGetter* CefBrowserContextImpl::CreateRequestContext(
// 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));
net::ProxyResolutionService::CreateSystemProxyConfigService(
io_thread_runner));
std::unique_ptr<net::ProxyConfigService> proxy_config_service(
pref_proxy_config_tracker_->CreateTrackingProxyConfigService(
std::move(base_service)));

View File

@ -53,7 +53,7 @@
#include "content/common/view_messages.h"
#include "content/public/browser/desktop_media_id.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_url_parameters.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/native_web_keyboard_event.h"
@ -745,8 +745,8 @@ void CefBrowserHostImpl::StartDownload(const CefString& url) {
if (!manager)
return;
std::unique_ptr<content::DownloadUrlParameters> params(
content::DownloadUrlParameters::CreateForWebContentsMainFrame(
std::unique_ptr<download::DownloadUrlParameters> params(
content::DownloadRequestUtils::CreateDownloadForWebContentsMainFrame(
web_contents(), gurl, NO_TRAFFIC_ANNOTATION_YET));
manager->DownloadUrl(std::move(params));
}

View File

@ -478,7 +478,6 @@ class CefBrowserHostImpl : public CefBrowserHost,
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;
using content::WebContentsObserver::WasHidden;
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
void RenderFrameHostChanged(content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) override;

View File

@ -154,7 +154,7 @@ bool CefBrowserInfoManager::CanCreateWindow(
window_info->SetAsPopup(NULL, CefString());
#endif
auto pending_popup = base::MakeUnique<CefBrowserInfoManager::PendingPopup>();
auto pending_popup = std::make_unique<CefBrowserInfoManager::PendingPopup>();
pending_popup->step = CefBrowserInfoManager::PendingPopup::CAN_CREATE_WINDOW;
pending_popup->opener_process_id = opener->GetProcess()->GetID();
pending_popup->opener_frame_id = opener->GetRoutingID();

View File

@ -26,6 +26,8 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task_scheduler/post_task.h"
#include "chrome/browser/chrome_browser_main_extra_parts.h"
#include "chrome/browser/plugins/plugin_finder.h"
#include "content/public/browser/gpu_data_manager.h"
#include "content/public/common/result_codes.h"
@ -58,13 +60,14 @@ CefBrowserMainParts::CefBrowserMainParts(
const content::MainFunctionParams& parameters)
: BrowserMainParts(), devtools_delegate_(NULL) {}
CefBrowserMainParts::~CefBrowserMainParts() {}
CefBrowserMainParts::~CefBrowserMainParts() {
for (int i = static_cast<int>(chrome_extra_parts_.size()) - 1; i >= 0; --i)
delete chrome_extra_parts_[i];
chrome_extra_parts_.clear();
}
void CefBrowserMainParts::PreMainMessageLoopStart() {
if (!base::MessageLoop::current()) {
// Create the browser message loop.
message_loop_.reset(new CefBrowserMessageLoop());
}
void CefBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
chrome_extra_parts_.push_back(parts);
}
int CefBrowserMainParts::PreEarlyInitialization() {
@ -73,9 +76,18 @@ int CefBrowserMainParts::PreEarlyInitialization() {
// views::LinuxUI::SetInstance.
ui::InitializeInputMethodForTesting();
#endif
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreEarlyInitialization();
return content::RESULT_CODE_NORMAL_EXIT;
}
void CefBrowserMainParts::PostEarlyInitialization() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostEarlyInitialization();
}
void CefBrowserMainParts::ToolkitInitialized() {
#if defined(USE_AURA)
CHECK(aura::Env::GetInstance());
@ -89,6 +101,19 @@ void CefBrowserMainParts::ToolkitInitialized() {
CefContentBrowserClient::Get()->GetResourceDllName());
#endif
#endif // defined(USE_AURA)
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->ToolkitInitialized();
}
void CefBrowserMainParts::PreMainMessageLoopStart() {
if (!base::MessageLoop::current()) {
// Create the browser message loop.
message_loop_.reset(new CefBrowserMessageLoop());
}
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreMainMessageLoopStart();
}
void CefBrowserMainParts::PostMainMessageLoopStart() {
@ -98,6 +123,9 @@ void CefBrowserMainParts::PostMainMessageLoopStart() {
printing::PrintingContextLinux::SetPdfPaperSizeFunction(
&CefPrintDialogLinux::GetPdfPaperSize);
#endif
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostMainMessageLoopStart();
}
int CefBrowserMainParts::PreCreateThreads() {
@ -111,14 +139,26 @@ int CefBrowserMainParts::PreCreateThreads() {
// before the IO thread is started.
content::GpuDataManager::GetInstance();
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreCreateThreads();
return 0;
}
void CefBrowserMainParts::ServiceManagerConnectionStarted(
content::ServiceManagerConnection* connection) {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->ServiceManagerConnectionStarted(connection);
}
void CefBrowserMainParts::PreMainMessageLoopRun() {
#if defined(USE_AURA)
display::Screen::SetScreenInstance(views::CreateDesktopScreen());
#endif
// CEF's profile is a BrowserContext.
PreProfileInit();
if (extensions::ExtensionsEnabled()) {
// Initialize extension global objects before creating the global
// BrowserContext.
@ -137,6 +177,16 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
printing::CefPrintingMessageFilter::EnsureShutdownNotifierFactoryBuilt();
background_task_runner_ = base::CreateSingleThreadTaskRunnerWithTraits(
{base::TaskPriority::BACKGROUND,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
user_visible_task_runner_ = base::CreateSingleThreadTaskRunnerWithTraits(
{base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
user_blocking_task_runner_ = base::CreateSingleThreadTaskRunnerWithTraits(
{base::TaskPriority::USER_BLOCKING,
base::TaskShutdownBehavior::BLOCK_SHUTDOWN, base::MayBlock()});
CefRequestContextSettings settings;
CefContext::Get()->PopulateRequestContextSettings(&settings);
@ -146,12 +196,21 @@ void CefBrowserMainParts::PreMainMessageLoopRun() {
CefBrowserContextImpl* browser_context = static_cast<CefBrowserContextImpl*>(
global_request_context_->GetBrowserContext());
PostProfileInit();
CefDevToolsManagerDelegate::StartHttpHandler(browser_context);
// Triggers initialization of the singleton instance on UI thread.
PluginFinder::GetInstance()->Init();
scheme::RegisterWebUIControllerFactory();
// These have no equivalent in CEF.
PreBrowserStart();
PostBrowserStart();
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreMainMessageLoopRun();
}
void CefBrowserMainParts::PostMainMessageLoopRun() {
@ -167,6 +226,9 @@ void CefBrowserMainParts::PostMainMessageLoopRun() {
extensions::ExtensionsBrowserClient::Set(NULL);
extensions_browser_client_.reset();
}
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostMainMessageLoopRun();
}
void CefBrowserMainParts::PostDestroyThreads() {
@ -175,3 +237,23 @@ void CefBrowserMainParts::PostDestroyThreads() {
delete views::ViewsDelegate::GetInstance();
#endif
}
void CefBrowserMainParts::PreProfileInit() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreProfileInit();
}
void CefBrowserMainParts::PostProfileInit() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostProfileInit();
}
void CefBrowserMainParts::PreBrowserStart() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreBrowserStart();
}
void CefBrowserMainParts::PostBrowserStart() {
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PostBrowserStart();
}

View File

@ -37,26 +37,51 @@ class WMState;
#endif
class CefDevToolsDelegate;
class ChromeBrowserMainExtraParts;
class CefBrowserMainParts : public content::BrowserMainParts {
public:
explicit CefBrowserMainParts(const content::MainFunctionParams& parameters);
~CefBrowserMainParts() override;
// Add additional ChromeBrowserMainExtraParts.
void AddParts(ChromeBrowserMainExtraParts* parts);
int PreEarlyInitialization() override;
void PostEarlyInitialization() override;
void ToolkitInitialized() override;
void PreMainMessageLoopStart() override;
void PostMainMessageLoopStart() override;
int PreEarlyInitialization() override;
void ToolkitInitialized() override;
int PreCreateThreads() override;
void ServiceManagerConnectionStarted(
content::ServiceManagerConnection* connection);
void PreMainMessageLoopRun() override;
void PostMainMessageLoopRun() override;
void PostDestroyThreads() override;
// Additional stages for ChromeBrowserMainExtraParts. These stages are called
// in order from PreMainMessageLoopRun(). See implementation for details.
void PreProfileInit();
void PostProfileInit();
void PreBrowserStart();
void PostBrowserStart();
CefRefPtr<CefRequestContextImpl> request_context() const {
return global_request_context_;
}
CefDevToolsDelegate* devtools_delegate() const { return devtools_delegate_; }
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner() const {
return background_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner() const {
return user_visible_task_runner_;
}
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner()
const {
return user_blocking_task_runner_;
}
private:
#if defined(OS_WIN)
void PlatformInitialize();
@ -70,10 +95,22 @@ class CefBrowserMainParts : public content::BrowserMainParts {
std::unique_ptr<extensions::ExtensionsBrowserClient>
extensions_browser_client_;
// Blocking task runners exposed via CefTaskRunner. For consistency with
// previous named thread behavior always execute all pending tasks before
// shutdown (e.g. to make sure critical data is saved to disk).
// |background_task_runner_| is also passed to SQLitePersistentCookieStore.
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner_;
#if defined(USE_AURA)
std::unique_ptr<wm::WMState> wm_state_;
#endif
// Vector of additional ChromeBrowserMainExtraParts.
// Parts are deleted in the inverse order they are added.
std::vector<ChromeBrowserMainExtraParts*> chrome_extra_parts_;
DISALLOW_COPY_AND_ASSIGN(CefBrowserMainParts);
};

View File

@ -36,13 +36,13 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
const CefWindowInfo& window_info,
SkColor background_color) {
#if defined(OS_WIN)
return base::MakeUnique<CefBrowserPlatformDelegateNativeWin>(
return std::make_unique<CefBrowserPlatformDelegateNativeWin>(
window_info, background_color);
#elif defined(OS_MACOSX)
return base::MakeUnique<CefBrowserPlatformDelegateNativeMac>(
return std::make_unique<CefBrowserPlatformDelegateNativeMac>(
window_info, background_color);
#elif defined(OS_LINUX)
return base::MakeUnique<CefBrowserPlatformDelegateNativeLinux>(
return std::make_unique<CefBrowserPlatformDelegateNativeLinux>(
window_info, background_color);
#endif
}
@ -50,13 +50,13 @@ std::unique_ptr<CefBrowserPlatformDelegateNative> CreateNativeDelegate(
std::unique_ptr<CefBrowserPlatformDelegateOsr> CreateOSRDelegate(
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate) {
#if defined(OS_WIN)
return base::MakeUnique<CefBrowserPlatformDelegateOsrWin>(
return std::make_unique<CefBrowserPlatformDelegateOsrWin>(
std::move(native_delegate));
#elif defined(OS_MACOSX)
return base::MakeUnique<CefBrowserPlatformDelegateOsrMac>(
return std::make_unique<CefBrowserPlatformDelegateOsrMac>(
std::move(native_delegate));
#elif defined(OS_LINUX)
return base::MakeUnique<CefBrowserPlatformDelegateOsrLinux>(
return std::make_unique<CefBrowserPlatformDelegateOsrLinux>(
std::move(native_delegate));
#endif
}
@ -85,7 +85,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
// Creating a background extension host without a window.
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(CefWindowInfo(), background_color);
return base::MakeUnique<CefBrowserPlatformDelegateBackground>(
return std::make_unique<CefBrowserPlatformDelegateBackground>(
std::move(native_delegate));
}
#if defined(USE_AURA)
@ -93,7 +93,7 @@ std::unique_ptr<CefBrowserPlatformDelegate> CefBrowserPlatformDelegate::Create(
// CefWindowInfo is not used in this case.
std::unique_ptr<CefBrowserPlatformDelegateNative> native_delegate =
CreateNativeDelegate(CefWindowInfo(), background_color);
return base::MakeUnique<CefBrowserPlatformDelegateViews>(
return std::make_unique<CefBrowserPlatformDelegateViews>(
std::move(native_delegate),
static_cast<CefBrowserViewImpl*>(create_params.browser_view.get()));
}

View File

@ -15,7 +15,7 @@
#include "chrome/browser/printing/print_job_manager.h"
#include "components/net_log/chrome_net_log.h"
#include "content/public/common/content_switches.h"
#include "ui/message_center/message_center.h"
#include "services/network/public/cpp/network_switches.h"
ChromeBrowserProcessStub::ChromeBrowserProcessStub()
: initialized_(false),
@ -165,11 +165,6 @@ ChromeBrowserProcessStub::notification_platform_bridge() {
return NULL;
}
message_center::MessageCenter* ChromeBrowserProcessStub::message_center() {
NOTREACHED();
return NULL;
}
policy::ChromeBrowserPolicyConnector*
ChromeBrowserProcessStub::browser_policy_connector() {
NOTREACHED();
@ -191,9 +186,7 @@ GpuModeManager* ChromeBrowserProcessStub::gpu_mode_manager() {
return NULL;
}
void ChromeBrowserProcessStub::CreateDevToolsHttpProtocolHandler(
const std::string& ip,
uint16_t port) {
void ChromeBrowserProcessStub::CreateDevToolsProtocolHandler() {
NOTREACHED();
}
@ -296,10 +289,10 @@ net_log::ChromeNetLog* ChromeBrowserProcessStub::net_log() {
if (!net_log_) {
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
net_log_ = base::MakeUnique<net_log::ChromeNetLog>();
if (command_line.HasSwitch(switches::kLogNetLog)) {
net_log_ = std::make_unique<net_log::ChromeNetLog>();
if (command_line.HasSwitch(network::switches::kLogNetLog)) {
net_log_->StartWritingToFile(
command_line.GetSwitchValuePath(switches::kLogNetLog),
command_line.GetSwitchValuePath(network::switches::kLogNetLog),
GetNetCaptureModeFromCommandLine(command_line),
command_line.GetCommandLineString(), std::string());
}

View File

@ -59,13 +59,11 @@ class ChromeBrowserProcessStub : public BrowserProcess,
extensions::EventRouterForwarder* extension_event_router_forwarder() override;
NotificationUIManager* notification_ui_manager() override;
NotificationPlatformBridge* notification_platform_bridge() override;
message_center::MessageCenter* message_center() override;
policy::ChromeBrowserPolicyConnector* browser_policy_connector() override;
policy::PolicyService* policy_service() override;
IconManager* icon_manager() override;
GpuModeManager* gpu_mode_manager() override;
void CreateDevToolsHttpProtocolHandler(const std::string& ip,
uint16_t port) override;
void CreateDevToolsProtocolHandler() override;
void CreateDevToolsAutoOpener() override;
bool IsShuttingDown() override;
printing::PrintJobManager* print_job_manager() override;

View File

@ -49,7 +49,7 @@
#include "chrome/common/constants.mojom.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "chrome/services/printing/public/interfaces/constants.mojom.h"
#include "chrome/services/printing/public/mojom/constants.mojom.h"
#include "components/navigation_interception/intercept_navigation_throttle.h"
#include "components/navigation_interception/navigation_params.h"
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
@ -84,7 +84,7 @@
#include "extensions/common/switches.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "ppapi/host/ppapi_host.h"
#include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h"
#include "services/service_manager/public/mojom/connector.mojom.h"
#include "storage/browser/quota/quota_settings.h"
#include "third_party/WebKit/public/web/WebWindowFeatures.h"
#include "ui/base/l10n/l10n_util.h"
@ -96,10 +96,6 @@
#include "libcef/common/widevine_loader.h"
#endif
#if defined(OS_MACOSX)
#include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
#include "base/debug/leak_annotations.h"
#include "chrome/common/chrome_paths.h"
@ -450,6 +446,8 @@ CefContentBrowserClient::~CefContentBrowserClient() {}
// static
CefContentBrowserClient* CefContentBrowserClient::Get() {
if (!CefContentClient::Get())
return nullptr;
return static_cast<CefContentBrowserClient*>(
CefContentClient::Get()->browser());
}
@ -457,25 +455,20 @@ CefContentBrowserClient* CefContentBrowserClient::Get() {
content::BrowserMainParts* CefContentBrowserClient::CreateBrowserMainParts(
const content::MainFunctionParams& parameters) {
browser_main_parts_ = new CefBrowserMainParts(parameters);
browser_main_parts_->AddParts(
ChromeService::GetInstance()->CreateExtraParts());
return browser_main_parts_;
}
void CefContentBrowserClient::RenderProcessWillLaunch(
content::RenderProcessHost* host) {
content::RenderProcessHost* host,
service_manager::mojom::ServiceRequest* service_request) {
const int id = host->GetID();
Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext());
host->AddFilter(new CefBrowserMessageFilter(id));
host->AddFilter(new printing::CefPrintingMessageFilter(id, profile));
#if defined(OS_MACOSX)
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
host->AddFilter(new SpellCheckMessageFilterPlatform(id));
}
#endif
if (extensions::ExtensionsEnabled()) {
host->AddFilter(new extensions::ExtensionMessageFilter(id, profile));
host->AddFilter(
@ -492,6 +485,16 @@ void CefContentBrowserClient::RenderProcessWillLaunch(
host->Send(
new CefProcessMsg_SetIsIncognitoProcess(profile->IsOffTheRecord()));
service_manager::mojom::ServicePtr service;
*service_request = mojo::MakeRequest(&service);
service_manager::mojom::PIDReceiverPtr pid_receiver;
service_manager::Identity renderer_identity = host->GetChildIdentity();
ChromeService::GetInstance()->connector()->StartService(
service_manager::Identity(chrome::mojom::kRendererServiceName,
renderer_identity.user_id(),
renderer_identity.instance()),
std::move(service), mojo::MakeRequest(&pid_receiver));
}
bool CefContentBrowserClient::ShouldUseProcessPerSite(
@ -594,7 +597,7 @@ void CefContentBrowserClient::RegisterInProcessServices(
{
// For spell checking.
service_manager::EmbeddedServiceInfo info;
info.factory = base::Bind(&ChromeService::Create);
info.factory = ChromeService::GetInstance()->CreateChromeServiceFactory();
services->insert(std::make_pair(chrome::mojom::kServiceName, info));
}
}
@ -633,6 +636,8 @@ std::vector<content::ContentBrowserClient::ServiceManifestInfo>
CefContentBrowserClient::GetExtraServiceManifests() {
return std::vector<ServiceManifestInfo>({
{printing::mojom::kServiceName, IDR_PDF_COMPOSITOR_MANIFEST},
{chrome::mojom::kRendererServiceName,
IDR_CHROME_RENDERER_SERVICE_MANIFEST},
});
}
@ -958,7 +963,7 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
}
std::unique_ptr<content::NavigationThrottle> throttle =
base::MakeUnique<navigation_interception::InterceptNavigationThrottle>(
std::make_unique<navigation_interception::InterceptNavigationThrottle>(
navigation_handle, base::Bind(&NavigationOnUIThread, is_main_frame,
frame_id, parent_frame_id));
throttles.push_back(std::move(throttle));
@ -1010,6 +1015,15 @@ void CefContentBrowserClient::ExposeInterfacesToRenderer(
base::MakeRefCounted<PluginInfoHostImpl>(host->GetID(), profile)));
}
std::unique_ptr<net::ClientCertStore>
CefContentBrowserClient::CreateClientCertStore(
content::ResourceContext* resource_context) {
if (!resource_context)
return nullptr;
return static_cast<CefResourceContext*>(resource_context)
->CreateClientCertStore();
}
void CefContentBrowserClient::RegisterCustomScheme(const std::string& scheme) {
// Register as a Web-safe scheme so that requests for the scheme from a
// render process will be allowed in resource_dispatcher_host_impl.cc
@ -1029,6 +1043,21 @@ CefDevToolsDelegate* CefContentBrowserClient::devtools_delegate() const {
return browser_main_parts_->devtools_delegate();
}
scoped_refptr<base::SingleThreadTaskRunner>
CefContentBrowserClient::background_task_runner() const {
return browser_main_parts_->background_task_runner();
}
scoped_refptr<base::SingleThreadTaskRunner>
CefContentBrowserClient::user_visible_task_runner() const {
return browser_main_parts_->user_visible_task_runner();
}
scoped_refptr<base::SingleThreadTaskRunner>
CefContentBrowserClient::user_blocking_task_runner() const {
return browser_main_parts_->user_blocking_task_runner();
}
const extensions::Extension* CefContentBrowserClient::GetExtension(
content::SiteInstance* site_instance) {
extensions::ExtensionRegistry* registry =

View File

@ -43,7 +43,9 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
// ContentBrowserClient implementation.
content::BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) override;
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
void RenderProcessWillLaunch(
content::RenderProcessHost* host,
service_manager::mojom::ServiceRequest* service_request) override;
bool ShouldUseProcessPerSite(content::BrowserContext* browser_context,
const GURL& effective_url) override;
bool IsHandledURL(const GURL& url) override;
@ -122,12 +124,19 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
blink::AssociatedInterfaceRegistry* associated_registry,
content::RenderProcessHost* render_process_host) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
content::ResourceContext* resource_context) override;
// Perform browser process registration for the custom scheme.
void RegisterCustomScheme(const std::string& scheme);
CefRefPtr<CefRequestContextImpl> request_context() const;
CefDevToolsDelegate* devtools_delegate() const;
scoped_refptr<base::SingleThreadTaskRunner> background_task_runner() const;
scoped_refptr<base::SingleThreadTaskRunner> user_visible_task_runner() const;
scoped_refptr<base::SingleThreadTaskRunner> user_blocking_task_runner() const;
private:
// Returns the extension or app associated with |site_instance| or NULL.
const extensions::Extension* GetExtension(

View File

@ -303,7 +303,10 @@ bool CefCookieManagerImpl::SetStoragePath(
const base::FilePath& cookie_path = new_path.AppendASCII("Cookies");
persistent_store = new net::SQLitePersistentCookieStore(
cookie_path, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
BrowserThread::GetTaskRunnerForThread(BrowserThread::DB),
// Intentionally using the background task runner exposed by CEF to
// facilitate unit test expectations. This task runner MUST be
// configured with BLOCK_SHUTDOWN.
CefContentBrowserClient::Get()->background_task_runner(),
persist_session_cookies, NULL);
} else {
NOTREACHED() << "The cookie storage directory could not be created";

View File

@ -163,7 +163,7 @@ void CefDevToolsFrontend::InspectElementAt(int x, int y) {
if (inspect_element_at_.x != x || inspect_element_at_.y != y)
inspect_element_at_.Set(x, y);
if (agent_host_)
agent_host_->InspectElement(this, x, y);
agent_host_->InspectElement(inspected_contents_->GetFocusedFrame(), x, y);
}
void CefDevToolsFrontend::Close() {
@ -226,8 +226,8 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
agent_host_ = agent_host;
agent_host_->AttachClient(this);
if (!inspect_element_at_.IsEmpty()) {
agent_host_->InspectElement(this, inspect_element_at_.x,
inspect_element_at_.y);
agent_host_->InspectElement(inspected_contents_->GetFocusedFrame(),
inspect_element_at_.x, inspect_element_at_.y);
}
}
}
@ -392,7 +392,7 @@ void CefDevToolsFrontend::OnURLFetchComplete(const net::URLFetcher* source) {
DCHECK(it != pending_requests_.end());
base::DictionaryValue response;
auto headers = base::MakeUnique<base::DictionaryValue>();
auto headers = std::make_unique<base::DictionaryValue>();
net::HttpResponseHeaders* rh = source->GetResponseHeaders();
response.SetInteger("statusCode", rh ? rh->response_code() : 200);

View File

@ -105,8 +105,7 @@ void CefDevToolsManagerDelegate::StartHttpHandler(
if (!socket_factory)
return;
content::DevToolsAgentHost::StartRemoteDebuggingServer(
std::move(socket_factory), std::string(), browser_context->GetPath(),
base::FilePath());
std::move(socket_factory), browser_context->GetPath(), base::FilePath());
const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess();
@ -138,7 +137,6 @@ std::string CefDevToolsManagerDelegate::GetDiscoveryPageHTML() {
.as_string();
}
std::string CefDevToolsManagerDelegate::GetFrontendResource(
const std::string& path) {
return content::DevToolsFrontendHost::GetFrontendResource(path).as_string();
bool CefDevToolsManagerDelegate::HasBundledFrontendResources() {
return true;
}

View File

@ -25,7 +25,7 @@ class CefDevToolsManagerDelegate : public content::DevToolsManagerDelegate {
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
const GURL& url) override;
std::string GetDiscoveryPageHTML() override;
std::string GetFrontendResource(const std::string& path) override;
bool HasBundledFrontendResources() override;
private:
DISALLOW_COPY_AND_ASSIGN(CefDevToolsManagerDelegate);

View File

@ -6,11 +6,11 @@
#include "libcef/common/time_util.h"
#include "content/public/browser/download_item.h"
#include "components/download/public/common/download_item.h"
#include "url/gurl.h"
CefDownloadItemImpl::CefDownloadItemImpl(content::DownloadItem* value)
: CefValueBase<CefDownloadItem, content::DownloadItem>(
CefDownloadItemImpl::CefDownloadItemImpl(download::DownloadItem* value)
: CefValueBase<CefDownloadItem, download::DownloadItem>(
value,
NULL,
kOwnerNoDelete,
@ -26,17 +26,17 @@ bool CefDownloadItemImpl::IsValid() {
bool CefDownloadItemImpl::IsInProgress() {
CEF_VALUE_VERIFY_RETURN(false, false);
return const_value().GetState() == content::DownloadItem::IN_PROGRESS;
return const_value().GetState() == download::DownloadItem::IN_PROGRESS;
}
bool CefDownloadItemImpl::IsComplete() {
CEF_VALUE_VERIFY_RETURN(false, false);
return const_value().GetState() == content::DownloadItem::COMPLETE;
return const_value().GetState() == download::DownloadItem::COMPLETE;
}
bool CefDownloadItemImpl::IsCanceled() {
CEF_VALUE_VERIFY_RETURN(false, false);
return const_value().GetState() == content::DownloadItem::CANCELLED;
return const_value().GetState() == download::DownloadItem::CANCELLED;
}
int64 CefDownloadItemImpl::GetCurrentSpeed() {

View File

@ -9,15 +9,15 @@
#include "include/cef_download_item.h"
#include "libcef/common/value_base.h"
namespace content {
namespace download {
class DownloadItem;
}
// CefDownloadItem implementation
class CefDownloadItemImpl
: public CefValueBase<CefDownloadItem, content::DownloadItem> {
: public CefValueBase<CefDownloadItem, download::DownloadItem> {
public:
explicit CefDownloadItemImpl(content::DownloadItem* value);
explicit CefDownloadItemImpl(download::DownloadItem* value);
// CefDownloadItem methods.
bool IsValid() override;

View File

@ -15,11 +15,12 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/download_item_utils.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/file_chooser_params.h"
#include "net/base/filename_util.h"
using content::DownloadItem;
using download::DownloadItem;
using content::DownloadManager;
using content::WebContents;
@ -53,11 +54,9 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
if (manager_) {
base::FilePath path = base::FilePath(download_path);
CEF_POST_TASK(
CEF_FILET,
base::Bind(&CefBeforeDownloadCallbackImpl::GenerateFilename,
manager_, download_id_, suggested_name_, path,
show_dialog, callback_));
CEF_POST_USER_VISIBLE_TASK(base::Bind(
&CefBeforeDownloadCallbackImpl::GenerateFilename, manager_,
download_id_, suggested_name_, path, show_dialog, callback_));
}
download_id_ = 0;
@ -77,6 +76,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
const base::FilePath& download_path,
bool show_dialog,
const content::DownloadTargetCallback& callback) {
CEF_REQUIRE_BLOCKING();
base::FilePath suggested_path = download_path;
if (!suggested_path.empty()) {
// Create the directory if necessary.
@ -114,13 +115,14 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
return;
DownloadItem* item = manager->GetDownload(download_id);
if (!item || item->GetState() != content::DownloadItem::IN_PROGRESS)
if (!item || item->GetState() != DownloadItem::IN_PROGRESS)
return;
bool handled = false;
if (show_dialog) {
WebContents* web_contents = item->GetWebContents();
WebContents* web_contents =
content::DownloadItemUtils::GetWebContents(item);
CefRefPtr<CefBrowserHostImpl> browser =
CefBrowserHostImpl::GetBrowserForContents(web_contents);
if (browser.get()) {
@ -146,8 +148,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
if (!handled) {
callback.Run(suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, suggested_path,
content::DOWNLOAD_INTERRUPT_REASON_NONE);
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, suggested_path,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
}
}
@ -163,8 +165,8 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
// The download will be cancelled if |path| is empty.
callback.Run(path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path,
content::DOWNLOAD_INTERRUPT_REASON_NONE);
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, path,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
}
base::WeakPtr<DownloadManager> manager_;
@ -206,7 +208,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
if (manager_) {
DownloadItem* item = manager_->GetDownload(download_id_);
if (item && item->GetState() == content::DownloadItem::IN_PROGRESS)
if (item && item->GetState() == DownloadItem::IN_PROGRESS)
item->Cancel(true);
}
@ -219,7 +221,7 @@ class CefDownloadItemCallbackImpl : public CefDownloadItemCallback {
if (manager_) {
DownloadItem* item = manager_->GetDownload(download_id_);
if (item && item->GetState() == content::DownloadItem::IN_PROGRESS)
if (item && item->GetState() == DownloadItem::IN_PROGRESS)
item->Pause();
}
}
@ -316,7 +318,8 @@ void CefDownloadManagerDelegate::OnDownloadDestroyed(DownloadItem* item) {
void CefDownloadManagerDelegate::OnDownloadCreated(DownloadManager* manager,
DownloadItem* item) {
CefBrowserHostImpl* browser = nullptr;
content::WebContents* contents = item->GetWebContents();
content::WebContents* contents =
content::DownloadItemUtils::GetWebContents(item);
if (contents) {
browser = CefBrowserHostImpl::GetBrowserForContents(contents).get();
DCHECK(browser);
@ -360,8 +363,8 @@ bool CefDownloadManagerDelegate::DetermineDownloadTarget(
if (!item->GetForcedFilePath().empty()) {
callback.Run(
item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, item->GetForcedFilePath(),
content::DOWNLOAD_INTERRUPT_REASON_NONE);
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, item->GetForcedFilePath(),
download::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
}
@ -419,6 +422,6 @@ CefBrowserHostImpl* CefDownloadManagerDelegate::GetBrowser(DownloadItem* item) {
// StartDownloadWithId (originating from CreateInterruptedDownload) with no
// associated WebContents and consequently no associated CEF browser. In that
// case DetermineDownloadTarget will be called before OnDownloadCreated.
DCHECK(!item->GetWebContents());
DCHECK(!content::DownloadItemUtils::GetWebContents(item));
return nullptr;
}

View File

@ -12,11 +12,11 @@
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "content/public/browser/download_item.h"
#include "components/download/public/common/download_item.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_manager_delegate.h"
class CefDownloadManagerDelegate : public content::DownloadItem::Observer,
class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
public content::DownloadManager::Observer,
public content::DownloadManagerDelegate,
public CefBrowserHostImpl::Observer {
@ -26,24 +26,24 @@ class CefDownloadManagerDelegate : public content::DownloadItem::Observer,
private:
// DownloadItem::Observer methods.
void OnDownloadUpdated(content::DownloadItem* item) override;
void OnDownloadDestroyed(content::DownloadItem* item) override;
void OnDownloadUpdated(download::DownloadItem* item) override;
void OnDownloadDestroyed(download::DownloadItem* item) override;
// DownloadManager::Observer methods.
void OnDownloadCreated(content::DownloadManager* manager,
content::DownloadItem* item) override;
download::DownloadItem* item) override;
void ManagerGoingDown(content::DownloadManager* manager) override;
// DownloadManagerDelegate methods.
bool DetermineDownloadTarget(
content::DownloadItem* item,
download::DownloadItem* item,
const content::DownloadTargetCallback& callback) override;
void GetNextId(const content::DownloadIdCallback& callback) override;
// CefBrowserHostImpl::Observer methods.
void OnBrowserDestroyed(CefBrowserHostImpl* browser) override;
CefBrowserHostImpl* GetBrowser(content::DownloadItem* item);
CefBrowserHostImpl* GetBrowser(download::DownloadItem* item);
content::DownloadManager* manager_;
base::WeakPtrFactory<content::DownloadManager> manager_ptr_factory_;
@ -51,7 +51,7 @@ class CefDownloadManagerDelegate : public content::DownloadItem::Observer,
// Map of DownloadItem to originating CefBrowserHostImpl. Maintaining this
// map is necessary because DownloadItem::GetWebContents() may return NULL if
// the browser navigates while the download is in progress.
typedef std::map<content::DownloadItem*, CefBrowserHostImpl*> ItemBrowserMap;
typedef std::map<download::DownloadItem*, CefBrowserHostImpl*> ItemBrowserMap;
ItemBrowserMap item_browser_map_;
DISALLOW_COPY_AND_ASSIGN(CefDownloadManagerDelegate);

View File

@ -415,36 +415,36 @@ std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::CreateTabObject(
content::WebContents* contents = new_browser->web_contents();
bool is_loading = contents->IsLoading();
auto tab_object = base::MakeUnique<api::tabs::Tab>();
tab_object->id = base::MakeUnique<int>(new_browser->GetIdentifier());
auto tab_object = std::make_unique<api::tabs::Tab>();
tab_object->id = std::make_unique<int>(new_browser->GetIdentifier());
tab_object->index = index;
tab_object->window_id = *tab_object->id;
tab_object->status = base::MakeUnique<std::string>(
tab_object->status = std::make_unique<std::string>(
is_loading ? keys::kStatusValueLoading : keys::kStatusValueComplete);
tab_object->active = active;
tab_object->selected = true;
tab_object->highlighted = true;
tab_object->pinned = false;
tab_object->audible = base::MakeUnique<bool>(contents->WasRecentlyAudible());
tab_object->audible = std::make_unique<bool>(contents->WasRecentlyAudible());
tab_object->discarded = false;
tab_object->auto_discardable = false;
tab_object->muted_info = CreateMutedInfo(contents);
tab_object->incognito = false;
gfx::Size contents_size = contents->GetContainerBounds().size();
tab_object->width = base::MakeUnique<int>(contents_size.width());
tab_object->height = base::MakeUnique<int>(contents_size.height());
tab_object->url = base::MakeUnique<std::string>(contents->GetURL().spec());
tab_object->width = std::make_unique<int>(contents_size.width());
tab_object->height = std::make_unique<int>(contents_size.height());
tab_object->url = std::make_unique<std::string>(contents->GetURL().spec());
tab_object->title =
base::MakeUnique<std::string>(base::UTF16ToUTF8(contents->GetTitle()));
std::make_unique<std::string>(base::UTF16ToUTF8(contents->GetTitle()));
content::NavigationEntry* entry = contents->GetController().GetVisibleEntry();
if (entry && entry->GetFavicon().valid) {
tab_object->fav_icon_url =
base::MakeUnique<std::string>(entry->GetFavicon().url.spec());
std::make_unique<std::string>(entry->GetFavicon().url.spec());
}
if (opener_browser_id >= 0)
tab_object->opener_tab_id = base::MakeUnique<int>(opener_browser_id);
tab_object->opener_tab_id = std::make_unique<int>(opener_browser_id);
return tab_object;
}

View File

@ -20,7 +20,6 @@
#include "base/path_service.h"
#include "base/strings/string_tokenizer.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_paths.h"
@ -112,7 +111,7 @@ void LoadExtensionWithManifest(base::WeakPtr<CefExtensionSystem> context,
bool internal,
CefRefPtr<CefRequestContext> loader_context,
CefRefPtr<CefExtensionHandler> handler) {
base::AssertBlockingAllowed();
CEF_REQUIRE_BLOCKING();
std::unique_ptr<base::DictionaryValue> manifest =
ParseManifest(manifest_contents);
@ -131,7 +130,7 @@ void LoadExtensionFromDisk(base::WeakPtr<CefExtensionSystem> context,
bool internal,
CefRefPtr<CefRequestContext> loader_context,
CefRefPtr<CefExtensionHandler> handler) {
base::AssertBlockingAllowed();
CEF_REQUIRE_BLOCKING();
base::FilePath manifest_path = root_directory.AppendASCII("manifest.json");
std::string manifest_contents;
@ -239,8 +238,7 @@ void CefExtensionSystem::LoadExtension(
CefRefPtr<CefRequestContext> loader_context,
CefRefPtr<CefExtensionHandler> handler) {
CEF_REQUIRE_UIT();
base::PostTaskWithTraits(
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
CEF_POST_USER_VISIBLE_TASK(
base::BindOnce(LoadExtensionFromDisk, weak_ptr_factory_.GetWeakPtr(),
root_directory, internal, loader_context, handler));
}
@ -252,11 +250,9 @@ void CefExtensionSystem::LoadExtension(
CefRefPtr<CefRequestContext> loader_context,
CefRefPtr<CefExtensionHandler> handler) {
CEF_REQUIRE_UIT();
base::PostTaskWithTraits(
FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::MayBlock()},
base::BindOnce(LoadExtensionWithManifest, weak_ptr_factory_.GetWeakPtr(),
manifest_contents, root_directory, internal,
loader_context, handler));
CEF_POST_USER_VISIBLE_TASK(base::BindOnce(
LoadExtensionWithManifest, weak_ptr_factory_.GetWeakPtr(),
manifest_contents, root_directory, internal, loader_context, handler));
}
// Implementation based on ComponentLoader::Add.
@ -453,7 +449,7 @@ ContentVerifier* CefExtensionSystem::content_verifier() {
std::unique_ptr<ExtensionSet> CefExtensionSystem::GetDependentExtensions(
const Extension* extension) {
return base::MakeUnique<ExtensionSet>();
return std::make_unique<ExtensionSet>();
}
void CefExtensionSystem::InstallUpdate(
@ -465,6 +461,13 @@ void CefExtensionSystem::InstallUpdate(
base::DeleteFile(temp_dir, true /* recursive */);
}
bool CefExtensionSystem::FinishDelayedInstallationIfReady(
const std::string& extension_id,
bool install_immediately) {
NOTREACHED();
return false;
}
CefExtensionSystem::ComponentExtensionInfo::ComponentExtensionInfo(
const base::DictionaryValue* manifest,
const base::FilePath& directory,

View File

@ -115,6 +115,8 @@ class CefExtensionSystem : public ExtensionSystem {
const std::string& public_key,
const base::FilePath& temp_dir,
InstallUpdateCallback install_update_callback) override;
bool FinishDelayedInstallationIfReady(const std::string& extension_id,
bool install_immediately) override;
bool initialized() const { return initialized_; }

View File

@ -123,6 +123,25 @@ CefExtensionsBrowserClient::MaybeCreateResourceBundleRequestJob(
send_cors_header);
}
base::FilePath CefExtensionsBrowserClient::GetBundleResourcePath(
const network::ResourceRequest& request,
const base::FilePath& extension_resources_path,
int* resource_id) const {
*resource_id = 0;
return base::FilePath();
}
void CefExtensionsBrowserClient::LoadResourceFromResourceBundle(
const network::ResourceRequest& request,
network::mojom::URLLoaderRequest loader,
const base::FilePath& resource_relative_path,
int resource_id,
const std::string& content_security_policy,
network::mojom::URLLoaderClientPtr client,
bool send_cors_header) {
NOTREACHED() << "Load resources from bundles not supported.";
}
bool CefExtensionsBrowserClient::AllowCrossRendererResourceLoad(
const GURL& url,
content::ResourceType resource_type,
@ -239,6 +258,11 @@ bool CefExtensionsBrowserClient::IsRunningInForcedAppMode() {
return false;
}
bool CefExtensionsBrowserClient::IsAppModeForcedForApp(
const ExtensionId& extension_id) {
return false;
}
bool CefExtensionsBrowserClient::IsLoggedInAsPublicAccount() {
return false;
}

View File

@ -51,6 +51,18 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
const base::FilePath& directory_path,
const std::string& content_security_policy,
bool send_cors_header) override;
base::FilePath GetBundleResourcePath(
const network::ResourceRequest& request,
const base::FilePath& extension_resources_path,
int* resource_id) const override;
void LoadResourceFromResourceBundle(
const network::ResourceRequest& request,
network::mojom::URLLoaderRequest loader,
const base::FilePath& resource_relative_path,
int resource_id,
const std::string& content_security_policy,
network::mojom::URLLoaderClientPtr client,
bool send_cors_header) override;
bool AllowCrossRendererResourceLoad(const GURL& url,
content::ResourceType resource_type,
ui::PageTransition page_transition,
@ -73,6 +85,7 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
bool DidVersionUpdate(content::BrowserContext* context) override;
void PermitExternalProtocolHandler() override;
bool IsRunningInForcedAppMode() override;
bool IsAppModeForcedForApp(const ExtensionId& extension_id) override;
bool IsLoggedInAsPublicAccount() override;
ExtensionSystemProvider* GetExtensionSystemFactory() override;
void RegisterExtensionFunctions(

View File

@ -79,12 +79,14 @@ void CefJavaScriptDialogManager::Destroy() {
void CefJavaScriptDialogManager::RunJavaScriptDialog(
content::WebContents* web_contents,
const GURL& origin_url,
content::RenderFrameHost* render_frame_host,
content::JavaScriptDialogType message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,
DialogClosedCallback callback,
bool* did_suppress_message) {
const GURL& origin_url = render_frame_host->GetLastCommittedURL();
CefRefPtr<CefClient> client = browser_->GetClient();
if (client.get()) {
CefRefPtr<CefJSDialogHandler> handler = client->GetJSDialogHandler();

View File

@ -29,7 +29,7 @@ class CefJavaScriptDialogManager : public content::JavaScriptDialogManager {
// JavaScriptDialogManager methods.
void RunJavaScriptDialog(content::WebContents* web_contents,
const GURL& origin_url,
content::RenderFrameHost* render_frame_host,
content::JavaScriptDialogType message_type,
const base::string16& message_text,
const base::string16& default_prompt_text,

View File

@ -42,7 +42,7 @@
namespace {
void WriteTempFileAndView(scoped_refptr<base::RefCountedString> str) {
CEF_REQUIRE_FILET();
CEF_REQUIRE_BLOCKING();
base::FilePath tmp_file;
if (!base::CreateTemporaryFile(&tmp_file))
@ -84,7 +84,7 @@ bool HasExternalHandler(const std::string& scheme) {
}
void ExecuteExternalProtocol(const GURL& url) {
CEF_REQUIRE_FILET();
CEF_REQUIRE_BLOCKING();
if (!HasExternalHandler(url.scheme()))
return;
@ -324,7 +324,7 @@ void CefBrowserPlatformDelegateNativeWin::ViewText(const std::string& text) {
std::string str = text;
scoped_refptr<base::RefCountedString> str_ref =
base::RefCountedString::TakeString(&str);
CEF_POST_TASK(CEF_FILET, base::Bind(WriteTempFileAndView, str_ref));
CEF_POST_USER_VISIBLE_TASK(base::Bind(WriteTempFileAndView, str_ref));
}
void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
@ -370,8 +370,7 @@ void CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
void CefBrowserPlatformDelegateNativeWin::HandleExternalProtocol(
const GURL& url) {
// Execute on the FILE thread.
CEF_POST_TASK(CEF_FILET, base::Bind(ExecuteExternalProtocol, url));
CEF_POST_USER_VISIBLE_TASK(base::Bind(ExecuteExternalProtocol, url));
}
void CefBrowserPlatformDelegateNativeWin::TranslateKeyEvent(

View File

@ -647,7 +647,7 @@ void CefNativeMenuWin::AddMenuItemAt(int menu_index, int model_index) {
else
mii.fType = MFT_OWNERDRAW;
std::unique_ptr<ItemData> item_data = base::MakeUnique<ItemData>();
std::unique_ptr<ItemData> item_data = std::make_unique<ItemData>();
item_data->label = base::string16();
ui::MenuModel::ItemType type = model_->GetTypeAt(model_index);
if (type == ui::MenuModel::TYPE_SUBMENU) {
@ -676,7 +676,7 @@ void CefNativeMenuWin::AddSeparatorItemAt(int menu_index, int model_index) {
mii.fType = MFT_SEPARATOR;
// Insert a dummy entry into our label list so we can index directly into it
// using item indices if need be.
items_.insert(items_.begin() + model_index, base::MakeUnique<ItemData>());
items_.insert(items_.begin() + model_index, std::make_unique<ItemData>());
InsertMenuItem(menu_, menu_index, TRUE, &mii);
}

View File

@ -333,7 +333,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
}
break;
}
case FocusIn:
case x11::FocusIn:
// This message is received first followed by a "_NET_ACTIVE_WINDOW"
// message sent to the root window. When X11DesktopHandler handles the
// "_NET_ACTIVE_WINDOW" message it will erroneously mark the WebView
@ -347,7 +347,7 @@ uint32_t CefWindowX11::DispatchEvent(const ui::PlatformEvent& event) {
100);
}
break;
case FocusOut:
case x11::FocusOut:
// Cancel the pending focus change if some other window has gained focus
// while waiting for the async task to run. Otherwise we can get stuck in
// a focus change loop.

View File

@ -72,7 +72,6 @@ const char* kAllowedWebUIHosts[] = {
chrome::kChromeUINetInternalsHost,
content::kChromeUINetworkErrorHost,
content::kChromeUINetworkErrorsListingHost,
content::kChromeUINetworkViewCacheHost,
content::kChromeUIResourcesHost,
content::kChromeUIServiceWorkerInternalsHost,
chrome::kChromeUISystemInfoHost,
@ -794,6 +793,7 @@ void DidFinishChromeLoad(CefRefPtr<CefFrame> frame, const GURL& validated_url) {
switch (host_id) {
case CHROME_VERSION:
DidFinishChromeVersionLoad(frame);
break;
default:
break;
}

View File

@ -11,6 +11,32 @@
#include "base/logging.h"
#include "net/url_request/url_request_context.h"
namespace {
class NullCookieChangeDispatcher : public net::CookieChangeDispatcher {
public:
NullCookieChangeDispatcher() {}
~NullCookieChangeDispatcher() override {}
// net::CookieChangeDispatcher
std::unique_ptr<net::CookieChangeSubscription> AddCallbackForCookie(
const GURL& url,
const std::string& name,
net::CookieChangeCallback callback) override WARN_UNUSED_RESULT {
return nullptr;
}
std::unique_ptr<net::CookieChangeSubscription> AddCallbackForAllChanges(
net::CookieChangeCallback callback) override WARN_UNUSED_RESULT {
return nullptr;
}
private:
DISALLOW_COPY_AND_ASSIGN(NullCookieChangeDispatcher);
};
} // namespace
CefCookieStoreProxy::CefCookieStoreProxy(
CefURLRequestContextImpl* parent,
CefRefPtr<CefRequestContextHandler> handler)
@ -53,18 +79,6 @@ void CefCookieStoreProxy::SetCanonicalCookieAsync(
}
}
void CefCookieStoreProxy::GetCookiesWithOptionsAsync(
const GURL& url,
const net::CookieOptions& options,
GetCookiesCallback callback) {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store) {
cookie_store->GetCookiesWithOptionsAsync(url, options, std::move(callback));
} else if (!callback.is_null()) {
std::move(callback).Run(std::string());
}
}
void CefCookieStoreProxy::GetCookieListWithOptionsAsync(
const GURL& url,
const net::CookieOptions& options,
@ -154,26 +168,14 @@ void CefCookieStoreProxy::FlushStore(base::OnceClosure callback) {
}
}
std::unique_ptr<net::CookieStore::CookieChangedSubscription>
CefCookieStoreProxy::AddCallbackForCookie(
const GURL& url,
const std::string& name,
const CookieChangedCallback& callback) {
net::CookieChangeDispatcher& CefCookieStoreProxy::GetChangeDispatcher() {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store) {
return cookie_store->AddCallbackForCookie(url, name, callback);
}
return nullptr;
}
if (cookie_store)
return cookie_store->GetChangeDispatcher();
std::unique_ptr<net::CookieStore::CookieChangedSubscription>
CefCookieStoreProxy::AddCallbackForAllChanges(
const CookieChangedCallback& callback) {
net::CookieStore* cookie_store = GetCookieStore();
if (cookie_store) {
return cookie_store->AddCallbackForAllChanges(callback);
}
return nullptr;
if (!null_dispatcher_)
null_dispatcher_.reset(new NullCookieChangeDispatcher());
return *null_dispatcher_;
}
bool CefCookieStoreProxy::IsEphemeral() {

View File

@ -30,9 +30,6 @@ class CefCookieStoreProxy : public net::CookieStore {
bool secure_source,
bool modify_http_only,
SetCookiesCallback callback) override;
void GetCookiesWithOptionsAsync(const GURL& url,
const net::CookieOptions& options,
GetCookiesCallback callback) override;
void GetCookieListWithOptionsAsync(const GURL& url,
const net::CookieOptions& options,
GetCookieListCallback callback) override;
@ -52,12 +49,7 @@ class CefCookieStoreProxy : public net::CookieStore {
DeleteCallback callback) override;
void DeleteSessionCookiesAsync(DeleteCallback callback) override;
void FlushStore(base::OnceClosure callback) override;
std::unique_ptr<CookieChangedSubscription> AddCallbackForCookie(
const GURL& url,
const std::string& name,
const CookieChangedCallback& callback) override;
std::unique_ptr<CookieChangedSubscription> AddCallbackForAllChanges(
const CookieChangedCallback& callback) override;
net::CookieChangeDispatcher& GetChangeDispatcher() override;
bool IsEphemeral() override;
private:
@ -68,6 +60,8 @@ class CefCookieStoreProxy : public net::CookieStore {
CefURLRequestContextImpl* parent_;
CefRefPtr<CefRequestContextHandler> handler_;
std::unique_ptr<net::CookieChangeDispatcher> null_dispatcher_;
DISALLOW_COPY_AND_ASSIGN(CefCookieStoreProxy);
};

View File

@ -9,10 +9,8 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "net/cert/crl_set.h"
#include "net/cert/crl_set_storage.h"
#include "net/ssl/ssl_config_service.h"
namespace {
@ -25,7 +23,7 @@ void SetCRLSetIfNewer(scoped_refptr<net::CRLSet> crl_set) {
}
void LoadFromDisk(const base::FilePath& path) {
base::AssertBlockingAllowed();
CEF_REQUIRE_BLOCKING();
std::string crl_set_bytes;
if (!base::ReadFileToString(path, &crl_set_bytes)) {
@ -34,7 +32,7 @@ void LoadFromDisk(const base::FilePath& path) {
}
scoped_refptr<net::CRLSet> crl_set;
if (!net::CRLSetStorage::Parse(crl_set_bytes, &crl_set)) {
if (!net::CRLSet::Parse(crl_set_bytes, &crl_set)) {
LOG(WARNING) << "Failed to parse CRL set from " << path.MaybeAsASCII();
return;
}
@ -51,7 +49,5 @@ void CefLoadCRLSetsFile(const CefString& path) {
return;
}
base::PostTaskWithTraits(FROM_HERE,
{base::TaskPriority::BACKGROUND, base::MayBlock()},
base::BindOnce(&LoadFromDisk, path));
CEF_POST_USER_VISIBLE_TASK(base::BindOnce(&LoadFromDisk, path));
}

View File

@ -272,7 +272,7 @@ std::unique_ptr<net::SourceStream> CefNetworkDelegate::CreateSourceStream(
}
if (cef_filter && cef_filter->InitFilter())
return base::MakeUnique<CefSourceStream>(cef_filter, std::move(upstream));
return std::make_unique<CefSourceStream>(cef_filter, std::move(upstream));
return upstream;
}

View File

@ -331,7 +331,7 @@ bool CefResourceRequestJob::GetMimeType(std::string* mime_type) const {
bool CefResourceRequestJob::GetCharset(std::string* charset) {
CEF_REQUIRE_IOT();
if (net::HttpResponseHeaders *headers = GetResponseHeaders())
if (net::HttpResponseHeaders* headers = GetResponseHeaders())
return headers->GetCharset(charset);
return false;
}
@ -411,7 +411,7 @@ void CefResourceRequestJob::AddCookieHeaderAndStart() {
void CefResourceRequestJob::DoLoadCookies() {
net::CookieOptions options;
options.set_include_httponly();
request_->context()->cookie_store()->GetCookiesWithOptionsAsync(
request_->context()->cookie_store()->GetCookieListWithOptionsAsync(
request_->url(), options,
base::Bind(&CefResourceRequestJob::OnCookiesLoaded,
weak_factory_.GetWeakPtr()));
@ -438,8 +438,11 @@ void CefResourceRequestJob::CheckCookiePolicyAndLoad(
DoStartTransaction();
}
void CefResourceRequestJob::OnCookiesLoaded(const std::string& cookie_line) {
if (!cookie_line.empty()) {
void CefResourceRequestJob::OnCookiesLoaded(
const net::CookieList& cookie_list) {
if (!cookie_list.empty()) {
const std::string& cookie_line =
net::CanonicalCookie::BuildCookieLine(cookie_list);
CefRequest::HeaderMap headerMap;
cef_request_->GetHeaderMap(headerMap);
headerMap.insert(

View File

@ -20,7 +20,7 @@
namespace net {
class HttpResponseHeaders;
class URLRequest;
}
} // namespace net
class CefResourceRequestJobCallback;
@ -48,7 +48,7 @@ class CefResourceRequestJob : public net::URLRequestJob {
void AddCookieHeaderAndStart();
void DoLoadCookies();
void CheckCookiePolicyAndLoad(const net::CookieList& cookie_list);
void OnCookiesLoaded(const std::string& cookie_line);
void OnCookiesLoaded(const net::CookieList& cookie_list);
void DoStartTransaction();
void StartTransaction();

View File

@ -35,7 +35,7 @@ void InstallInternalProtectedHandlers(
url::kFileScheme,
linked_ptr<net::URLRequestJobFactory::ProtocolHandler>(
new net::FileProtocolHandler(base::CreateTaskRunnerWithTraits(
{base::MayBlock(), base::TaskPriority::BACKGROUND,
{base::MayBlock(), base::TaskPriority::USER_VISIBLE,
base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN})))));
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
protocol_handlers->insert(std::make_pair(

View File

@ -8,6 +8,7 @@
#include <utility>
#include <vector>
#include "libcef/browser/content_browser_client.h"
#include "libcef/browser/cookie_manager_impl.h"
#include "libcef/browser/net/network_delegate.h"
#include "libcef/browser/net/scheme_handler.h"
@ -31,7 +32,6 @@
#include "components/network_session_configurator/browser/network_session_configurator.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "content/network/proxy_service_mojo.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/content_client.h"
#include "content/public/common/content_switches.h"
@ -51,9 +51,9 @@
#include "net/http/http_server_properties_impl.h"
#include "net/http/http_util.h"
#include "net/http/transport_security_state.h"
#include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
#include "net/proxy/proxy_script_fetcher_impl.h"
#include "net/proxy/proxy_service.h"
#include "net/proxy_resolution/dhcp_pac_file_fetcher_factory.h"
#include "net/proxy_resolution/pac_file_fetcher_impl.h"
#include "net/proxy_resolution/proxy_service.h"
#include "net/ssl/ssl_config_service_defaults.h"
#include "net/url_request/http_user_agent_settings.h"
#include "net/url_request/url_request.h"
@ -62,6 +62,7 @@
#include "net/url_request/url_request_intercepting_job_factory.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "net/url_request/url_request_job_manager.h"
#include "services/network/proxy_service_mojo.h"
#include "url/url_constants.h"
#if defined(OS_WIN)
@ -108,9 +109,9 @@ class CefHttpUserAgentSettings : public net::HttpUserAgentSettings {
DISALLOW_COPY_AND_ASSIGN(CefHttpUserAgentSettings);
};
// Based on ProxyServiceFactory::CreateProxyService which was deleted in
// http://crrev.com/1c261ff4.
std::unique_ptr<net::ProxyService> CreateProxyService(
// Based on ProxyResolutionServiceFactory::CreateProxyResolutionService which
// was deleted in http://crrev.com/1c261ff4.
std::unique_ptr<net::ProxyResolutionService> CreateProxyResolutionService(
net::NetLog* net_log,
net::URLRequestContext* context,
net::NetworkDelegate* network_delegate,
@ -129,27 +130,27 @@ std::unique_ptr<net::ProxyService> CreateProxyService(
use_v8 = false; // Fallback to non-v8 implementation.
}
std::unique_ptr<net::ProxyService> proxy_service;
std::unique_ptr<net::ProxyResolutionService> proxy_service;
if (use_v8) {
std::unique_ptr<net::DhcpProxyScriptFetcher> dhcp_proxy_script_fetcher;
net::DhcpProxyScriptFetcherFactory dhcp_factory;
dhcp_proxy_script_fetcher = dhcp_factory.Create(context);
proxy_service = content::CreateProxyServiceUsingMojoFactory(
proxy_service = network::CreateProxyServiceUsingMojoFactory(
std::move(proxy_resolver_factory), std::move(proxy_config_service),
base::MakeUnique<net::ProxyScriptFetcherImpl>(context),
std::make_unique<net::ProxyScriptFetcherImpl>(context),
std::move(dhcp_proxy_script_fetcher), context->host_resolver(), net_log,
network_delegate);
} else {
proxy_service = net::ProxyService::CreateUsingSystemProxyResolver(
proxy_service = net::ProxyResolutionService::CreateUsingSystemProxyResolver(
std::move(proxy_config_service), net_log);
}
proxy_service->set_quick_check_enabled(quick_check_enabled);
proxy_service->set_sanitize_url_policy(
pac_https_url_stripping_enabled
? net::ProxyService::SanitizeUrlPolicy::SAFE
: net::ProxyService::SanitizeUrlPolicy::UNSAFE);
? net::ProxyResolutionService::SanitizeUrlPolicy::SAFE
: net::ProxyResolutionService::SanitizeUrlPolicy::UNSAFE);
return proxy_service;
}
@ -163,7 +164,7 @@ CefURLRequestContextGetterImpl::CefURLRequestContextGetterImpl(
content::ProtocolHandlerMap* protocol_handlers,
std::unique_ptr<net::ProxyConfigService> proxy_config_service,
content::URLRequestInterceptorScopedVector request_interceptors)
: settings_(settings), io_state_(base::MakeUnique<IOState>()) {
: settings_(settings), io_state_(std::make_unique<IOState>()) {
// Must first be created on the UI thread.
CEF_REQUIRE_UIT();
@ -246,9 +247,9 @@ void CefURLRequestContextGetterImpl::ShutdownOnIOThread() {
shutting_down_ = true;
// Delete the ProxyService object here so that any pending requests will be
// canceled before the URLRequestContext is destroyed.
io_state_->storage_->set_proxy_service(NULL);
// Delete the ProxyResolutionService object here so that any pending requests
// will be canceled before the URLRequestContext is destroyed.
io_state_->storage_->set_proxy_resolution_service(NULL);
io_state_.reset();
@ -315,15 +316,16 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
settings_.enable_net_security_expiration ? true : false);
io_state_->storage_->set_ct_policy_enforcer(std::move(ct_policy_enforcer));
std::unique_ptr<net::ProxyService> system_proxy_service =
CreateProxyService(io_state_->net_log_,
io_state_->url_request_context_.get(),
std::unique_ptr<net::ProxyResolutionService> system_proxy_service =
CreateProxyResolutionService(
io_state_->net_log_, io_state_->url_request_context_.get(),
io_state_->url_request_context_->network_delegate(),
std::move(io_state_->proxy_resolver_factory_),
std::move(io_state_->proxy_config_service_),
*command_line, quick_check_enabled_.GetValue(),
std::move(io_state_->proxy_config_service_), *command_line,
quick_check_enabled_.GetValue(),
pac_https_url_stripping_enabled_.GetValue());
io_state_->storage_->set_proxy_service(std::move(system_proxy_service));
io_state_->storage_->set_proxy_resolution_service(
std::move(system_proxy_service));
io_state_->storage_->set_ssl_config_service(
new net::SSLConfigServiceDefaults);
@ -372,8 +374,8 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
io_state_->url_request_context_->cert_transparency_verifier();
network_session_context.ct_policy_enforcer =
io_state_->url_request_context_->ct_policy_enforcer();
network_session_context.proxy_service =
io_state_->url_request_context_->proxy_service();
network_session_context.proxy_resolution_service =
io_state_->url_request_context_->proxy_resolution_service();
network_session_context.ssl_config_service =
io_state_->url_request_context_->ssl_config_service();
network_session_context.http_auth_handler_factory =
@ -414,7 +416,7 @@ net::URLRequestContext* CefURLRequestContextGetterImpl::GetURLRequestContext() {
scheme::RegisterInternalHandlers(io_state_->url_request_manager_.get());
io_state_->request_interceptors_.push_back(
base::MakeUnique<CefRequestInterceptor>());
std::make_unique<CefRequestInterceptor>());
// Set up interceptors in the reverse order.
std::unique_ptr<net::URLRequestJobFactory> top_job_factory =
@ -472,7 +474,10 @@ void CefURLRequestContextGetterImpl::SetCookieStoragePath(
const base::FilePath& cookie_path = path.AppendASCII("Cookies");
persistent_store = new net::SQLitePersistentCookieStore(
cookie_path, BrowserThread::GetTaskRunnerForThread(BrowserThread::IO),
BrowserThread::GetTaskRunnerForThread(BrowserThread::DB),
// Intentionally using the background task runner exposed by CEF to
// facilitate unit test expectations. This task runner MUST be
// configured with BLOCK_SHUTDOWN.
CefContentBrowserClient::Get()->background_task_runner(),
persist_session_cookies, NULL);
} else {
NOTREACHED() << "The cookie storage directory could not be created";

View File

@ -28,7 +28,7 @@ CefURLRequestContextProxy::CefURLRequestContextProxy(
set_cert_transparency_verifier(parent->cert_transparency_verifier());
set_ct_policy_enforcer(parent->ct_policy_enforcer());
set_channel_id_service(parent->channel_id_service());
set_proxy_service(parent->proxy_service());
set_proxy_resolution_service(parent->proxy_resolution_service());
set_ssl_config_service(parent->ssl_config_service());
set_http_auth_handler_factory(parent->http_auth_handler_factory());
set_http_transaction_factory(parent->http_transaction_factory());

View File

@ -12,7 +12,8 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "content/public/browser/ax_event_notification_details.h"
#include "ui/accessibility/ax_enums.h"
#include "ui/accessibility/ax_enum_util.h"
#include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_text_utils.h"
#include "ui/accessibility/ax_tree_update.h"
#include "ui/gfx/transform.h"
@ -39,9 +40,10 @@ CefRefPtr<CefListValue> ToCefValue(uint32_t state) {
int index = 0;
// Iterate and find which states are set.
for (unsigned i = ui::AX_STATE_NONE; i <= ui::AX_STATE_LAST; i++) {
for (unsigned i = static_cast<unsigned>(ax::mojom::Role::kNone);
i <= static_cast<unsigned>(ax::mojom::Role::kLast); i++) {
if (state & (1 << i))
value->SetString(index++, ToString(static_cast<ui::AXState>(i)));
value->SetString(index++, ToString(static_cast<ax::mojom::State>(i)));
}
return value;
}
@ -65,127 +67,124 @@ struct PopulateAxNodeAttributes {
: attributes(attrs) {}
// Int Attributes
void operator()(const std::pair<ui::AXIntAttribute, int32_t> attr) {
if (attr.first == ui::AX_INT_ATTRIBUTE_NONE)
void operator()(const std::pair<ax::mojom::IntAttribute, int32_t> attr) {
if (attr.first == ax::mojom::IntAttribute::kNone)
return;
switch (attr.first) {
case ui::AX_INT_ATTRIBUTE_NONE:
case ax::mojom::IntAttribute::kNone:
break;
case ui::AX_ATTR_SCROLL_X:
case ui::AX_ATTR_SCROLL_X_MIN:
case ui::AX_ATTR_SCROLL_X_MAX:
case ui::AX_ATTR_SCROLL_Y:
case ui::AX_ATTR_SCROLL_Y_MIN:
case ui::AX_ATTR_SCROLL_Y_MAX:
case ui::AX_ATTR_HIERARCHICAL_LEVEL:
case ui::AX_ATTR_TEXT_SEL_START:
case ui::AX_ATTR_TEXT_SEL_END:
case ui::AX_ATTR_ARIA_COLUMN_COUNT:
case ui::AX_ATTR_ARIA_CELL_COLUMN_INDEX:
case ui::AX_ATTR_ARIA_ROW_COUNT:
case ui::AX_ATTR_ARIA_CELL_ROW_INDEX:
case ui::AX_ATTR_TABLE_ROW_COUNT:
case ui::AX_ATTR_TABLE_COLUMN_COUNT:
case ui::AX_ATTR_TABLE_CELL_COLUMN_INDEX:
case ui::AX_ATTR_TABLE_CELL_ROW_INDEX:
case ui::AX_ATTR_TABLE_CELL_COLUMN_SPAN:
case ui::AX_ATTR_TABLE_CELL_ROW_SPAN:
case ui::AX_ATTR_TABLE_COLUMN_HEADER_ID:
case ui::AX_ATTR_TABLE_COLUMN_INDEX:
case ui::AX_ATTR_TABLE_HEADER_ID:
case ui::AX_ATTR_TABLE_ROW_HEADER_ID:
case ui::AX_ATTR_TABLE_ROW_INDEX:
case ui::AX_ATTR_ACTIVEDESCENDANT_ID:
case ui::AX_ATTR_IN_PAGE_LINK_TARGET_ID:
case ui::AX_ATTR_ERRORMESSAGE_ID:
case ui::AX_ATTR_DETAILS_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_PREVIOUS_FOCUS_ID:
case ui::AX_ATTR_PREVIOUS_ON_LINE_ID:
case ui::AX_ATTR_CHILD_TREE_ID:
case ui::AX_ATTR_SET_SIZE:
case ui::AX_ATTR_POS_IN_SET:
case ax::mojom::IntAttribute::kScrollX:
case ax::mojom::IntAttribute::kScrollXMin:
case ax::mojom::IntAttribute::kScrollXMax:
case ax::mojom::IntAttribute::kScrollY:
case ax::mojom::IntAttribute::kScrollYMin:
case ax::mojom::IntAttribute::kScrollYMax:
case ax::mojom::IntAttribute::kHierarchicalLevel:
case ax::mojom::IntAttribute::kTextSelStart:
case ax::mojom::IntAttribute::kTextSelEnd:
case ax::mojom::IntAttribute::kAriaColumnCount:
case ax::mojom::IntAttribute::kAriaCellColumnIndex:
case ax::mojom::IntAttribute::kAriaRowCount:
case ax::mojom::IntAttribute::kAriaCellRowIndex:
case ax::mojom::IntAttribute::kTableRowCount:
case ax::mojom::IntAttribute::kTableColumnCount:
case ax::mojom::IntAttribute::kTableCellColumnIndex:
case ax::mojom::IntAttribute::kTableCellRowIndex:
case ax::mojom::IntAttribute::kTableCellColumnSpan:
case ax::mojom::IntAttribute::kTableCellRowSpan:
case ax::mojom::IntAttribute::kTableColumnHeaderId:
case ax::mojom::IntAttribute::kTableColumnIndex:
case ax::mojom::IntAttribute::kTableHeaderId:
case ax::mojom::IntAttribute::kTableRowHeaderId:
case ax::mojom::IntAttribute::kTableRowIndex:
case ax::mojom::IntAttribute::kActivedescendantId:
case ax::mojom::IntAttribute::kInPageLinkTargetId:
case ax::mojom::IntAttribute::kErrormessageId:
case ax::mojom::IntAttribute::kDetailsId:
case ax::mojom::IntAttribute::kMemberOfId:
case ax::mojom::IntAttribute::kNextFocusId:
case ax::mojom::IntAttribute::kNextOnLineId:
case ax::mojom::IntAttribute::kPreviousFocusId:
case ax::mojom::IntAttribute::kPreviousOnLineId:
case ax::mojom::IntAttribute::kChildTreeId:
case ax::mojom::IntAttribute::kSetSize:
case ax::mojom::IntAttribute::kPosInSet:
attributes->SetInt(ToString(attr.first), attr.second);
break;
case ui::AX_ATTR_DEFAULT_ACTION_VERB:
case ax::mojom::IntAttribute::kDefaultActionVerb:
attributes->SetString(
ToString(attr.first),
ui::ActionVerbToUnlocalizedString(
static_cast<ui::AXDefaultActionVerb>(attr.second)));
static_cast<ax::mojom::DefaultActionVerb>(attr.second)));
break;
case ui::AX_ATTR_INVALID_STATE:
if (ui::AX_INVALID_STATE_NONE != attr.second) {
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXInvalidState>(attr.second)));
case ax::mojom::IntAttribute::kInvalidState: {
auto state = static_cast<ax::mojom::InvalidState>(attr.second);
if (ax::mojom::InvalidState::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
break;
case ui::AX_ATTR_CHECKED_STATE:
if (ui::AX_CHECKED_STATE_NONE != attr.second) {
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXCheckedState>(attr.second)));
} break;
case ax::mojom::IntAttribute::kCheckedState: {
auto state = static_cast<ax::mojom::CheckedState>(attr.second);
if (ax::mojom::CheckedState::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
break;
case ui::AX_ATTR_RESTRICTION:
} break;
case ax::mojom::IntAttribute::kRestriction:
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXRestriction>(attr.second)));
ToString(static_cast<ax::mojom::Restriction>(attr.second)));
break;
case ui::AX_ATTR_SORT_DIRECTION:
if (ui::AX_SORT_DIRECTION_NONE != attr.second) {
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXSortDirection>(attr.second)));
case ax::mojom::IntAttribute::kSortDirection: {
auto state = static_cast<ax::mojom::SortDirection>(attr.second);
if (ax::mojom::SortDirection::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
break;
case ui::AX_ATTR_NAME_FROM:
} break;
case ax::mojom::IntAttribute::kNameFrom:
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXNameFrom>(attr.second)));
ToString(static_cast<ax::mojom::NameFrom>(attr.second)));
break;
case ui::AX_ATTR_COLOR_VALUE:
case ui::AX_ATTR_BACKGROUND_COLOR:
case ui::AX_ATTR_COLOR:
case ax::mojom::IntAttribute::kColorValue:
case ax::mojom::IntAttribute::kBackgroundColor:
case ax::mojom::IntAttribute::kColor:
attributes->SetString(ToString(attr.first),
base::StringPrintf("0x%X", attr.second));
break;
case ui::AX_ATTR_DESCRIPTION_FROM:
case ax::mojom::IntAttribute::kDescriptionFrom:
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXDescriptionFrom>(attr.second)));
ToString(static_cast<ax::mojom::DescriptionFrom>(attr.second)));
break;
case ui::AX_ATTR_ARIA_CURRENT_STATE:
if (ui::AX_ARIA_CURRENT_STATE_NONE != attr.second) {
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXAriaCurrentState>(attr.second)));
case ax::mojom::IntAttribute::kAriaCurrentState: {
auto state = static_cast<ax::mojom::AriaCurrentState>(attr.second);
if (ax::mojom::AriaCurrentState::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
break;
case ui::AX_ATTR_TEXT_DIRECTION:
if (ui::AX_TEXT_DIRECTION_NONE != attr.second) {
attributes->SetString(
ToString(attr.first),
ToString(static_cast<ui::AXTextDirection>(attr.second)));
} break;
case ax::mojom::IntAttribute::kTextDirection: {
auto state = static_cast<ax::mojom::TextDirection>(attr.second);
if (ax::mojom::TextDirection::kNone != state) {
attributes->SetString(ToString(attr.first), ToString(state));
}
break;
case ui::AX_ATTR_TEXT_STYLE: {
auto text_style = static_cast<ui::AXTextStyle>(attr.second);
if (text_style == ui::AX_TEXT_STYLE_NONE)
} break;
case ax::mojom::IntAttribute::kTextStyle: {
auto text_style = static_cast<ax::mojom::TextStyle>(attr.second);
if (text_style == ax::mojom::TextStyle::kNone)
break;
static ui::AXTextStyle textStyleArr[] = {
ui::AX_TEXT_STYLE_BOLD, ui::AX_TEXT_STYLE_ITALIC,
ui::AX_TEXT_STYLE_UNDERLINE, ui::AX_TEXT_STYLE_LINE_THROUGH};
static ax::mojom::TextStyle textStyleArr[] = {
ax::mojom::TextStyle::kTextStyleBold,
ax::mojom::TextStyle::kTextStyleItalic,
ax::mojom::TextStyle::kTextStyleUnderline,
ax::mojom::TextStyle::kTextStyleLineThrough};
CefRefPtr<CefListValue> list = CefListValue::Create();
int index = 0;
// Iterate and find which states are set.
for (unsigned i = 0; i < arraysize(textStyleArr); i++) {
if (text_style & textStyleArr[i])
if (attr.second & static_cast<int>(textStyleArr[i]))
list->SetString(index++, ToString(textStyleArr[i]));
}
attributes->SetList(ToString(attr.first), list);
@ -194,43 +193,44 @@ struct PopulateAxNodeAttributes {
}
// Set Bool Attributes.
void operator()(const std::pair<ui::AXBoolAttribute, bool> attr) {
if (attr.first != ui::AX_BOOL_ATTRIBUTE_NONE)
void operator()(const std::pair<ax::mojom::BoolAttribute, bool> attr) {
if (attr.first != ax::mojom::BoolAttribute::kNone)
attributes->SetBool(ToString(attr.first), attr.second);
}
// Set String Attributes.
void operator()(const std::pair<ui::AXStringAttribute, std::string>& attr) {
if (attr.first != ui::AX_STRING_ATTRIBUTE_NONE)
void operator()(
const std::pair<ax::mojom::StringAttribute, std::string>& attr) {
if (attr.first != ax::mojom::StringAttribute::kNone)
attributes->SetString(ToString(attr.first), attr.second);
}
// Set Float attributes.
void operator()(const std::pair<ui::AXFloatAttribute, float>& attr) {
if (attr.first != ui::AX_FLOAT_ATTRIBUTE_NONE)
void operator()(const std::pair<ax::mojom::FloatAttribute, float>& attr) {
if (attr.first != ax::mojom::FloatAttribute::kNone)
attributes->SetDouble(ToString(attr.first), attr.second);
}
// Set Int list attributes.
void operator()(
const std::pair<ui::AXIntListAttribute, std::vector<int32_t>>& attr) {
if (attr.first != ui::AX_INT_LIST_ATTRIBUTE_NONE) {
void operator()(const std::pair<ax::mojom::IntListAttribute,
std::vector<int32_t>>& attr) {
if (attr.first != ax::mojom::IntListAttribute::kNone) {
CefRefPtr<CefListValue> list;
if (ui::AX_ATTR_MARKER_TYPES == attr.first) {
if (ax::mojom::IntListAttribute::kMarkerTypes == attr.first) {
list = CefListValue::Create();
int index = 0;
for (size_t i = 0; i < attr.second.size(); ++i) {
auto type = static_cast<ui::AXMarkerType>(attr.second[i]);
auto type = static_cast<ax::mojom::MarkerType>(attr.second[i]);
if (type == ui::AX_MARKER_TYPE_NONE)
if (type == ax::mojom::MarkerType::kNone)
continue;
static ui::AXMarkerType marktypeArr[] = {
ui::AX_MARKER_TYPE_SPELLING, ui::AX_MARKER_TYPE_GRAMMAR,
ui::AX_MARKER_TYPE_TEXT_MATCH};
static ax::mojom::MarkerType marktypeArr[] = {
ax::mojom::MarkerType::kSpelling, ax::mojom::MarkerType::kGrammar,
ax::mojom::MarkerType::kTextMatch};
// Iterate and find which markers are set.
for (unsigned j = 0; j < arraysize(marktypeArr); j++) {
if (type & marktypeArr[j])
if (attr.second[i] & static_cast<int>(marktypeArr[j]))
list->SetString(index++, ToString(marktypeArr[j]));
}
}
@ -267,9 +267,10 @@ CefRefPtr<CefDictionaryValue> ToCefValue(const ui::AXNodeData& node) {
CefRefPtr<CefListValue> actions_strings;
size_t actions_idx = 0;
for (int action_index = ui::AX_ACTION_NONE + 1;
action_index <= ui::AX_ACTION_LAST; ++action_index) {
auto action = static_cast<ui::AXAction>(action_index);
for (int action_index = static_cast<int>(ax::mojom::Action::kNone) + 1;
action_index <= static_cast<int>(ax::mojom::Action::kLast);
++action_index) {
auto action = static_cast<ax::mojom::Action>(action_index);
if (node.HasAction(action)) {
if (!actions_strings)
actions_strings = CefListValue::Create();
@ -383,10 +384,10 @@ CefRefPtr<CefDictionaryValue> ToCefValue(
if (eventData.ax_tree_id != -1)
value->SetInt("ax_tree_id", eventData.ax_tree_id);
if (eventData.event_type != ui::AX_EVENT_NONE)
if (eventData.event_type != ax::mojom::Event::kNone)
value->SetString("event_type", ToString(eventData.event_type));
if (eventData.event_from != ui::AX_EVENT_FROM_NONE)
if (eventData.event_from != ax::mojom::EventFrom::kNone)
value->SetString("event_from", ToString(eventData.event_from));
value->SetDictionary("update", ToCefValue(eventData.update));

View File

@ -18,6 +18,7 @@
#include "base/command_line.h"
#include "base/memory/ptr_util.h"
#include "cc/base/switches.h"
#include "components/viz/common/features.h"
#include "components/viz/common/frame_sinks/copy_output_request.h"
#include "components/viz/common/frame_sinks/delay_based_time_source.h"
#include "components/viz/common/gl_helper.h"
@ -28,14 +29,15 @@
#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_view_frame_subscriber.h"
#include "content/common/input_messages.h"
#include "content/common/view_messages.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/content_switches.h"
#include "media/base/video_frame.h"
#include "ui/compositor/compositor_vsync_manager.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/size_conversions.h"
@ -236,10 +238,16 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
local_surface_id_ = local_surface_id_allocator_.GenerateId();
// Surface synchronization is not supported with OSR.
DCHECK(!features::IsSurfaceSynchronizationEnabled());
#if !defined(OS_MACOSX)
delegated_frame_host_ = base::MakeUnique<content::DelegatedFrameHost>(
// Matching the attributes from BrowserCompositorMac.
delegated_frame_host_ = std::make_unique<content::DelegatedFrameHost>(
AllocateFrameSinkId(is_guest_view_hack), this,
false /* enable_surface_synchronization */, false /* enable_viz */);
features::IsSurfaceSynchronizationEnabled(),
base::FeatureList::IsEnabled(features::kVizDisplayCompositor),
true /* should_register_frame_sink_id */);
root_layer_.reset(new ui::Layer(ui::LAYER_SOLID_COLOR));
#endif
@ -256,11 +264,12 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
content::ImageTransportFactory::GetInstance();
ui::ContextFactoryPrivate* context_factory_private =
factory->GetContextFactoryPrivate();
// Matching the attributes from RecyclableCompositorMac.
compositor_.reset(
new ui::Compositor(context_factory_private->AllocateFrameSinkId(),
content::GetContextFactory(), context_factory_private,
base::ThreadTaskRunnerHandle::Get(),
false /* enable_surface_synchronization */,
features::IsSurfaceSynchronizationEnabled(),
false /* enable_pixel_canvas */));
compositor_->SetAcceleratedWidget(compositor_widget_);
compositor_->SetDelegate(this);
@ -359,9 +368,12 @@ void CefRenderWidgetHostViewOSR::Show() {
browser_compositor_->SetRenderWidgetHostIsHidden(false);
#else
delegated_frame_host_->SetCompositor(compositor_.get());
delegated_frame_host_->WasShown(ui::LatencyInfo());
delegated_frame_host_->WasShown(
GetLocalSurfaceId(), GetRootLayer()->bounds().size(), ui::LatencyInfo());
#endif
// Note that |render_widget_host_| will retrieve size parameters from the
// DelegatedFrameHost, so it must have WasShown called after.
if (render_widget_host_)
render_widget_host_->WasShown(ui::LatencyInfo());
}
@ -658,38 +670,49 @@ gfx::Size CefRenderWidgetHostViewOSR::GetPhysicalBackingSize() const {
}
void CefRenderWidgetHostViewOSR::CopyFromSurface(
const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const content::ReadbackRequestCallback& callback,
const SkColorType color_type) {
GetDelegatedFrameHost()->CopyFromCompositingSurface(src_subrect, dst_size,
callback, color_type);
const gfx::Rect& src_rect,
const gfx::Size& output_size,
base::OnceCallback<void(const SkBitmap&)> callback) {
GetDelegatedFrameHost()->CopyFromCompositingSurface(src_rect, output_size,
std::move(callback));
}
void CefRenderWidgetHostViewOSR::CopyFromSurfaceToVideoFrame(
const gfx::Rect& src_subrect,
scoped_refptr<media::VideoFrame> target,
const base::Callback<void(const gfx::Rect&, bool)>& callback) {
GetDelegatedFrameHost()->CopyFromCompositingSurfaceToVideoFrame(
src_subrect, target, callback);
}
void CefRenderWidgetHostViewOSR::GetScreenInfo(
content::ScreenInfo* results) const {
if (!browser_impl_.get())
return;
void CefRenderWidgetHostViewOSR::BeginFrameSubscription(
std::unique_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber) {
GetDelegatedFrameHost()->BeginFrameSubscription(std::move(subscriber));
}
CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(),
CefRect());
void CefRenderWidgetHostViewOSR::EndFrameSubscription() {
GetDelegatedFrameHost()->EndFrameSubscription();
}
bool CefRenderWidgetHostViewOSR::HasAcceleratedSurface(
const gfx::Size& desired_size) {
// CEF doesn't use GetBackingStore for accelerated pages, so it doesn't
// matter what is returned here as GetBackingStore is the only caller of this
// method.
CefRefPtr<CefRenderHandler> handler =
browser_impl_->client()->GetRenderHandler();
if (handler.get() &&
(!handler->GetScreenInfo(browser_impl_.get(), screen_info) ||
screen_info.rect.width == 0 || screen_info.rect.height == 0 ||
screen_info.available_rect.width == 0 ||
screen_info.available_rect.height == 0)) {
// If a screen rectangle was not provided, try using the view rectangle
// instead. Otherwise, popup views may be drawn incorrectly, or not at all.
CefRect screenRect;
if (!handler->GetViewRect(browser_impl_.get(), screenRect)) {
NOTREACHED();
return false;
screenRect = CefRect();
}
if (screen_info.rect.width == 0 && screen_info.rect.height == 0)
screen_info.rect = screenRect;
if (screen_info.available_rect.width == 0 &&
screen_info.available_rect.height == 0)
screen_info.available_rect = screenRect;
}
*results = ScreenInfoFrom(screen_info);
}
gfx::Vector2d CefRenderWidgetHostViewOSR::GetOffsetFromRootSurface() {
return gfx::Vector2d();
}
gfx::Rect CefRenderWidgetHostViewOSR::GetBoundsInRootWindow() {
@ -844,6 +867,16 @@ bool CefRenderWidgetHostViewOSR::TransformPointToCoordSpaceForView(
point, target_view, transformed_point);
}
void CefRenderWidgetHostViewOSR::DidNavigate() {
#if defined(OS_MACOSX)
browser_compositor_->DidNavigate();
#else
ResizeRootLayer();
if (delegated_frame_host_)
delegated_frame_host_->DidNavigate();
#endif
}
std::unique_ptr<viz::SoftwareOutputDevice>
CefRenderWidgetHostViewOSR::CreateSoftwareOutputDevice(
ui::Compositor* compositor) {
@ -878,11 +911,6 @@ SkColor CefRenderWidgetHostViewOSR::DelegatedFrameHostGetGutterColor() const {
return background_color_;
}
gfx::Size CefRenderWidgetHostViewOSR::DelegatedFrameHostDesiredSizeInDIP()
const {
return GetRootLayer()->bounds().size();
}
bool CefRenderWidgetHostViewOSR::DelegatedFrameCanCreateResizeLock() const {
return !render_widget_host_->auto_resize_enabled();
}
@ -892,13 +920,16 @@ CefRenderWidgetHostViewOSR::DelegatedFrameHostCreateResizeLock() {
HoldResize();
const gfx::Size& desired_size = GetRootLayer()->bounds().size();
return base::MakeUnique<content::CompositorResizeLock>(this, desired_size);
return std::make_unique<content::CompositorResizeLock>(this, desired_size);
}
viz::LocalSurfaceId CefRenderWidgetHostViewOSR::GetLocalSurfaceId() const {
return local_surface_id_;
}
void CefRenderWidgetHostViewOSR::OnFirstSurfaceActivation(
const viz::SurfaceInfo& surface_info) {}
void CefRenderWidgetHostViewOSR::OnBeginFrame(base::TimeTicks frame_time) {
// TODO(cef): Maybe we can use this method in combination with
// OnSetNeedsBeginFrames() instead of using CefBeginFrameTimer.
@ -913,6 +944,10 @@ void CefRenderWidgetHostViewOSR::OnFrameTokenChanged(uint32_t frame_token) {
render_widget_host_->DidProcessFrame(frame_token);
}
void CefRenderWidgetHostViewOSR::DidReceiveFirstFrameAfterNavigation() {
render_widget_host_->DidReceiveFirstFrameAfterNavigation();
}
std::unique_ptr<ui::CompositorLock>
CefRenderWidgetHostViewOSR::GetCompositorLock(
ui::CompositorLockClient* client) {
@ -946,42 +981,6 @@ void CefRenderWidgetHostViewOSR::WasResized() {
}
ResizeRootLayer();
if (render_widget_host_)
render_widget_host_->WasResized();
GetDelegatedFrameHost()->WasResized();
}
void CefRenderWidgetHostViewOSR::GetScreenInfo(content::ScreenInfo* results) {
if (!browser_impl_.get())
return;
CefScreenInfo screen_info(kDefaultScaleFactor, 0, 0, false, CefRect(),
CefRect());
CefRefPtr<CefRenderHandler> handler =
browser_impl_->client()->GetRenderHandler();
if (handler.get() &&
(!handler->GetScreenInfo(browser_impl_.get(), screen_info) ||
screen_info.rect.width == 0 || screen_info.rect.height == 0 ||
screen_info.available_rect.width == 0 ||
screen_info.available_rect.height == 0)) {
// If a screen rectangle was not provided, try using the view rectangle
// instead. Otherwise, popup views may be drawn incorrectly, or not at all.
CefRect screenRect;
if (!handler->GetViewRect(browser_impl_.get(), screenRect)) {
NOTREACHED();
screenRect = CefRect();
}
if (screen_info.rect.width == 0 && screen_info.rect.height == 0)
screen_info.rect = screenRect;
if (screen_info.available_rect.width == 0 &&
screen_info.available_rect.height == 0)
screen_info.available_rect = screenRect;
}
*results = ScreenInfoFrom(screen_info);
}
void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
@ -991,7 +990,22 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
// TODO(OSR): Update the backing store.
if (render_widget_host_->delegate())
render_widget_host_->delegate()->SendScreenRects();
else
render_widget_host_->SendScreenRects();
#if defined(OS_MACOSX)
// RenderWidgetHostImpl will query BrowserCompositorMac for the dimensions
// to send to the renderer, so it is required that BrowserCompositorMac be
// updated first. Only notify RenderWidgetHostImpl of the update if any
// properties it will query have changed.
if (browser_compositor_->UpdateNSViewAndDisplay())
render_widget_host_->NotifyScreenInfoChanged();
#else
render_widget_host_->NotifyScreenInfoChanged();
#endif
// We might want to change the cursor scale factor here as well - see the
// cache for the current_cursor_, as passed by UpdateCursor from the renderer
// in the rwhv_aura (current_cursor_.SetScaleFactor)
@ -1317,6 +1331,19 @@ void CefRenderWidgetHostViewOSR::ResizeRootLayer() {
GetCompositor()->SetScaleAndSize(current_device_scale_factor_, size_in_pixels,
local_surface_id_);
PlatformResizeCompositorWidget(size_in_pixels);
#if defined(OS_MACOSX)
bool resized = browser_compositor_->UpdateNSViewAndDisplay();
#else
bool resized = true;
GetDelegatedFrameHost()->WasResized(local_surface_id_, size,
cc::DeadlinePolicy::UseDefaultDeadline());
#endif
// Note that |render_widget_host_| will retrieve resize parameters from the
// DelegatedFrameHost, so it must have WasResized called after.
if (resized && render_widget_host_)
render_widget_host_->WasResized();
}
void CefRenderWidgetHostViewOSR::OnBeginFrameTimerTick() {
@ -1416,10 +1443,9 @@ void CefRenderWidgetHostViewOSR::RemoveGuestHostView(
void CefRenderWidgetHostViewOSR::RegisterGuestViewFrameSwappedCallback(
content::RenderWidgetHostViewGuest* guest_host_view) {
guest_host_view->RegisterFrameSwappedCallback(
base::MakeUnique<base::Closure>(base::Bind(
guest_host_view->RegisterFrameSwappedCallback(base::BindOnce(
&CefRenderWidgetHostViewOSR::OnGuestViewFrameSwapped,
weak_ptr_factory_.GetWeakPtr(), base::Unretained(guest_host_view))));
weak_ptr_factory_.GetWeakPtr(), base::Unretained(guest_host_view)));
guest_host_view->set_current_device_scale_factor(
current_device_scale_factor_);
}

View File

@ -124,6 +124,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
void SpeakSelection() override;
bool IsSpeaking() const override;
void StopSpeaking() override;
bool ShouldContinueToPauseForFrame() override;
#endif // defined(OS_MACOSX)
// RenderWidgetHostViewBase implementation.
@ -150,19 +151,12 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
gfx::Size GetRequestedRendererSize() const override;
gfx::Size GetPhysicalBackingSize() const override;
void CopyFromSurface(const gfx::Rect& src_subrect,
const gfx::Size& dst_size,
const content::ReadbackRequestCallback& callback,
const SkColorType color_type) override;
void CopyFromSurfaceToVideoFrame(
const gfx::Rect& src_subrect,
scoped_refptr<media::VideoFrame> target,
const base::Callback<void(const gfx::Rect&, bool)>& callback) override;
void BeginFrameSubscription(
std::unique_ptr<content::RenderWidgetHostViewFrameSubscriber> subscriber)
override;
void EndFrameSubscription() override;
bool HasAcceleratedSurface(const gfx::Size& desired_size) override;
void CopyFromSurface(
const gfx::Rect& src_rect,
const gfx::Size& output_size,
base::OnceCallback<void(const SkBitmap&)> callback) override;
void GetScreenInfo(content::ScreenInfo* results) const override;
gfx::Vector2d GetOffsetFromRootSurface() override;
gfx::Rect GetBoundsInRootWindow() override;
content::RenderWidgetHostImpl* GetRenderWidgetHostImpl() const override;
viz::SurfaceId GetCurrentSurfaceId() const override;
@ -188,6 +182,7 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
const gfx::PointF& point,
RenderWidgetHostViewBase* target_view,
gfx::PointF* transformed_point) override;
void DidNavigate() override;
// ui::CompositorDelegate implementation.
std::unique_ptr<viz::SoftwareOutputDevice> CreateSoftwareOutputDevice(
@ -198,14 +193,15 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
ui::Layer* DelegatedFrameHostGetLayer() const override;
bool DelegatedFrameHostIsVisible() const override;
SkColor DelegatedFrameHostGetGutterColor() const override;
gfx::Size DelegatedFrameHostDesiredSizeInDIP() const override;
bool DelegatedFrameCanCreateResizeLock() const override;
std::unique_ptr<content::CompositorResizeLock>
DelegatedFrameHostCreateResizeLock() override;
viz::LocalSurfaceId GetLocalSurfaceId() const override;
void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override;
void OnBeginFrame(base::TimeTicks frame_time) override;
bool IsAutoResizeEnabled() const override;
void OnFrameTokenChanged(uint32_t frame_token) override;
void DidReceiveFirstFrameAfterNavigation() override;
// CompositorResizeLockClient implementation.
std::unique_ptr<ui::CompositorLock> GetCompositorLock(
@ -216,7 +212,6 @@ class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
bool InstallTransparency();
void WasResized();
void GetScreenInfo(content::ScreenInfo* results);
void OnScreenInfoChanged();
void Invalidate(CefBrowserHost::PaintElementType type);
void SendKeyEvent(const content::NativeWebKeyboardEvent& event);

View File

@ -60,6 +60,10 @@ class MacHelper : public content::BrowserCompositorMacClient,
void AcceleratedWidgetSwapCompleted() override {}
void DidReceiveFirstFrameAfterNavigation() override {
view_->render_widget_host()->DidReceiveFirstFrameAfterNavigation();
}
private:
// Guaranteed to outlive this object.
CefRenderWidgetHostViewOSR* view_;
@ -83,6 +87,10 @@ bool CefRenderWidgetHostViewOSR::IsSpeaking() const {
void CefRenderWidgetHostViewOSR::StopSpeaking() {}
bool CefRenderWidgetHostViewOSR::ShouldContinueToPauseForFrame() {
return browser_compositor_->ShouldContinueToPauseForFrame();
}
ui::Compositor* CefRenderWidgetHostViewOSR::GetCompositor() const {
return browser_compositor_->GetCompositor();
}

View File

@ -41,14 +41,6 @@ gfx::NativeWindow CefWebContentsViewOSR::GetTopLevelNativeWindow() const {
return gfx::NativeWindow();
}
void CefWebContentsViewOSR::GetScreenInfo(content::ScreenInfo* results) const {
CefRenderWidgetHostViewOSR* view = GetView();
if (view)
view->GetScreenInfo(results);
else
WebContentsView::GetDefaultScreenInfo(results);
}
void CefWebContentsViewOSR::GetContainerBounds(gfx::Rect* out) const {
*out = GetViewBounds();
}

View File

@ -33,7 +33,6 @@ class CefWebContentsViewOSR : public content::WebContentsView,
gfx::NativeView GetNativeView() const override;
gfx::NativeView GetContentNativeView() const override;
gfx::NativeWindow GetTopLevelNativeWindow() const override;
void GetScreenInfo(content::ScreenInfo* screen_info) const override;
void GetContainerBounds(gfx::Rect* out) const override;
void SizeContents(const gfx::Size& size) override;
void Focus() override;

View File

@ -131,15 +131,15 @@ void CefPrefStore::ReportValueChanged(const std::string& key, uint32_t flags) {
}
void CefPrefStore::SetString(const std::string& key, const std::string& value) {
SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
SetValue(key, std::make_unique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
}
void CefPrefStore::SetInteger(const std::string& key, int value) {
SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
SetValue(key, std::make_unique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
}
void CefPrefStore::SetBoolean(const std::string& key, bool value) {
SetValue(key, base::MakeUnique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
SetValue(key, std::make_unique<base::Value>(value), DEFAULT_PREF_WRITE_FLAGS);
}
bool CefPrefStore::GetString(const std::string& key, std::string* value) const {

View File

@ -183,16 +183,16 @@ bool CefPrintDialogLinux::UpdateSettings(printing::PrintSettings* settings) {
void CefPrintDialogLinux::ShowDialog(
gfx::NativeView parent_view,
bool has_selection,
const PrintingContextLinux::PrintSettingsCallback& callback) {
PrintingContextLinux::PrintSettingsCallback callback) {
CEF_REQUIRE_UIT();
SetHandler();
if (!handler_.get()) {
callback.Run(PrintingContextLinux::CANCEL);
std::move(callback).Run(PrintingContextLinux::CANCEL);
return;
}
callback_ = callback;
callback_ = std::move(callback);
CefRefPtr<CefPrintDialogCallbackImpl> callback_impl(
new CefPrintDialogCallbackImpl(this));
@ -310,18 +310,15 @@ void CefPrintDialogLinux::OnPrintContinue(
CefValueController::AutoLock lock_scope(impl->controller());
context_->InitWithSettings(impl->print_settings());
}
callback_.Run(PrintingContextLinux::OK);
callback_.Reset();
std::move(callback_).Run(PrintingContextLinux::OK);
}
void CefPrintDialogLinux::OnPrintCancel() {
callback_.Run(PrintingContextLinux::CANCEL);
callback_.Reset();
std::move(callback_).Run(PrintingContextLinux::CANCEL);
}
void CefPrintDialogLinux::OnJobCompleted() {
content::BrowserThread::PostTask(
content::BrowserThread::FILE, FROM_HERE,
CEF_POST_BACKGROUND_TASK(
base::Bind(base::IgnoreResult(&base::DeleteFile), path_to_pdf_, false));
// Printing finished. Matches AddRef() in PrintDocument();

View File

@ -40,13 +40,13 @@ class CefPrintDialogLinux : public printing::PrintDialogGtkInterface,
// Notify the client when printing has started.
static void OnPrintStart(int render_process_id, int render_routing_id);
// printing::CefPrintDialogLinuxInterface implementation.
// PrintDialogGtkInterface implementation.
void UseDefaultSettings() override;
bool UpdateSettings(printing::PrintSettings* settings) override;
void ShowDialog(
gfx::NativeView parent_view,
bool has_selection,
const PrintingContextLinux::PrintSettingsCallback& callback) override;
PrintingContextLinux::PrintSettingsCallback callback) override;
void PrintDocument(const printing::MetafilePlayer& metafile,
const base::string16& document_name) override;
void AddRefToDialog() override;

View File

@ -22,6 +22,8 @@
#include "content/public/browser/web_contents.h"
#include "printing/pdf_metafile_skia.h"
#include "libcef/browser/thread_util.h"
using content::BrowserThread;
DEFINE_WEB_CONTENTS_USER_DATA_KEY(printing::CefPrintViewManager);
@ -130,7 +132,7 @@ scoped_refptr<base::RefCountedBytes> GetDataFromHandle(
base::SharedMemoryHandle handle,
uint32_t data_size) {
std::unique_ptr<base::SharedMemory> shared_buf =
base::MakeUnique<base::SharedMemory>(handle, true);
std::make_unique<base::SharedMemory>(handle, true);
if (!shared_buf->Map(data_size)) {
NOTREACHED();
@ -146,10 +148,10 @@ scoped_refptr<base::RefCountedBytes> GetDataFromHandle(
void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
const base::FilePath& path,
const CefPrintViewManager::PdfPrintCallback& callback) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
CEF_REQUIRE_BLOCKING();
DCHECK_GT(data->size(), 0U);
PdfMetafileSkia metafile(SkiaDocumentType::PDF);
PdfMetafileSkia metafile;
metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
base::File file(path,
@ -265,8 +267,8 @@ void CefPrintViewManager::OnMetafileReadyForPrinting(
if (!pdf_print_state_)
return;
scoped_refptr<base::RefCountedBytes> data_bytes =
GetDataFromHandle(params.metafile_data_handle, params.data_size);
scoped_refptr<base::RefCountedBytes> data_bytes = GetDataFromHandle(
params.content.metafile_data_handle, params.content.data_size);
if (!data_bytes || !data_bytes->size()) {
TerminatePdfPrintJob();
return;
@ -279,8 +281,7 @@ void CefPrintViewManager::OnMetafileReadyForPrinting(
pdf_print_state_.reset();
// Save the PDF file to disk and then execute the callback.
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
CEF_POST_USER_VISIBLE_TASK(
base::Bind(&SavePdfFile, data_bytes, output_path, print_callback));
}

View File

@ -32,6 +32,7 @@
#include "components/printing/browser/print_composite_client.h"
#include "components/printing/browser/print_manager_utils.h"
#include "components/printing/common/print_messages.h"
#include "components/printing/service/public/cpp/pdf_service_mojo_types.h"
#include "components/printing/service/public/cpp/pdf_service_mojo_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_details.h"
@ -86,7 +87,7 @@ bool CefPrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
SetPrintingRFH(rfh);
int32_t id = rfh->GetRoutingID();
return PrintNowInternal(rfh, base::MakeUnique<PrintMsg_PrintPages>(id));
return PrintNowInternal(rfh, std::make_unique<PrintMsg_PrintPages>(id));
}
#endif
@ -122,7 +123,7 @@ void CefPrintViewManagerBase::PrintDocument(
}
#else
std::unique_ptr<PdfMetafileSkia> metafile =
std::make_unique<PdfMetafileSkia>(SkiaDocumentType::PDF);
std::make_unique<PdfMetafileSkia>();
CHECK(metafile->InitFromData(print_data->front(), print_data->size()));
// Update the rendered document. It will send notifications to the listener.
@ -195,12 +196,14 @@ void CefPrintViewManagerBase::OnComposePdfDone(
}
void CefPrintViewManagerBase::OnDidPrintDocument(
content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPrintDocument_Params& params) {
PrintedDocument* document = GetDocument(params.document_cookie);
if (!document)
return;
if (!base::SharedMemory::IsHandleValid(params.metafile_data_handle)) {
const PrintHostMsg_DidPrintContent_Params& content = params.content;
if (!base::SharedMemory::IsHandleValid(content.metafile_data_handle)) {
NOTREACHED() << "invalid memory handle";
web_contents()->Stop();
return;
@ -208,17 +211,18 @@ void CefPrintViewManagerBase::OnDidPrintDocument(
auto* client = PrintCompositeClient::FromWebContents(web_contents());
if (IsOopifEnabled() && !client->for_preview() &&
!document->settings().is_modifiable()) {
client->DoComposite(
params.metafile_data_handle, params.data_size,
document->settings().is_modifiable()) {
client->DoCompositeDocumentToPdf(
params.document_cookie, render_frame_host, content.metafile_data_handle,
content.data_size, content.subframe_content_info,
base::BindOnce(&CefPrintViewManagerBase::OnComposePdfDone,
weak_ptr_factory_.GetWeakPtr(), params));
return;
}
std::unique_ptr<base::SharedMemory> shared_buf =
std::make_unique<base::SharedMemory>(params.metafile_data_handle, true);
if (!shared_buf->Map(params.data_size)) {
auto shared_buf =
std::make_unique<base::SharedMemory>(content.metafile_data_handle, true);
if (!shared_buf->Map(content.data_size)) {
NOTREACHED() << "couldn't map";
web_contents()->Stop();
return;
@ -226,7 +230,7 @@ void CefPrintViewManagerBase::OnDidPrintDocument(
scoped_refptr<base::RefCountedBytes> bytes =
base::MakeRefCounted<base::RefCountedBytes>(
reinterpret_cast<const unsigned char*>(shared_buf->memory()),
params.data_size);
content.data_size);
PrintDocument(document, bytes, params.page_size, params.content_area,
params.physical_offsets);
}
@ -275,8 +279,16 @@ bool CefPrintViewManagerBase::OnMessageReceived(
const IPC::Message& message,
content::RenderFrameHost* render_frame_host) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(CefPrintViewManagerBase, message)
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefPrintViewManagerBase, message,
render_frame_host)
IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrintDocument, OnDidPrintDocument)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
if (handled)
return true;
handled = true;
IPC_BEGIN_MESSAGE_MAP(CefPrintViewManagerBase, message)
IPC_MESSAGE_HANDLER(PrintHostMsg_ShowInvalidPrinterSettingsError,
OnShowInvalidPrinterSettingsError)
IPC_MESSAGE_UNHANDLED(handled = false)
@ -461,7 +473,7 @@ void CefPrintViewManagerBase::ReleasePrintJob() {
return;
if (rfh) {
auto msg = base::MakeUnique<PrintMsg_PrintingDone>(rfh->GetRoutingID(),
auto msg = std::make_unique<PrintMsg_PrintingDone>(rfh->GetRoutingID(),
printing_succeeded_);
rfh->Send(msg.release());
}

View File

@ -87,7 +87,8 @@ class CefPrintViewManagerBase : public content::NotificationObserver,
void OnDidGetPrintedPagesCount(int cookie, int number_pages) override;
void OnPrintingFailed(int cookie) override;
void OnShowInvalidPrinterSettingsError();
void OnDidPrintDocument(const PrintHostMsg_DidPrintDocument_Params& params);
void OnDidPrintDocument(content::RenderFrameHost* render_frame_host,
const PrintHostMsg_DidPrintDocument_Params& params);
// IPC message handlers for service.
void OnComposePdfDone(const PrintHostMsg_DidPrintDocument_Params& params,

View File

@ -215,7 +215,7 @@ void CefPrintingMessageFilter::OnScriptedPrintReply(
}
PrintHostMsg_ScriptedPrint::WriteReplyParams(reply_msg, params);
Send(reply_msg);
if (params.params.dpi && params.params.document_cookie) {
if (!params.params.dpi.IsEmpty() && params.params.document_cookie) {
#if defined(OS_ANDROID)
int file_descriptor;
const base::string16& device_name = printer_query->settings().device_name();

View File

@ -93,7 +93,6 @@ bool CefResourceDispatcherHostDelegate::HandleExternalProtocol(
// ChromeResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream.
bool CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
net::URLRequest* request,
const base::FilePath& plugin_path,
const std::string& mime_type,
GURL* origin,
std::string* payload) {
@ -125,30 +124,15 @@ bool CefResourceDispatcherHostDelegate::ShouldInterceptResourceAsStream(
if (!handler)
continue;
// If a plugin path is provided then a stream is being intercepted for the
// mimeHandlerPrivate API. Otherwise a stream is being intercepted for the
// streamsPrivate API.
if (!plugin_path.empty()) {
if (handler->HasPlugin() && plugin_path == handler->GetPluginPath()) {
if (handler->CanHandleMIMEType(mime_type)) {
StreamTargetInfo target_info;
*origin =
extensions::Extension::GetBaseURLFromExtensionId(extension_id);
*origin = extensions::Extension::GetBaseURLFromExtensionId(extension_id);
target_info.extension_id = extension_id;
target_info.view_id = base::GenerateGUID();
*payload = target_info.view_id;
stream_target_info_[request] = target_info;
return true;
}
} else {
if (!handler->HasPlugin() && handler->CanHandleMIMEType(mime_type)) {
StreamTargetInfo target_info;
*origin =
extensions::Extension::GetBaseURLFromExtensionId(extension_id);
target_info.extension_id = extension_id;
stream_target_info_[request] = target_info;
return true;
}
}
}
return false;
@ -195,13 +179,6 @@ void CefResourceDispatcherHostDelegate::OnRequestRedirected(
}
}
std::unique_ptr<net::ClientCertStore>
CefResourceDispatcherHostDelegate::CreateClientCertStore(
content::ResourceContext* resource_context) {
return static_cast<CefResourceContext*>(resource_context)
->CreateClientCertStore();
}
void CefResourceDispatcherHostDelegate::HandleExternalProtocolOnUIThread(
const GURL& url,
const content::ResourceRequestInfo::WebContentsGetter&

View File

@ -24,7 +24,6 @@ class CefResourceDispatcherHostDelegate
bool HandleExternalProtocol(const GURL& url,
content::ResourceRequestInfo* info) override;
bool ShouldInterceptResourceAsStream(net::URLRequest* request,
const base::FilePath& plugin_path,
const std::string& mime_type,
GURL* origin,
std::string* payload) override;
@ -34,8 +33,6 @@ class CefResourceDispatcherHostDelegate
net::URLRequest* request,
content::ResourceContext* resource_context,
network::ResourceResponse* response) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(
content::ResourceContext* resource_context) override;
private:
void HandleExternalProtocolOnUIThread(

View File

@ -12,7 +12,6 @@
#include "base/format_macros.h"
#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread.h"
#include "net/base/net_errors.h"
#include "net/http/http_request_headers.h"
@ -20,6 +19,7 @@
#include "net/server/http_server_response_info.h"
#include "net/socket/server_socket.h"
#include "net/socket/tcp_server_socket.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#define CEF_CURRENTLY_ON_HT() CurrentlyOnHandlerThread()
#define CEF_REQUIRE_HT() DCHECK(CEF_CURRENTLY_ON_HT())
@ -237,7 +237,7 @@ void CefServerImpl::SendHttp404Response(int connection_id) {
return;
}
server_->Send404(connection_id);
server_->Send404(connection_id, NO_TRAFFIC_ANNOTATION_YET);
server_->Close(connection_id);
}
@ -262,7 +262,7 @@ void CefServerImpl::SendHttp500Response(int connection_id,
return;
}
server_->Send500(connection_id, error_message);
server_->Send500(connection_id, error_message, NO_TRAFFIC_ANNOTATION_YET);
server_->Close(connection_id);
}
@ -305,7 +305,7 @@ void CefServerImpl::SendHttpResponse(int connection_id,
base::StringPrintf("%" PRIuS, static_cast<size_t>(content_length)));
}
server_->SendResponse(connection_id, response);
server_->SendResponse(connection_id, response, NO_TRAFFIC_ANNOTATION_YET);
if (content_length == 0) {
server_->Close(connection_id);
}
@ -366,7 +366,8 @@ void CefServerImpl::ContinueWebSocketRequest(
info->is_websocket_pending = false;
if (allow) {
server_->AcceptWebSocket(connection_id, request_info);
server_->AcceptWebSocket(connection_id, request_info,
NO_TRAFFIC_ANNOTATION_YET);
handler_->OnWebSocketConnected(this, connection_id);
} else {
server_->Close(connection_id);
@ -397,7 +398,8 @@ void CefServerImpl::SendHttp200ResponseInternal(
return;
}
server_->Send200(connection_id, *data, content_type);
server_->Send200(connection_id, *data, content_type,
NO_TRAFFIC_ANNOTATION_YET);
server_->Close(connection_id);
}
@ -416,7 +418,7 @@ void CefServerImpl::SendRawDataInternal(int connection_id,
if (!GetConnectionInfo(connection_id))
return;
server_->SendRaw(connection_id, *data);
server_->SendRaw(connection_id, *data, NO_TRAFFIC_ANNOTATION_YET);
}
void CefServerImpl::SendWebSocketMessageInternal(
@ -442,7 +444,7 @@ void CefServerImpl::SendWebSocketMessageInternal(
return;
}
server_->SendOverWebSocket(connection_id, *data);
server_->SendOverWebSocket(connection_id, *data, NO_TRAFFIC_ANNOTATION_YET);
}
void CefServerImpl::OnConnect(int connection_id) {
@ -595,8 +597,7 @@ void CefServerImpl::ShutdownOnUIThread() {
if (thread_) {
// Stop the handler thread as a background task so the UI thread isn't
// blocked.
base::PostTaskWithTraits(
FROM_HERE, {base::MayBlock(), base::TaskPriority::BACKGROUND},
CEF_POST_BACKGROUND_TASK(
BindOnce([](std::unique_ptr<base::Thread>) {}, std::move(thread_)));
// Release the reference that was added in StartupOnUIThread().

View File

@ -30,7 +30,7 @@ network::mojom::NetworkContext* CefStoragePartitionProxy::GetNetworkContext() {
return parent_->GetNetworkContext();
}
network::mojom::URLLoaderFactory*
scoped_refptr<content::SharedURLLoaderFactory>
CefStoragePartitionProxy::GetURLLoaderFactoryForBrowserProcess() {
return parent_->GetURLLoaderFactoryForBrowserProcess();
}
@ -154,6 +154,10 @@ void CefStoragePartitionProxy::FlushNetworkInterfaceForTesting() {
parent_->FlushNetworkInterfaceForTesting();
}
void CefStoragePartitionProxy::WaitForDeletionTasksForTesting() {
parent_->WaitForDeletionTasksForTesting();
}
content::BackgroundFetchContext*
CefStoragePartitionProxy::GetBackgroundFetchContext() {
return parent_->GetBackgroundFetchContext();
@ -188,6 +192,11 @@ content::BlobRegistryWrapper* CefStoragePartitionProxy::GetBlobRegistry() {
return parent_->GetBlobRegistry();
}
content::PrefetchURLLoaderService*
CefStoragePartitionProxy::GetPrefetchURLLoaderService() {
return parent_->GetPrefetchURLLoaderService();
}
content::URLLoaderFactoryGetter*
CefStoragePartitionProxy::url_loader_factory_getter() {
return parent_->url_loader_factory_getter();

View File

@ -25,8 +25,8 @@ class CefStoragePartitionProxy : public content::StoragePartition {
net::URLRequestContextGetter* GetURLRequestContext() override;
net::URLRequestContextGetter* GetMediaURLRequestContext() override;
network::mojom::NetworkContext* GetNetworkContext() override;
network::mojom::URLLoaderFactory* GetURLLoaderFactoryForBrowserProcess()
override;
scoped_refptr<content::SharedURLLoaderFactory>
GetURLLoaderFactoryForBrowserProcess() override;
network::mojom::CookieManager* GetCookieManagerForBrowserProcess() override;
storage::QuotaManager* GetQuotaManager() override;
content::AppCacheService* GetAppCacheService() override;
@ -68,6 +68,7 @@ class CefStoragePartitionProxy : public content::StoragePartition {
void Flush() override;
void ClearBluetoothAllowedDevicesMapForTesting() override;
void FlushNetworkInterfaceForTesting() override;
void WaitForDeletionTasksForTesting() override;
content::BackgroundFetchContext* GetBackgroundFetchContext() override;
content::BackgroundSyncContext* GetBackgroundSyncContext() override;
content::PaymentAppContextImpl* GetPaymentAppContext() override;
@ -75,6 +76,7 @@ class CefStoragePartitionProxy : public content::StoragePartition {
content::BluetoothAllowedDevicesMap* GetBluetoothAllowedDevicesMap() override;
content::BlobURLLoaderFactory* GetBlobURLLoaderFactory() override;
content::BlobRegistryWrapper* GetBlobRegistry() override;
content::PrefetchURLLoaderService* GetPrefetchURLLoaderService() override;
content::URLLoaderFactoryGetter* url_loader_factory_getter() override;
content::BrowserContext* browser_context() const override;
mojo::BindingId Bind(

View File

@ -8,21 +8,20 @@
#include "base/location.h"
#include "base/logging.h"
#include "base/task_scheduler/post_task.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/browser/browser_thread.h"
#define CEF_UIT content::BrowserThread::UI
#define CEF_IOT content::BrowserThread::IO
#define CEF_FILET content::BrowserThread::FILE
#define CEF_CURRENTLY_ON(id) content::BrowserThread::CurrentlyOn(id)
#define CEF_CURRENTLY_ON_UIT() CEF_CURRENTLY_ON(CEF_UIT)
#define CEF_CURRENTLY_ON_IOT() CEF_CURRENTLY_ON(CEF_IOT)
#define CEF_CURRENTLY_ON_FILET() CEF_CURRENTLY_ON(CEF_FILET)
#define CEF_REQUIRE(id) DCHECK(CEF_CURRENTLY_ON(id))
#define CEF_REQUIRE_UIT() CEF_REQUIRE(CEF_UIT)
#define CEF_REQUIRE_IOT() CEF_REQUIRE(CEF_IOT)
#define CEF_REQUIRE_FILET() CEF_REQUIRE(CEF_FILET)
#define CEF_REQUIRE_RETURN(id, var) \
if (!CEF_CURRENTLY_ON(id)) { \
@ -46,6 +45,36 @@
content::BrowserThread::PostDelayedTask( \
id, FROM_HERE, task, base::TimeDelta::FromMilliseconds(delay_ms))
// Post a blocking task with the specified |priority|. Tasks that have not
// started executing at shutdown will never run. However, any task that has
// already begun executing when shutdown is invoked will be allowed to continue
// and will block shutdown until completion.
// Tasks posted with this method are not guaranteed to run sequentially. Use
// base::CreateSequencedTaskRunnerWithTraits instead if sequence is important.
// Sequenced runners at various priorities that always execute all pending tasks
// before shutdown are available via CefContentBrowserClient::*_task_runner()
// and exposed by the CEF API.
#define CEF_POST_BLOCKING_TASK(priority, task) \
base::PostTaskWithTraits( \
FROM_HERE, \
{priority, base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN, \
base::MayBlock()}, \
task)
// Post a blocking task that affects UI or responsiveness of future user
// interactions. Do not use if an immediate response to a user interaction is
// expected.
#define CEF_POST_USER_VISIBLE_TASK(task) \
CEF_POST_BLOCKING_TASK(base::TaskPriority::USER_VISIBLE, task)
// Post a blocking task where the user won't notice if it takes an arbitrarily
// long time to complete.
#define CEF_POST_BACKGROUND_TASK(task) \
CEF_POST_BLOCKING_TASK(base::TaskPriority::BACKGROUND, task)
// Assert that blocking is allowed on the current thread.
#define CEF_REQUIRE_BLOCKING() base::AssertBlockingAllowed()
// Same as IMPLEMENT_REFCOUNTING() but using the specified Destructor.
#define IMPLEMENT_REFCOUNTING_EX(ClassName, Destructor) \
public: \

View File

@ -15,10 +15,10 @@ namespace {
// Create the temporary file and then execute |callback| on the thread
// represented by |message_loop_proxy|.
void CreateTemporaryFileOnFileThread(
void CreateTemporaryFileOnBackgroundThread(
scoped_refptr<base::SequencedTaskRunner> message_loop_proxy,
base::Callback<void(const base::FilePath&)> callback) {
CEF_REQUIRE_FILET();
CEF_REQUIRE_BLOCKING();
base::FilePath file_path;
if (!base::CreateTemporaryFile(&file_path))
LOG(ERROR) << "Failed to create temporary file.";
@ -101,8 +101,8 @@ bool CefTraceSubscriber::EndTracing(const base::FilePath& tracing_file,
if (tracing_file.empty()) {
// Create a new temporary file path on the FILE thread, then continue.
CEF_POST_TASK(CEF_FILET,
base::Bind(CreateTemporaryFileOnFileThread,
CEF_POST_USER_VISIBLE_TASK(
base::Bind(CreateTemporaryFileOnBackgroundThread,
base::ThreadTaskRunnerHandle::Get(),
base::Bind(&CefTraceSubscriber::ContinueEndTracing,
weak_factory_.GetWeakPtr(), callback)));

View File

@ -634,7 +634,7 @@ void CefWindowImpl::CreateWidget() {
#if defined(USE_AURA)
unhandled_key_event_handler_ =
base::MakeUnique<CefUnhandledKeyEventHandler>(this, widget_);
std::make_unique<CefUnhandledKeyEventHandler>(this, widget_);
#endif
// The Widget and root View are owned by the native window. Therefore don't

View File

@ -27,6 +27,7 @@
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/viz/common/features.h"
#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
@ -34,7 +35,7 @@
#include "content/public/common/main_function_params.h"
#include "extensions/common/constants.h"
#include "ipc/ipc_features.h"
#include "pdf/pdf.h"
#include "pdf/pdf_ppapi.h"
#include "ui/base/layout.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/base/resource/resource_bundle.h"
@ -437,19 +438,36 @@ bool CefMainDelegate::BasicStartupComplete(int* exit_code) {
base::IntToString(settings.uncaught_exception_stack_size));
}
std::vector<std::string> disable_features;
if (settings.windowless_rendering_enabled) {
// Disable AsyncWheelEvents when OSR is enabled to avoid DCHECKs in
// MouseWheelEventQueue.
if (settings.windowless_rendering_enabled &&
features::kAsyncWheelEvents.default_state ==
if (features::kAsyncWheelEvents.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
disable_features.push_back(features::kAsyncWheelEvents.name);
}
// Disable SurfaceSynchronization when OSR is enabled, otherwise rendering
// will fail.
if (features::kEnableSurfaceSynchronization.default_state ==
base::FEATURE_ENABLED_BY_DEFAULT) {
disable_features.push_back(
features::kEnableSurfaceSynchronization.name);
}
}
if (!disable_features.empty()) {
DCHECK(!base::FeatureList::GetInstance());
std::string disable_features =
std::string disable_features_str =
command_line->GetSwitchValueASCII(switches::kDisableFeatures);
if (!disable_features.empty())
disable_features += ",";
disable_features += features::kAsyncWheelEvents.name;
for (auto feature_str : disable_features) {
if (!disable_features_str.empty())
disable_features_str += ",";
disable_features_str += feature_str;
}
command_line->AppendSwitchASCII(switches::kDisableFeatures,
disable_features);
disable_features_str);
}
}

View File

@ -15,7 +15,7 @@ UploadData::UploadData()
void UploadData::AppendBytes(const char* bytes, int bytes_len) {
DCHECK(!is_chunked_);
if (bytes_len > 0) {
elements_.push_back(base::MakeUnique<UploadElement>());
elements_.push_back(std::make_unique<UploadElement>());
elements_.back()->SetToBytes(bytes, bytes_len);
}
}
@ -25,7 +25,7 @@ void UploadData::AppendFileRange(const base::FilePath& file_path,
uint64_t length,
const base::Time& expected_modification_time) {
DCHECK(!is_chunked_);
elements_.push_back(base::MakeUnique<UploadElement>());
elements_.push_back(std::make_unique<UploadElement>());
elements_.back()->SetToFilePathRange(file_path, offset, length,
expected_modification_time);
}

View File

@ -18,6 +18,7 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task_scheduler/post_task.h"
#include "components/navigation_interception/navigation_params.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/resource_request_info.h"
@ -70,10 +71,9 @@ class BytesElementReader : public net::UploadBytesElementReader {
DISALLOW_COPY_AND_ASSIGN(BytesElementReader);
};
base::TaskRunner* GetFileTaskRunner() {
return content::BrowserThread::GetTaskRunnerForThread(
content::BrowserThread::FILE)
.get();
scoped_refptr<base::SequencedTaskRunner> GetFileTaskRunner() {
return base::CreateSequencedTaskRunnerWithTraits(
{base::MayBlock(), base::TaskPriority::USER_VISIBLE});
}
// A subclass of net::UploadFileElementReader that keeps the associated
@ -82,7 +82,7 @@ class FileElementReader : public net::UploadFileElementReader {
public:
explicit FileElementReader(std::unique_ptr<net::UploadElement> element)
: net::UploadFileElementReader(
GetFileTaskRunner(),
GetFileTaskRunner().get(),
element->file_path(),
element->file_range_offset(),
element->file_range_length(),
@ -92,6 +92,7 @@ class FileElementReader : public net::UploadFileElementReader {
}
private:
scoped_refptr<base::SequencedTaskRunner> task_runner_;
std::unique_ptr<net::UploadElement> element_;
DISALLOW_COPY_AND_ASSIGN(FileElementReader);
@ -207,8 +208,9 @@ void SetHeaderMap(const CefRequest::HeaderMap& map,
blink::WebURLRequest& request) {
CefRequest::HeaderMap::const_iterator it = map.begin();
for (; it != map.end(); ++it) {
request.SetHTTPHeaderField(blink::WebString::FromUTF16(it->first),
blink::WebString::FromUTF16(it->second));
request.SetHTTPHeaderField(
blink::WebString::FromUTF16(it->first.ToString16()),
blink::WebString::FromUTF16(it->second.ToString16()));
}
}
@ -1030,7 +1032,7 @@ void CefPostDataImpl::Get(net::UploadData& data) const {
net::UploadData::ElementsVector data_elements;
for (const auto& element : elements_) {
std::unique_ptr<net::UploadElement> data_element =
base::MakeUnique<net::UploadElement>();
std::make_unique<net::UploadElement>();
static_cast<CefPostDataElementImpl*>(element.get())
->Get(*data_element.get());
data_elements.push_back(std::move(data_element));
@ -1047,7 +1049,7 @@ std::unique_ptr<net::UploadDataStream> CefPostDataImpl::Get() const {
static_cast<CefPostDataElementImpl*>(element.get())->Get());
}
return base::MakeUnique<net::ElementsUploadDataStream>(
return std::make_unique<net::ElementsUploadDataStream>(
std::move(element_readers), 0);
}
@ -1299,12 +1301,12 @@ std::unique_ptr<net::UploadElementReader> CefPostDataElementImpl::Get() const {
net::UploadElement* element = new net::UploadElement();
element->SetToBytes(static_cast<char*>(data_.bytes.bytes),
data_.bytes.size);
return base::MakeUnique<BytesElementReader>(base::WrapUnique(element));
return std::make_unique<BytesElementReader>(base::WrapUnique(element));
} else if (type_ == PDE_TYPE_FILE) {
net::UploadElement* element = new net::UploadElement();
base::FilePath path = base::FilePath(CefString(&data_.filename));
element->SetToFilePath(path);
return base::MakeUnique<FileElementReader>(base::WrapUnique(element));
return std::make_unique<FileElementReader>(base::WrapUnique(element));
} else {
NOTREACHED();
return nullptr;
@ -1343,7 +1345,8 @@ void CefPostDataElementImpl::Get(blink::WebHTTPBody::Element& element) const {
data_.bytes.size);
} else if (type_ == PDE_TYPE_FILE) {
element.type = blink::WebHTTPBody::Element::kTypeFile;
element.file_path = blink::WebString::FromUTF16(CefString(&data_.filename));
element.file_path =
blink::WebString::FromUTF16(CefString(&data_.filename).ToString16());
} else {
NOTREACHED();
}

View File

@ -3,6 +3,7 @@
// can be found in the LICENSE file.
#include "libcef/common/task_runner_impl.h"
#include "libcef/browser/content_browser_client.h"
#include "libcef/common/content_client.h"
#include "libcef/renderer/content_renderer_client.h"
@ -57,26 +58,21 @@ scoped_refptr<base::SingleThreadTaskRunner> CefTaskRunnerImpl::GetTaskRunner(
}
// Browser process.
CefContentBrowserClient* client = CefContentBrowserClient::Get();
if (!client)
return NULL;
int id = -1;
switch (threadId) {
case TID_UI:
id = BrowserThread::UI;
break;
case TID_DB:
id = BrowserThread::DB;
break;
case TID_FILE:
id = BrowserThread::FILE;
break;
case TID_FILE_BACKGROUND:
return client->background_task_runner();
case TID_FILE_USER_VISIBLE:
return client->user_visible_task_runner();
case TID_FILE_USER_BLOCKING:
id = BrowserThread::FILE_USER_BLOCKING;
break;
case TID_PROCESS_LAUNCHER:
id = BrowserThread::PROCESS_LAUNCHER;
break;
case TID_CACHE:
id = BrowserThread::CACHE;
break;
return client->user_blocking_task_runner();
case TID_IO:
id = BrowserThread::IO;
break;
@ -84,8 +80,7 @@ scoped_refptr<base::SingleThreadTaskRunner> CefTaskRunnerImpl::GetTaskRunner(
break;
};
if (id >= 0 && CefContentClient::Get() &&
CefContentClient::Get()->browser() &&
if (id >= 0 &&
BrowserThread::IsMessageLoopValid(static_cast<BrowserThread::ID>(id))) {
return BrowserThread::GetTaskRunnerForThread(
static_cast<BrowserThread::ID>(id));

View File

@ -1109,7 +1109,7 @@ bool CefListValueImpl::SetSize(size_t size) {
RemoveInternal(i);
} else if (size > 0) {
// Expand the list size.
mutable_value()->Set(size - 1, base::MakeUnique<base::Value>());
mutable_value()->Set(size - 1, std::make_unique<base::Value>());
}
return true;
}

View File

@ -93,7 +93,7 @@ const char kCdmSupportedCodecAvc1[] = "avc1";
std::unique_ptr<base::DictionaryValue> ParseManifestFile(
const base::FilePath& manifest_path) {
CEF_REQUIRE_FILET();
CEF_REQUIRE_BLOCKING();
// Manifest file should be < 1kb. Read at most 2kb.
std::string manifest_contents;
@ -318,10 +318,10 @@ void RegisterWidevineCdmOnUIThread(const base::FilePath& cdm_adapter_path,
callback);
}
void LoadWidevineCdmInfoOnFileThread(
void LoadWidevineCdmInfoOnBlockingThread(
const base::FilePath& base_path,
CefRefPtr<CefRegisterCdmCallback> callback) {
CEF_REQUIRE_FILET();
CEF_REQUIRE_BLOCKING();
base::FilePath cdm_adapter_path;
base::FilePath cdm_path;
@ -363,9 +363,8 @@ void CefWidevineLoader::LoadWidevineCdm(
return;
}
// Continue execution on the FILE thread.
CEF_POST_TASK(CEF_FILET,
base::Bind(LoadWidevineCdmInfoOnFileThread, path, callback));
CEF_POST_USER_VISIBLE_TASK(
base::Bind(LoadWidevineCdmInfoOnBlockingThread, path, callback));
}
void CefWidevineLoader::OnContextInitialized() {

View File

@ -202,7 +202,8 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
blink::WebView* web_view = render_view()->GetWebView();
if (web_view) {
const blink::WebString& frame_name = blink::WebString::FromUTF16(name);
const blink::WebString& frame_name =
blink::WebString::FromUTF16(name.ToString16());
// Search by assigned frame name (Frame::name).
WebFrame* frame = web_view->MainFrame();
if (frame && frame->IsWebLocalFrame())

View File

@ -56,6 +56,7 @@
#include "components/printing/renderer/print_render_frame_helper.h"
#include "components/spellcheck/renderer/spellcheck.h"
#include "components/spellcheck/renderer/spellcheck_provider.h"
#include "components/startup_metric_utils/common/startup_metric.mojom.h"
#include "components/visitedlink/renderer/visitedlink_slave.h"
#include "components/web_cache/renderer/web_cache_impl.h"
#include "content/common/frame_messages.h"
@ -76,7 +77,8 @@
#include "printing/print_settings.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/WebKit/common/associated_interfaces/associated_interface_provider.h"
#include "services/service_manager/public/cpp/service_context.h"
#include "third_party/WebKit/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/WebKit/public/platform/Platform.h"
#include "third_party/WebKit/public/platform/URLConversion.h"
#include "third_party/WebKit/public/platform/WebPrerenderingSupport.h"
@ -152,7 +154,8 @@ class CefGuestView : public content::RenderViewObserver {
};
CefContentRendererClient::CefContentRendererClient()
: devtools_agent_count_(0),
: main_entry_time_(base::TimeTicks::Now()),
devtools_agent_count_(0),
uncaught_exception_stack_size_(0),
single_process_cleanup_complete_(false) {
if (extensions::ExtensionsEnabled()) {
@ -356,12 +359,18 @@ void CefContentRendererClient::RenderThreadStarted() {
? blink::scheduler::RendererProcessType::kExtensionRenderer
: blink::scheduler::RendererProcessType::kRenderer);
{
startup_metric_utils::mojom::StartupMetricHostPtr startup_metric_host;
GetConnector()->BindInterface(chrome::mojom::kServiceName,
&startup_metric_host);
startup_metric_host->RecordRendererMainEntryTime(main_entry_time_);
}
thread->AddObserver(observer_.get());
thread->GetChannel()->AddFilter(new CefRenderMessageFilter);
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
spellcheck_.reset(new SpellCheck(this));
thread->AddObserver(spellcheck_.get());
spellcheck_ = std::make_unique<SpellCheck>(&registry_, this);
}
if (content::RenderProcessHost::run_renderer_in_process()) {
@ -574,10 +583,28 @@ void CefContentRendererClient::DevToolsAgentDetached() {
}
}
void CefContentRendererClient::CreateRendererService(
service_manager::mojom::ServiceRequest service_request) {
service_context_ = std::make_unique<service_manager::ServiceContext>(
std::make_unique<service_manager::ForwardingService>(this),
std::move(service_request));
}
void CefContentRendererClient::OnStart() {
context()->connector()->BindConnectorRequest(std::move(connector_request_));
}
void CefContentRendererClient::OnBindInterface(
const service_manager::BindSourceInfo& remote_info,
const std::string& name,
mojo::ScopedMessagePipeHandle handle) {
registry_.TryBindInterface(name, &handle);
}
void CefContentRendererClient::GetInterface(
const std::string& interface_name,
mojo::ScopedMessagePipeHandle interface_pipe) {
content::RenderThread::Get()->GetConnector()->BindInterface(
connector_->BindInterface(
service_manager::Identity(chrome::mojom::kServiceName), interface_name,
std::move(interface_pipe));
}
@ -613,7 +640,7 @@ void CefContentRendererClient::BrowserCreated(
if (params.is_guest_view) {
// Don't create a CefBrowser for guest views.
guest_views_.insert(std::make_pair(
render_view, base::MakeUnique<CefGuestView>(render_view)));
render_view, std::make_unique<CefGuestView>(render_view)));
return;
}
@ -669,6 +696,12 @@ void CefContentRendererClient::RunSingleProcessCleanupOnUIThread() {
delete host;
}
service_manager::Connector* CefContentRendererClient::GetConnector() {
if (!connector_)
connector_ = service_manager::Connector::Create(&connector_request_);
return connector_.get();
}
// Enable deprecation warnings for MSVC. See http://crbug.com/585142.
#if defined(OS_WIN)
#pragma warning(pop)

View File

@ -21,7 +21,10 @@
#include "chrome/common/plugin.mojom.h"
#include "content/public/renderer/content_renderer_client.h"
#include "content/public/renderer/render_thread.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "services/service_manager/public/cpp/connector.h"
#include "services/service_manager/public/cpp/local_interface_provider.h"
#include "services/service_manager/public/cpp/service.h"
namespace blink {
class WebURLLoaderFactory;
@ -48,6 +51,7 @@ class ChromePDFPrintClient;
class SpellCheck;
class CefContentRendererClient : public content::ContentRendererClient,
public service_manager::Service,
public service_manager::LocalInterfaceProvider,
public base::MessageLoop::DestructionObserver {
public:
@ -129,6 +133,14 @@ class CefContentRendererClient : public content::ContentRendererClient,
void RunScriptsAtDocumentIdle(content::RenderFrame* render_frame) override;
void DevToolsAgentAttached() override;
void DevToolsAgentDetached() override;
void CreateRendererService(
service_manager::mojom::ServiceRequest service_request) override;
// service_manager::Service implementation.
void OnStart() override;
void OnBindInterface(const service_manager::BindSourceInfo& remote_info,
const std::string& name,
mojo::ScopedMessagePipeHandle handle) override;
// service_manager::LocalInterfaceProvider implementation.
void GetInterface(const std::string& name,
@ -144,6 +156,12 @@ class CefContentRendererClient : public content::ContentRendererClient,
// Perform cleanup work for single-process mode.
void RunSingleProcessCleanupOnUIThread();
service_manager::Connector* GetConnector();
// Time at which this object was created. This is very close to the time at
// which the RendererMain function was entered.
base::TimeTicks main_entry_time_;
scoped_refptr<base::SingleThreadTaskRunner> render_task_runner_;
std::unique_ptr<CefRenderThreadObserver> observer_;
std::unique_ptr<web_cache::WebCacheImpl> web_cache_impl_;
@ -177,6 +195,11 @@ class CefContentRendererClient : public content::ContentRendererClient,
bool single_process_cleanup_complete_;
base::Lock single_process_cleanup_lock_;
std::unique_ptr<service_manager::Connector> connector_;
service_manager::mojom::ConnectorRequest connector_request_;
std::unique_ptr<service_manager::ServiceContext> service_context_;
service_manager::BinderRegistry registry_;
DISALLOW_COPY_AND_ASSIGN(CefContentRendererClient);
};

View File

@ -81,7 +81,8 @@ CefString CefDOMDocumentImpl::GetTitle() {
CefRefPtr<CefDOMNode> CefDOMDocumentImpl::GetElementById(const CefString& id) {
const WebDocument& document = frame_->GetDocument();
return GetOrCreateNode(document.GetElementById(WebString::FromUTF16(id)));
return GetOrCreateNode(
document.GetElementById(WebString::FromUTF16(id.ToString16())));
}
CefRefPtr<CefDOMNode> CefDOMDocumentImpl::GetFocusedNode() {
@ -175,7 +176,8 @@ CefString CefDOMDocumentImpl::GetCompleteURL(const CefString& partialURL) {
return str;
const WebDocument& document = frame_->GetDocument();
const WebURL& url = document.CompleteURL(WebString::FromUTF16(partialURL));
const WebURL& url =
document.CompleteURL(WebString::FromUTF16(partialURL.ToString16()));
if (!url.IsNull()) {
GURL gurl = url;
str = gurl.spec();

View File

@ -196,7 +196,8 @@ bool CefDOMNodeImpl::SetValue(const CefString& value) {
if (node_.IsElementNode())
return false;
return webkit_glue::SetNodeValue(node_, WebString::FromUTF16(value));
return webkit_glue::SetNodeValue(node_,
WebString::FromUTF16(value.ToString16()));
}
CefString CefDOMNodeImpl::GetAsMarkup() {
@ -301,7 +302,7 @@ bool CefDOMNodeImpl::HasElementAttribute(const CefString& attrName) {
}
const WebElement& element = node_.ToConst<blink::WebElement>();
return element.HasAttribute(WebString::FromUTF16(attrName));
return element.HasAttribute(WebString::FromUTF16(attrName.ToString16()));
}
CefString CefDOMNodeImpl::GetElementAttribute(const CefString& attrName) {
@ -315,7 +316,8 @@ CefString CefDOMNodeImpl::GetElementAttribute(const CefString& attrName) {
}
const WebElement& element = node_.ToConst<blink::WebElement>();
const WebString& attr = element.GetAttribute(WebString::FromUTF16(attrName));
const WebString& attr =
element.GetAttribute(WebString::FromUTF16(attrName.ToString16()));
if (!attr.IsNull())
str = attr.Utf16();
@ -354,8 +356,8 @@ bool CefDOMNodeImpl::SetElementAttribute(const CefString& attrName,
}
WebElement element = node_.To<blink::WebElement>();
element.SetAttribute(WebString::FromUTF16(attrName),
WebString::FromUTF16(value));
element.SetAttribute(WebString::FromUTF16(attrName.ToString16()),
WebString::FromUTF16(value.ToString16()));
return true;
}

View File

@ -26,13 +26,13 @@ CefRenderThreadObserver::CefRenderThreadObserver()
: visited_link_slave_(new visitedlink::VisitedLinkSlave) {
net::NetModule::SetResourceProvider(NetResourceProvider);
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
auto registry = std::make_unique<service_manager::BinderRegistry>();
registry->AddInterface(visited_link_slave_->GetBindCallback(),
base::ThreadTaskRunnerHandle::Get());
if (content::ChildThread::Get()) {
content::ChildThread::Get()
->GetServiceManagerConnection()
->AddConnectionFilter(base::MakeUnique<content::SimpleConnectionFilter>(
->AddConnectionFilter(std::make_unique<content::SimpleConnectionFilter>(
std::move(registry)));
}
}

View File

@ -669,12 +669,16 @@ class CefV8ExceptionImpl : public CefV8Exception {
return;
GetCefString(message->Get(), message_);
GetCefString(message->GetSourceLine(), source_line_);
v8::MaybeLocal<v8::String> source_line = message->GetSourceLine(context);
if (!source_line.IsEmpty())
GetCefString(source_line.ToLocalChecked(), source_line_);
if (!message->GetScriptResourceName().IsEmpty())
GetCefString(message->GetScriptResourceName()->ToString(), script_);
line_number_ = message->GetLineNumber();
v8::Maybe<int> line_number = message->GetLineNumber(context);
if (!line_number.IsNothing())
line_number_ = line_number.ToChecked();
start_position_ = message->GetStartPosition();
end_position_ = message->GetEndPosition();
start_column_ = message->GetStartColumn(context).FromJust();
@ -1011,8 +1015,10 @@ bool CefV8ContextImpl::Eval(const CefString& code,
v8::Local<v8::Context> context = GetV8Context();
v8::Context::Scope context_scope(context);
const blink::WebString& source = blink::WebString::FromUTF16(code);
const blink::WebString& source_url = blink::WebString::FromUTF16(script_url);
const blink::WebString& source =
blink::WebString::FromUTF16(code.ToString16());
const blink::WebString& source_url =
blink::WebString::FromUTF16(script_url.ToString16());
v8::TryCatch try_catch(isolate);
try_catch.SetVerbose(true);

View File

@ -177,10 +177,25 @@ v8::MaybeLocal<v8::Value> ExecuteV8ScriptAndReturnValue(
if (frame && frame->GetSettings())
v8CacheOptions = frame->GetSettings()->GetV8CacheOptions();
// Based on V8ScriptRunner::CompileAndRunInternalScript:
v8::ScriptCompiler::CompileOptions compile_options;
blink::V8ScriptRunner::ProduceCacheOptions produce_cache_options;
v8::ScriptCompiler::NoCacheReason no_cache_reason;
std::tie(compile_options, produce_cache_options, no_cache_reason) =
blink::V8ScriptRunner::GetCompileOptions(v8CacheOptions, ssc);
// Currently internal scripts don't have cache handlers, so we should not
// produce cache for them.
DCHECK_EQ(produce_cache_options,
blink::V8ScriptRunner::ProduceCacheOptions::kNoProduceCache);
v8::Local<v8::Script> script;
// Use default ReferrerScriptInfo here:
// - nonce: empty for internal script, and
// - parser_state: always "not parser inserted" for internal scripts.
if (!blink::V8ScriptRunner::CompileScript(
blink::ScriptState::From(context), ssc, accessControlStatus,
v8CacheOptions, blink::ReferrerScriptInfo())
compile_options, no_cache_reason, blink::ReferrerScriptInfo())
.ToLocal(&script)) {
DCHECK(tryCatch.HasCaught());
return result;

View File

@ -9,17 +9,16 @@
#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/services/printing/public/mojom/constants.mojom.h"
#include "components/printing/service/public/cpp/pdf_compositor_service_factory.h"
#include "components/printing/service/public/interfaces/pdf_compositor.mojom.h"
#include "content/public/child/child_thread.h"
#include "content/public/common/service_manager_connection.h"
#include "content/public/common/simple_connection_filter.h"
#include "content/public/network/url_request_context_builder_mojo.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/network/url_request_context_builder_mojo.h"
#include "services/proxy_resolver/proxy_resolver_service.h" // nogncheck
#include "services/proxy_resolver/public/interfaces/proxy_resolver.mojom.h" // nogncheck
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" // nogncheck
#include "services/service_manager/public/cpp/binder_registry.h"
#if defined(OS_WIN)
@ -28,7 +27,7 @@
CefContentUtilityClient::CefContentUtilityClient() {
#if defined(OS_WIN)
handlers_.push_back(base::MakeUnique<printing::PrintingHandler>());
printing_handler_ = std::make_unique<printing::PrintingHandler>();
#endif
}
@ -43,19 +42,19 @@ void CefContentUtilityClient::UtilityThreadStarted() {
if (!connection)
return;
auto registry = base::MakeUnique<service_manager::BinderRegistry>();
auto registry = std::make_unique<service_manager::BinderRegistry>();
connection->AddConnectionFilter(
base::MakeUnique<content::SimpleConnectionFilter>(std::move(registry)));
std::make_unique<content::SimpleConnectionFilter>(std::move(registry)));
}
bool CefContentUtilityClient::OnMessageReceived(const IPC::Message& message) {
bool handled = false;
for (Handlers::iterator it = handlers_.begin();
!handled && it != handlers_.end(); ++it) {
handled = (*it)->OnMessageReceived(message);
}
#if defined(OS_WIN)
if (printing_handler_->OnMessageReceived(message))
return true;
#endif
return handled;
}

View File

@ -11,7 +11,11 @@
#include "content/public/utility/content_utility_client.h"
class UtilityMessageHandler;
#if defined(OS_WIN)
namespace printing {
class PrintingHandler;
}
#endif
class CefContentUtilityClient : public content::ContentUtilityClient {
public:
@ -23,8 +27,9 @@ class CefContentUtilityClient : public content::ContentUtilityClient {
void RegisterServices(StaticServiceMap* services) override;
private:
using Handlers = std::vector<std::unique_ptr<UtilityMessageHandler>>;
Handlers handlers_;
#if defined(OS_WIN)
std::unique_ptr<printing::PrintingHandler> printing_handler_;
#endif
DISALLOW_COPY_AND_ASSIGN(CefContentUtilityClient);
};

View File

@ -358,4 +358,9 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2398
'name': 'mac_gpu_2398',
},
{
# Windows: Resolve conflict between base::StrCat and Win32 StrCat.
# https://bugs.chromium.org/p/chromium/issues/detail?id=817738
'name': 'win_strcat_817738',
},
]

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
index 81376ab57c4b..364305777492 100644
index dad7599ed999..c8daf2ba58c8 100644
--- content/browser/renderer_host/browser_compositor_view_mac.h
+++ content/browser/renderer_host/browser_compositor_view_mac.h
@@ -51,11 +51,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
@@ -52,11 +52,13 @@ class CONTENT_EXPORT BrowserCompositorMac : public DelegatedFrameHostClient {
// These will not return nullptr until Destroy is called.
DelegatedFrameHost* GetDelegatedFrameHost();
@ -17,10 +17,10 @@ index 81376ab57c4b..364305777492 100644
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
index 8e98fb37c1d4..8dc887eac61b 100644
index 07d42e680951..46699b959d2d 100644
--- content/browser/renderer_host/browser_compositor_view_mac.mm
+++ content/browser/renderer_host/browser_compositor_view_mac.mm
@@ -214,6 +214,12 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
@@ -215,6 +215,12 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
g_spare_recyclable_compositors.Get().clear();
}
@ -33,30 +33,22 @@ index 8e98fb37c1d4..8dc887eac61b 100644
gfx::AcceleratedWidget BrowserCompositorMac::GetAcceleratedWidget() {
if (recyclable_compositor_) {
return recyclable_compositor_->accelerated_widget_mac()
@@ -473,10 +479,16 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
NSView* ns_view =
@@ -268,7 +274,9 @@ void OnCompositingShuttingDown(ui::Compositor* compositor) override {}
accelerated_widget_mac_ns_view_->AcceleratedWidgetGetNSView();
if (bounds_in_dip) {
- NSSize dip_ns_size = [ns_view bounds].size;
- *bounds_in_dip = gfx::Size(dip_ns_size.width, dip_ns_size.height);
+ if (ns_view) {
+ NSSize dip_ns_size = [ns_view bounds].size;
+ *bounds_in_dip = gfx::Size(dip_ns_size.width, dip_ns_size.height);
+ } else {
+ // |ns_view| will be nullptr for CEF.
+ *bounds_in_dip = root_layer_->bounds().size();
+ }
}
if (scale_factor || color_space) {
+ // TODO(cef): Return values from CEF callbacks here.
display::Display display =
display::Display new_display =
display::Screen::GetScreen()->GetDisplayNearestView(ns_view);
if (scale_factor)
- gfx::Size new_size_dip([ns_view bounds].size);
+ // TODO(cef): Get display info from callbacks. |ns_view| will be nullptr.
+ gfx::Size new_size_dip(ns_view ? gfx::Size([ns_view bounds].size) :
+ root_layer_->bounds().size());
if (new_size_dip == dfh_size_dip_ && new_display == dfh_display_)
return false;
diff --git ui/accelerated_widget_mac/accelerated_widget_mac.mm ui/accelerated_widget_mac/accelerated_widget_mac.mm
index 7ff59beee63c..48efe5ac93fa 100644
index 8306398431d9..5ab4fef9ac0f 100644
--- ui/accelerated_widget_mac/accelerated_widget_mac.mm
+++ ui/accelerated_widget_mac/accelerated_widget_mac.mm
@@ -66,6 +66,10 @@ - (void)setContentsChanged;
@@ -71,6 +71,10 @@ - (void)setContentsChanged;
DCHECK(view && !view_);
view_ = view;

View File

@ -1,8 +1,8 @@
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
index c83e5babe405..92efd9e12561 100644
index 593f46130e32..5f7d2fe7355d 100644
--- content/browser/browser_plugin/browser_plugin_guest.cc
+++ content/browser/browser_plugin/browser_plugin_guest.cc
@@ -339,8 +339,11 @@ void BrowserPluginGuest::InitInternal(
@@ -322,8 +322,11 @@ void BrowserPluginGuest::InitInternal(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
}
@ -15,7 +15,7 @@ index c83e5babe405..92efd9e12561 100644
// Once a BrowserPluginGuest has an embedder WebContents, it's considered to
// be attached.
@@ -836,10 +839,19 @@ void BrowserPluginGuest::OnWillAttachComplete(
@@ -806,10 +809,19 @@ void BrowserPluginGuest::OnWillAttachComplete(
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
if (!web_contents()->GetRenderViewHost()->GetWidget()->GetView()) {
web_contents_view->CreateViewForWidget(
@ -37,10 +37,10 @@ index c83e5babe405..92efd9e12561 100644
attached_ = true;
diff --git content/browser/frame_host/interstitial_page_impl.cc content/browser/frame_host/interstitial_page_impl.cc
index 5a7aa396e372..8f80ed6d340c 100644
index 7c83d2a63b2c..070982ea2298 100644
--- content/browser/frame_host/interstitial_page_impl.cc
+++ content/browser/frame_host/interstitial_page_impl.cc
@@ -613,7 +613,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
@@ -614,7 +614,7 @@ WebContentsView* InterstitialPageImpl::CreateWebContentsView() {
WebContentsView* wcv =
static_cast<WebContentsImpl*>(web_contents())->GetView();
RenderWidgetHostViewBase* view =
@ -50,7 +50,7 @@ index 5a7aa396e372..8f80ed6d340c 100644
render_view_host_->GetMainFrame()->AllowBindings(
BINDINGS_POLICY_DOM_AUTOMATION);
diff --git content/browser/web_contents/web_contents_view.h content/browser/web_contents/web_contents_view.h
index a38a936af6df..5380e09ee023 100644
index cf8c74f4c744..b8cefb4b154b 100644
--- content/browser/web_contents/web_contents_view.h
+++ content/browser/web_contents/web_contents_view.h
@@ -24,7 +24,7 @@ struct ScreenInfo;
@ -62,7 +62,7 @@ index a38a936af6df..5380e09ee023 100644
public:
virtual ~WebContentsView() {}
@@ -91,13 +91,9 @@ class WebContentsView {
@@ -88,13 +88,9 @@ class WebContentsView {
// Sets up the View that holds the rendered web page, receives messages for
// it and contains page plugins. The host view should be sized to the current
// size of the WebContents.
@ -79,10 +79,10 @@ index a38a936af6df..5380e09ee023 100644
// Creates a new View that holds a popup and receives messages for it.
virtual RenderWidgetHostViewBase* CreateViewForPopupWidget(
diff --git content/browser/web_contents/web_contents_view_aura.cc content/browser/web_contents/web_contents_view_aura.cc
index c5ce75e10e2b..9968d86d4d48 100644
index 13d687ea411e..f16415faa23f 100644
--- content/browser/web_contents/web_contents_view_aura.cc
+++ content/browser/web_contents/web_contents_view_aura.cc
@@ -887,7 +887,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
@@ -781,7 +781,8 @@ void WebContentsViewAura::CreateView(const gfx::Size& initial_size,
}
RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@ -92,7 +92,7 @@ index c5ce75e10e2b..9968d86d4d48 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -899,6 +900,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
@@ -793,6 +794,7 @@ RenderWidgetHostViewBase* WebContentsViewAura::CreateViewForWidget(
render_widget_host->GetView());
}
@ -101,10 +101,10 @@ index c5ce75e10e2b..9968d86d4d48 100644
g_create_render_widget_host_view
? g_create_render_widget_host_view(render_widget_host,
diff --git content/browser/web_contents/web_contents_view_aura.h content/browser/web_contents/web_contents_view_aura.h
index 534f92c4cd6a..6f2ec63f09e6 100644
index 2371c819e665..40fa46097de1 100644
--- 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
@@ -114,7 +114,7 @@ class CONTENT_EXPORT WebContentsViewAura
gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@ -114,10 +114,10 @@ index 534f92c4cd6a..6f2ec63f09e6 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_child_frame.cc content/browser/web_contents/web_contents_view_child_frame.cc
index e1db175c25cb..1ef7b20a7add 100644
index e95c31d677f5..2e14ca1fabcf 100644
--- content/browser/web_contents/web_contents_view_child_frame.cc
+++ content/browser/web_contents/web_contents_view_child_frame.cc
@@ -96,7 +96,7 @@ void WebContentsViewChildFrame::CreateView(const gfx::Size& initial_size,
@@ -84,7 +84,7 @@ void WebContentsViewChildFrame::CreateView(const gfx::Size& initial_size,
RenderWidgetHostViewBase* WebContentsViewChildFrame::CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@ -127,10 +127,10 @@ index e1db175c25cb..1ef7b20a7add 100644
}
diff --git content/browser/web_contents/web_contents_view_child_frame.h content/browser/web_contents/web_contents_view_child_frame.h
index ca3c586f9f8f..5fd0e860a5ff 100644
index 17275be93025..6c73effc578b 100644
--- content/browser/web_contents/web_contents_view_child_frame.h
+++ content/browser/web_contents/web_contents_view_child_frame.h
@@ -41,7 +41,7 @@ class WebContentsViewChildFrame : public WebContentsView,
@@ -40,7 +40,7 @@ class WebContentsViewChildFrame : public WebContentsView,
gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@ -140,10 +140,10 @@ index ca3c586f9f8f..5fd0e860a5ff 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_guest.cc content/browser/web_contents/web_contents_view_guest.cc
index 227a66c7c836..f4d47bbed1a8 100644
index 699570cc1390..0c8bb808e657 100644
--- content/browser/web_contents/web_contents_view_guest.cc
+++ content/browser/web_contents/web_contents_view_guest.cc
@@ -74,6 +74,8 @@ void WebContentsViewGuest::GetScreenInfo(ScreenInfo* screen_info) const {
@@ -67,6 +67,8 @@ gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
#if defined(USE_AURA)
@ -152,16 +152,16 @@ index 227a66c7c836..f4d47bbed1a8 100644
// In aura, ScreenPositionClient doesn't work properly if we do
// not have the native view associated with this WebContentsViewGuest in the
// view hierarchy. We add this view as embedder's child here.
@@ -86,6 +88,8 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
@@ -79,6 +81,8 @@ void WebContentsViewGuest::OnGuestAttached(WebContentsView* parent_view) {
void WebContentsViewGuest::OnGuestDetached(WebContentsView* old_parent_view) {
#if defined(USE_AURA)
+ if (!platform_view_->GetNativeView())
+ return;
if (!switches::IsMusHostingViz()) {
if (!base::FeatureList::IsEnabled(features::kMash)) {
old_parent_view->GetNativeView()->RemoveChild(
platform_view_->GetNativeView());
@@ -139,7 +143,8 @@ void WebContentsViewGuest::CreateView(const gfx::Size& initial_size,
@@ -132,7 +136,8 @@ void WebContentsViewGuest::CreateView(const gfx::Size& initial_size,
}
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
@ -171,7 +171,7 @@ index 227a66c7c836..f4d47bbed1a8 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -151,11 +156,19 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
@@ -144,11 +149,19 @@ RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForWidget(
render_widget_host->GetView());
}
@ -195,10 +195,10 @@ index 227a66c7c836..f4d47bbed1a8 100644
RenderWidgetHostViewBase* WebContentsViewGuest::CreateViewForPopupWidget(
diff --git content/browser/web_contents/web_contents_view_guest.h content/browser/web_contents/web_contents_view_guest.h
index c04fe9bc23c4..5dba7a8b9e76 100644
index 4a06fe5f6880..ecad941c2638 100644
--- content/browser/web_contents/web_contents_view_guest.h
+++ content/browser/web_contents/web_contents_view_guest.h
@@ -59,7 +59,7 @@ class WebContentsViewGuest : public WebContentsView,
@@ -58,7 +58,7 @@ class WebContentsViewGuest : public WebContentsView,
gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@ -208,10 +208,10 @@ index c04fe9bc23c4..5dba7a8b9e76 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.h content/browser/web_contents/web_contents_view_mac.h
index 95ba5f05e4f7..39d4d764136c 100644
index 968c5157ab41..22aad9fbafa4 100644
--- content/browser/web_contents/web_contents_view_mac.h
+++ content/browser/web_contents/web_contents_view_mac.h
@@ -90,7 +90,7 @@ class WebContentsViewMac : public WebContentsView,
@@ -89,7 +89,7 @@ class WebContentsViewMac : public WebContentsView,
gfx::NativeView context) override;
RenderWidgetHostViewBase* CreateViewForWidget(
RenderWidgetHost* render_widget_host,
@ -221,10 +221,10 @@ index 95ba5f05e4f7..39d4d764136c 100644
RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const base::string16& title) override;
diff --git content/browser/web_contents/web_contents_view_mac.mm content/browser/web_contents/web_contents_view_mac.mm
index 2c5dd9e99e6d..39d6bceb55ed 100644
index 6a9ee15776b6..e4872d47e3d2 100644
--- content/browser/web_contents/web_contents_view_mac.mm
+++ content/browser/web_contents/web_contents_view_mac.mm
@@ -376,7 +376,8 @@ void WebContentsViewMac::CreateView(
@@ -346,7 +346,8 @@ void WebContentsViewMac::CreateView(
}
RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@ -234,7 +234,7 @@ index 2c5dd9e99e6d..39d6bceb55ed 100644
if (render_widget_host->GetView()) {
// During testing, the view will already be set up in most cases to the
// test view, so we don't want to clobber it with a real one. To verify that
@@ -388,6 +389,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
@@ -358,6 +359,7 @@ RenderWidgetHostViewBase* WebContentsViewMac::CreateViewForWidget(
render_widget_host->GetView());
}
@ -243,7 +243,7 @@ index 2c5dd9e99e6d..39d6bceb55ed 100644
g_create_render_widget_host_view
? g_create_render_widget_host_view(render_widget_host,
diff --git content/public/browser/browser_plugin_guest_delegate.h content/public/browser/browser_plugin_guest_delegate.h
index 9a3c2375c7f6..f95ea9cbe9ba 100644
index d05dd5421458..fa13775f0512 100644
--- content/public/browser/browser_plugin_guest_delegate.h
+++ content/public/browser/browser_plugin_guest_delegate.h
@@ -19,6 +19,7 @@ namespace content {
@ -262,9 +262,9 @@ index 9a3c2375c7f6..f95ea9cbe9ba 100644
+ virtual void OnGuestAttached(content::WebContentsView* parent_view) {}
+ virtual void OnGuestDetached(content::WebContentsView* parent_view) {}
+
// Sets the position of the context menu for the guest contents. The value
// reported from the guest renderer should be ignored. The reported value
// from the guest renderer is incorrect in situations where BrowserPlugin is
// TODO(ekaramad): A short workaround to force some types of guests to use
// a BrowserPlugin even when we are using cross process frames for guests. It
// should be removed after resolving https://crbug.com/642826).
diff --git extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
index 6f2b56d0cd90..ec6f15c0a789 100644
--- extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc

View File

@ -1,24 +1,24 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 472d5ea34687..575960cb4a37 100644
index ac49d3b83913..69696c72d0f3 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -7,6 +7,7 @@ import("//build/config/crypto.gni")
import("//build/config/features.gni")
@@ -8,6 +8,7 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
+import("//cef/libcef/features/features.gni")
import("//chrome/common/features.gni")
import("//components/feature_engagement/features.gni")
import("//components/nacl/features.gni")
@@ -1586,6 +1587,7 @@ split_static_library("browser") {
@@ -1591,6 +1592,7 @@ jumbo_split_static_library("browser") {
"//base:i18n",
"//base/allocator:features",
"//base/allocator:buildflags",
"//cc",
+ "//cef/libcef/features",
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -1837,6 +1839,10 @@ split_static_library("browser") {
@@ -1845,6 +1847,10 @@ jumbo_split_static_library("browser") {
"//ui/web_dialogs",
]

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/content_settings/host_content_settings_map_factory.cc chrome/browser/content_settings/host_content_settings_map_factory.cc
index 7bb265a57ba4..6917d09be48a 100644
index 2e8e68563c3c..54a1834c6055 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -7,6 +7,7 @@
@ -36,8 +36,8 @@ index 7bb265a57ba4..6917d09be48a 100644
#endif
}
@@ -88,9 +99,15 @@ scoped_refptr<RefcountedKeyedService>
store_last_modified));
@@ -86,9 +97,15 @@ scoped_refptr<RefcountedKeyedService>
/*store_last_modified=*/true));
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)

View File

@ -71,7 +71,7 @@ index e8e76ce5b954..1dd338dd0142 100644
content::BrowserContext* GetBrowserContextRedirectedInIncognito(
content::BrowserContext* context);
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index c5ab3d4e4d7a..69f54123f2cc 100644
index 06cc4ca5c59c..a610360829d8 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -377,7 +377,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@ -84,7 +84,7 @@ index c5ab3d4e4d7a..69f54123f2cc 100644
this));
}
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 9c410dc3ba6d..219d42503fa7 100644
index 95d20f01a062..96834378f487 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -93,7 +93,7 @@ class ProfileManager : public content::NotificationObserver,

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
index 312e27d1b562..03eb1fda05cb 100644
index ab3fd0de9e07..298db88e685f 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -17,6 +17,7 @@
@ -157,10 +157,10 @@ index 312e27d1b562..03eb1fda05cb 100644
// If we broke out of the loop, we have found an enabled plugin.
bool enabled = i < matching_plugins.size();
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index 47aceed2a513..2f1dae33e865 100644
index 700886c6ce89..8a47ec9f91a3 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -795,6 +795,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -774,6 +774,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@ -168,7 +168,7 @@ index 47aceed2a513..2f1dae33e865 100644
observer->IsPluginTemporarilyAllowed(identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
}
@@ -982,7 +983,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -961,7 +962,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
&plugin_auth_host);
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@ -178,7 +178,7 @@ index 47aceed2a513..2f1dae33e865 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -991,7 +993,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -970,7 +972,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@ -188,7 +188,7 @@ index 47aceed2a513..2f1dae33e865 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1001,7 +1004,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -980,7 +983,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
@ -198,7 +198,7 @@ index 47aceed2a513..2f1dae33e865 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -1009,7 +1013,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -988,7 +992,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name));
@ -209,7 +209,7 @@ index 47aceed2a513..2f1dae33e865 100644
}
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
diff --git chrome/renderer/plugins/chrome_plugin_placeholder.cc chrome/renderer/plugins/chrome_plugin_placeholder.cc
index 63b86138b4fe..4ed38c132efb 100644
index 6bc73727e61b..4f84ab989060 100644
--- chrome/renderer/plugins/chrome_plugin_placeholder.cc
+++ chrome/renderer/plugins/chrome_plugin_placeholder.cc
@@ -350,8 +350,11 @@ void ChromePluginPlaceholder::OnBlockedContent(

View File

@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 3f68c173d1c2..3906f588c7c2 100644
index 1ec9a536a378..8ab180c18d8e 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -3,6 +3,7 @@

View File

@ -1,5 +1,5 @@
diff --git chrome/common/chrome_content_client.cc chrome/common/chrome_content_client.cc
index 3c0ce2e2f701..7b078635d3b9 100644
index 750df2f7fbbe..5b46bb127102 100644
--- chrome/common/chrome_content_client.cc
+++ chrome/common/chrome_content_client.cc
@@ -91,7 +91,8 @@

View File

@ -13,7 +13,7 @@ index 4393a8fac233..860715e86900 100644
explicit ContentServiceManagerMainDelegate(const ContentMainParams& params);
~ContentServiceManagerMainDelegate() override;
diff --git third_party/WebKit/Source/controller/BUILD.gn third_party/WebKit/Source/controller/BUILD.gn
index d10cff4a0fdd..89673c9c5250 100644
index 67afa8b0bcef..20591788d173 100644
--- third_party/WebKit/Source/controller/BUILD.gn
+++ third_party/WebKit/Source/controller/BUILD.gn
@@ -25,6 +25,7 @@ component("controller") {

View File

@ -1,8 +1,8 @@
diff --git content/browser/compositor/gpu_process_transport_factory.cc content/browser/compositor/gpu_process_transport_factory.cc
index 33b9aa78462d..0653e11dbef1 100644
index b40de2a2910a..da20699a5d64 100644
--- content/browser/compositor/gpu_process_transport_factory.cc
+++ content/browser/compositor/gpu_process_transport_factory.cc
@@ -491,9 +491,19 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
@@ -492,9 +492,19 @@ void GpuProcessTransportFactory::EstablishedGpuChannel(
// surfaces as they are not following the correct mode.
DisableGpuCompositing(compositor.get());
}
@ -24,18 +24,18 @@ index 33b9aa78462d..0653e11dbef1 100644
} else {
DCHECK(context_provider);
diff --git ui/compositor/compositor.h ui/compositor/compositor.h
index eb56a103f8cb..ec2a44f1f5d0 100644
index 78b361460638..bbde6e19916d 100644
--- ui/compositor/compositor.h
+++ ui/compositor/compositor.h
@@ -24,6 +24,7 @@
#include "components/viz/common/surfaces/frame_sink_id.h"
#include "components/viz/common/surfaces/local_surface_id.h"
#include "components/viz/common/surfaces/surface_sequence.h"
#include "components/viz/host/host_frame_sink_client.h"
+#include "components/viz/service/display/software_output_device.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkMatrix44.h"
#include "ui/compositor/compositor_animation_observer.h"
@@ -186,6 +187,17 @@ class COMPOSITOR_EXPORT ContextFactory {
@@ -182,6 +183,17 @@ class COMPOSITOR_EXPORT ContextFactory {
virtual void RemoveObserver(ContextFactoryObserver* observer) = 0;
};
@ -53,7 +53,7 @@ index eb56a103f8cb..ec2a44f1f5d0 100644
// Compositor object to take care of GPU painting.
// A Browser compositor object is responsible for generating the final
// displayable form of pixels comprising a single widget's contents. It draws an
@@ -225,6 +237,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
@@ -221,6 +233,9 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
// Schedules a redraw of the layer tree associated with this compositor.
void ScheduleDraw();
@ -63,7 +63,7 @@ index eb56a103f8cb..ec2a44f1f5d0 100644
// 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
// is destroyed. NULL can be passed to reset the root layer, in which case the
@@ -445,6 +460,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
@@ -441,6 +456,8 @@ class COMPOSITOR_EXPORT Compositor : public cc::LayerTreeHostClient,
ui::ContextFactory* context_factory_;
ui::ContextFactoryPrivate* context_factory_private_;

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 4f4dadd98fd9..840c1df997dd 100644
index 03ca8ad55078..0899131ab154 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -539,8 +539,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
@@ -540,8 +540,8 @@ void IsHandledBySafePlugin(content::ResourceContext* resource_context,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
@ -14,10 +14,10 @@ index 4f4dadd98fd9..840c1df997dd 100644
// 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
diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc
index 5b07f3a407bf..7dffe84fc17c 100644
index 8e6ef99239ab..24ceaf229702 100644
--- chrome/browser/plugins/chrome_plugin_service_filter.cc
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc
@@ -169,6 +169,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
@@ -178,6 +178,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
int render_frame_id,
const void* context,
const GURL& plugin_content_url,
@ -38,7 +38,7 @@ index 133145db74bf..021ab307ee2a 100644
content::WebPluginInfo* plugin) override;
diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
index 8027836d925e..71f8d5a3f9dc 100644
index 3b0948c90a00..f0fb3b5d9d55 100644
--- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
+++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
@@ -53,7 +53,7 @@ PDFIFrameNavigationThrottle::MaybeCreateThrottleFor(
@ -51,10 +51,10 @@ index 8027836d925e..71f8d5a3f9dc 100644
return nullptr;
}
diff --git chrome/browser/ui/cocoa/drag_util.mm chrome/browser/ui/cocoa/drag_util.mm
index 6a2122ee1ed7..68831894695a 100644
index b1a49f718226..cb56c9fd4765 100644
--- chrome/browser/ui/cocoa/drag_util.mm
+++ chrome/browser/ui/cocoa/drag_util.mm
@@ -54,7 +54,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
@@ -51,7 +51,7 @@ BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
return PluginService::GetInstance()->GetPluginInfo(
-1, // process ID
MSG_ROUTING_NONE, // routing ID
@ -64,10 +64,10 @@ 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
index fcbea93113dd..0cd61aaf0aae 100644
index f4eb41e948bb..7e47a184d8c0 100644
--- 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(
@@ -601,6 +601,6 @@ void BrowserTabStripController::OnFindURLMimeTypeCompleted(
content::PluginService::GetInstance()->GetPluginInfo(
-1, // process ID
MSG_ROUTING_NONE, // routing ID
@ -76,10 +76,10 @@ index fcbea93113dd..0cd61aaf0aae 100644
mime_type, false, NULL, &plugin, NULL));
}
diff --git content/browser/frame_host/navigation_handle_impl.cc content/browser/frame_host/navigation_handle_impl.cc
index 89a41274745c..586864a9d827 100644
index 2986bf0e340e..6ef8486960ce 100644
--- content/browser/frame_host/navigation_handle_impl.cc
+++ content/browser/frame_host/navigation_handle_impl.cc
@@ -325,12 +325,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
@@ -368,12 +368,6 @@ net::Error NavigationHandleImpl::GetNetErrorCode() {
}
RenderFrameHostImpl* NavigationHandleImpl::GetRenderFrameHost() {
@ -93,21 +93,34 @@ index 89a41274745c..586864a9d827 100644
}
diff --git content/browser/frame_host/render_frame_host_impl.cc content/browser/frame_host/render_frame_host_impl.cc
index fc3412cb2680..385a7c591689 100644
index 1f566ef1f437..cffef1c8a2f2 100644
--- 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(
if (navigation_handle_) {
navigation_handle_->set_net_error_code(
@@ -1527,6 +1527,7 @@ void RenderFrameHostImpl::OnDidFailProvisionalLoadWithError(
if (GetNavigationHandle()) {
GetNavigationHandle()->set_net_error_code(
static_cast<net::Error>(params.error_code));
+ navigation_handle_->set_render_frame_host(this);
+ GetNavigationHandle()->set_render_frame_host(this);
}
frame_tree_node_->navigator()->DidFailProvisionalLoadWithError(this, params);
@@ -3515,9 +3516,9 @@ void RenderFrameHostImpl::CommitNavigation(
@@ -3269,9 +3270,9 @@ void RenderFrameHostImpl::RegisterMojoInterfaces() {
&QuotaDispatcherHost::CreateForFrame, GetProcess(), routing_id_));
if (base::FeatureList::IsEnabled(network::features::kNetworkService)) {
- StoragePartitionImpl* storage_partition =
- static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
+ StoragePartition* storage_partition =
+ BrowserContext::GetStoragePartition(
+ GetSiteInstance()->GetBrowserContext(), GetSiteInstance());
// TODO(https://crbug.com/813479): Investigate why we need to explicitly
// specify task runner for BrowserThread::IO here.
// Bind calls to the BindRegistry should come on to the IO thread by
@@ -3545,9 +3546,9 @@ void RenderFrameHostImpl::CommitNavigation(
// however only do this for cross-document navigations, because the
// alternative would be redundant effort.
network::mojom::URLLoaderFactoryPtr default_factory;
network::mojom::URLLoaderFactoryPtrInfo default_factory_info;
- StoragePartitionImpl* storage_partition =
- static_cast<StoragePartitionImpl*>(BrowserContext::GetStoragePartition(
- GetSiteInstance()->GetBrowserContext(), GetSiteInstance()));
@ -117,24 +130,22 @@ index fc3412cb2680..385a7c591689 100644
if (subresource_loader_params &&
subresource_loader_params->loader_factory_info.is_valid()) {
// 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()));
@@ -4162,8 +4163,8 @@ void RenderFrameHostImpl::CreateNetworkServiceDefaultFactoryAndObserve(
auto* context = GetSiteInstance()->GetBrowserContext();
GetContentClient()->browser()->WillCreateURLLoaderFactory(
this, false /* is_navigation */, &default_factory_request);
- StoragePartitionImpl* storage_partition = static_cast<StoragePartitionImpl*>(
- BrowserContext::GetStoragePartition(context, 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()) {
+ BrowserContext::GetStoragePartition(context, GetSiteInstance());
if (g_create_network_factory_callback_for_test.Get().is_null()) {
storage_partition->GetNetworkContext()->CreateURLLoaderFactory(
std::move(default_factory_request), GetProcess()->GetID());
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
index 6e105e13b6c5..99815c49cbc1 100644
index b3653373a51f..6db0652284ec 100644
--- content/browser/frame_host/render_frame_message_filter.cc
+++ content/browser/frame_host/render_frame_message_filter.cc
@@ -540,6 +540,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
@@ -546,6 +546,7 @@ void RenderFrameMessageFilter::GetCookies(int render_frame_id,
void RenderFrameMessageFilter::OnGetPlugins(
bool refresh,
@ -142,7 +153,7 @@ index 6e105e13b6c5..99815c49cbc1 100644
const url::Origin& main_frame_origin,
IPC::Message* reply_msg) {
// Don't refresh if the specified threshold has not been passed. Note that
@@ -561,18 +562,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
@@ -567,18 +568,19 @@ void RenderFrameMessageFilter::OnGetPlugins(
PluginServiceImpl::GetInstance()->GetPlugins(
base::BindOnce(&RenderFrameMessageFilter::GetPluginsCallback, this,
@ -164,7 +175,7 @@ index 6e105e13b6c5..99815c49cbc1 100644
int routing_id = MSG_ROUTING_NONE;
// In this loop, copy the WebPluginInfo (and do not use a reference) because
// the filter might mutate it.
@@ -581,7 +583,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
@@ -587,7 +589,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
if (!filter ||
filter->IsPluginAvailable(child_process_id, routing_id,
resource_context_, main_frame_origin.GetURL(),
@ -173,7 +184,7 @@ index 6e105e13b6c5..99815c49cbc1 100644
plugins.push_back(plugin);
}
}
@@ -593,6 +595,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
@@ -599,6 +601,7 @@ void RenderFrameMessageFilter::GetPluginsCallback(
void RenderFrameMessageFilter::OnGetPluginInfo(
int render_frame_id,
const GURL& url,
@ -181,7 +192,7 @@ index 6e105e13b6c5..99815c49cbc1 100644
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool* found,
@@ -601,8 +604,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
@@ -607,8 +610,8 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
bool allow_wildcard = true;
*found = plugin_service_->GetPluginInfo(
render_process_id_, render_frame_id, resource_context_, url,
@ -193,7 +204,7 @@ index 6e105e13b6c5..99815c49cbc1 100644
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
index 8c3371209034..ae382bf750c0 100644
index db9398a07607..ce062d8a9ccd 100644
--- 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
@ -214,10 +225,10 @@ index 8c3371209034..ae382bf750c0 100644
const std::string& mime_type,
bool* found,
diff --git content/browser/loader/mime_sniffing_resource_handler.cc content/browser/loader/mime_sniffing_resource_handler.cc
index f951a3fd5cad..4740a49d4d38 100644
index a9322bc8b5d7..0b3bfef2237b 100644
--- content/browser/loader/mime_sniffing_resource_handler.cc
+++ content/browser/loader/mime_sniffing_resource_handler.cc
@@ -447,8 +447,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
@@ -494,8 +494,8 @@ bool MimeSniffingResourceHandler::CheckForPluginHandler(
WebPluginInfo plugin;
bool has_plugin = plugin_service_->GetPluginInfo(
info->GetChildID(), info->GetRenderFrameID(), info->GetContext(),
@ -263,10 +274,10 @@ index e6de4ca6c8b3..18eea4948e43 100644
const std::string& mime_type,
bool allow_wildcard,
diff --git content/common/frame_messages.h content/common/frame_messages.h
index 7bce348a78d4..bc27dbcdda37 100644
index 8e482fa78e3a..99b8e486e88f 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -1342,8 +1342,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
@@ -1362,8 +1362,9 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
// Used to get the list of plugins. |main_frame_origin| is used to handle
// exceptions for plugin content settings.
@ -277,7 +288,7 @@ index 7bce348a78d4..bc27dbcdda37 100644
url::Origin /* main_frame_origin */,
std::vector<content::WebPluginInfo> /* plugins */)
@@ -1351,9 +1352,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
@@ -1371,9 +1372,10 @@ IPC_SYNC_MESSAGE_CONTROL2_1(FrameHostMsg_GetPlugins,
// type. If there is no matching plugin, |found| is false.
// |actual_mime_type| is the actual mime type supported by the
// found plugin.
@ -338,10 +349,10 @@ index 3b610b1f554e..7c439e060779 100644
WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index b51a04da8ca0..ca13e9a6a07e 100644
index 34aed4fd3565..364f042ee903 100644
--- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h
@@ -73,6 +73,9 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -74,6 +74,9 @@ class CONTENT_EXPORT ContentRendererClient {
// Notifies us that the RenderThread has been created.
virtual void RenderThreadStarted() {}
@ -351,7 +362,7 @@ index b51a04da8ca0..ca13e9a6a07e 100644
// Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -327,6 +330,10 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -333,6 +336,10 @@ class CONTENT_EXPORT ContentRendererClient {
// This method may invalidate the frame.
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
@ -377,10 +388,10 @@ index aa77b86eee98..097d26a80aa9 100644
virtual void FocusedNodeChanged(const blink::WebNode& node) {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index f341fb4aec24..28f3105f15c0 100644
index 259d31191208..890ec89bbaee 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -3468,7 +3468,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
@@ -3447,7 +3447,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
std::string mime_type;
bool found = false;
Send(new FrameHostMsg_GetPluginInfo(
@ -390,7 +401,7 @@ index f341fb4aec24..28f3105f15c0 100644
params.mime_type.Utf8(), &found, &info, &mime_type));
if (!found)
return nullptr;
@@ -3824,6 +3825,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
@@ -3808,6 +3809,8 @@ void RenderFrameImpl::FrameDetached(DetachType type) {
void RenderFrameImpl::FrameFocused() {
Send(new FrameHostMsg_FrameFocused(routing_id_));
@ -400,10 +411,10 @@ index f341fb4aec24..28f3105f15c0 100644
void RenderFrameImpl::WillCommitProvisionalLoad() {
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index f55d956f05ec..ec2292acb1c3 100644
index 81d3f80db8ef..1e349f80ed23 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -822,6 +822,8 @@ void RenderThreadImpl::Init(
@@ -925,6 +925,8 @@ void RenderThreadImpl::Init(
StartServiceManagerConnection();
@ -413,10 +424,10 @@ index f55d956f05ec..ec2292acb1c3 100644
base::Bind(&RenderThreadImpl::OnRendererInterfaceRequest,
base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index 561593754e91..18273663e17e 100644
index 0affacaa0294..8c08aad965a2 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -842,6 +842,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor(
@@ -849,6 +849,7 @@ RendererBlinkPlatformImpl::CreateMIDIAccessor(
void RendererBlinkPlatformImpl::GetPluginList(
bool refresh,
@ -424,7 +435,7 @@ index 561593754e91..18273663e17e 100644
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) {
#if BUILDFLAG(ENABLE_PLUGINS)
@@ -849,7 +850,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
@@ -856,7 +857,8 @@ void RendererBlinkPlatformImpl::GetPluginList(
if (!plugin_refresh_allowed_)
refresh = false;
RenderThread::Get()->Send(
@ -434,7 +445,7 @@ index 561593754e91..18273663e17e 100644
for (const WebPluginInfo& plugin : plugins) {
builder->AddPlugin(WebString::FromUTF16(plugin.name),
WebString::FromUTF16(plugin.desc),
@@ -1424,6 +1426,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() {
@@ -1417,6 +1419,14 @@ void RendererBlinkPlatformImpl::RequestPurgeMemory() {
base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
}
@ -450,7 +461,7 @@ index 561593754e91..18273663e17e 100644
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
index 65ddfde81aff..d92a0b316270 100644
index e8a4578009d1..780d8b29acb2 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -128,6 +128,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@ -461,7 +472,7 @@ index 65ddfde81aff..d92a0b316270 100644
const blink::WebSecurityOrigin& mainFrameOrigin,
blink::WebPluginListBuilder* builder) override;
blink::WebPublicSuffixList* PublicSuffixList() override;
@@ -258,6 +259,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -256,6 +257,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
mojo::ScopedDataPipeConsumerHandle handle) override;
void RequestPurgeMemory() override;
@ -520,10 +531,10 @@ index db23a83ed079..57a4c536118c 100644
const std::string& mime_type,
bool allow_wildcard,
diff --git content/test/test_blink_web_unit_test_support.cc content/test/test_blink_web_unit_test_support.cc
index ae5e6942fe34..a8fead11a023 100644
index 25182fdb0928..9cc19c4016d3 100644
--- content/test/test_blink_web_unit_test_support.cc
+++ content/test/test_blink_web_unit_test_support.cc
@@ -325,6 +325,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() {
@@ -324,6 +324,7 @@ blink::WebThread* TestBlinkWebUnitTestSupport::CurrentThread() {
void TestBlinkWebUnitTestSupport::GetPluginList(
bool refresh,
@ -532,7 +543,7 @@ index ae5e6942fe34..a8fead11a023 100644
blink::WebPluginListBuilder* builder) {
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
index 9b5c0a94fa7f..f31678481f0f 100644
index d8ad7b6e4435..5eda4bc3c2d5 100644
--- content/test/test_blink_web_unit_test_support.h
+++ content/test/test_blink_web_unit_test_support.h
@@ -72,6 +72,7 @@ class TestBlinkWebUnitTestSupport : public BlinkPlatformImpl {

View File

@ -1,5 +1,5 @@
diff --git chrome/common/crash_keys.cc chrome/common/crash_keys.cc
index 5e0eabb..f862908 100644
index 887e13776dd2..de30ebff25e4 100644
--- chrome/common/crash_keys.cc
+++ chrome/common/crash_keys.cc
@@ -4,6 +4,8 @@
@ -20,7 +20,7 @@ index 5e0eabb..f862908 100644
static const char* const kIgnoreSwitches[] = {
switches::kEnableLogging,
switches::kFlagSwitchesBegin,
@@ -81,7 +83,7 @@ static bool IsBoringSwitch(const std::string& flag) {
@@ -77,7 +79,7 @@ static bool IsBoringSwitch(const std::string& flag) {
}
void SetCrashKeysFromCommandLine(const base::CommandLine& command_line) {
@ -30,7 +30,7 @@ index 5e0eabb..f862908 100644
void SetActiveExtensions(const std::set<std::string>& extensions) {
diff --git chrome/common/crash_keys.h chrome/common/crash_keys.h
index a18c8fc..011bcc2 100644
index bcf172e645a2..a46141ea43e0 100644
--- chrome/common/crash_keys.h
+++ chrome/common/crash_keys.h
@@ -16,6 +16,10 @@ class CommandLine;
@ -45,7 +45,7 @@ index a18c8fc..011bcc2 100644
// Sets the kNumSwitches key and the set of keys named using kSwitchFormat based
// on the given |command_line|.
diff --git chrome_elf/BUILD.gn chrome_elf/BUILD.gn
index fd5a28b..df46cb0 100644
index 08dc1ddba75a..e2bc7c365980 100644
--- chrome_elf/BUILD.gn
+++ chrome_elf/BUILD.gn
@@ -7,6 +7,7 @@
@ -56,7 +56,7 @@ index fd5a28b..df46cb0 100644
import("//chrome/process_version_rc_template.gni")
import("//testing/test.gni")
@@ -181,9 +182,6 @@ static_library("blacklist") {
@@ -186,9 +187,6 @@ static_library("blacklist") {
static_library("crash") {
sources = [
@ -66,7 +66,7 @@ index fd5a28b..df46cb0 100644
"crash/crash_helper.cc",
"crash/crash_helper.h",
]
@@ -191,6 +189,7 @@ static_library("crash") {
@@ -196,6 +194,7 @@ static_library("crash") {
":hook_util",
"//base", # This needs to go. DEP of app, crash_keys, client.
"//base:base_static", # pe_image
@ -74,7 +74,7 @@ index fd5a28b..df46cb0 100644
"//chrome/install_static:install_static_util",
"//components/crash/content/app",
"//components/crash/core/common", # crash_keys
@@ -198,6 +197,17 @@ static_library("crash") {
@@ -203,6 +202,17 @@ static_library("crash") {
"//content/public/common:result_codes",
"//third_party/crashpad/crashpad/client", # DumpWithoutCrash
]
@ -93,7 +93,7 @@ index fd5a28b..df46cb0 100644
static_library("hook_util") {
diff --git chrome_elf/crash/crash_helper.cc chrome_elf/crash/crash_helper.cc
index e8e27dc..7cb2149 100644
index e8e27dc4ebd7..7cb2149ec41d 100644
--- chrome_elf/crash/crash_helper.cc
+++ chrome_elf/crash/crash_helper.cc
@@ -11,12 +11,17 @@
@ -127,7 +127,7 @@ index e8e27dc..7cb2149 100644
g_crash_helper_enabled = true;
return true;
diff --git components/crash/content/app/breakpad_linux.cc components/crash/content/app/breakpad_linux.cc
index c72cd36..e9a79dd 100644
index 460f7ac4defa..1c1b11f87e91 100644
--- components/crash/content/app/breakpad_linux.cc
+++ components/crash/content/app/breakpad_linux.cc
@@ -28,6 +28,7 @@
@ -146,7 +146,7 @@ index c72cd36..e9a79dd 100644
#endif
bool g_is_crash_reporter_enabled = false;
@@ -685,7 +687,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
@@ -689,7 +691,7 @@ bool CrashDone(const MinidumpDescriptor& minidump,
info.process_type_length = 7;
info.distro = base::g_linux_distro;
info.distro_length = my_strlen(base::g_linux_distro);
@ -155,7 +155,7 @@ index c72cd36..e9a79dd 100644
info.process_start_time = g_process_start_time;
info.oom_size = base::g_oom_size;
info.pid = g_pid;
@@ -1341,7 +1343,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
@@ -1345,7 +1347,7 @@ void ExecUploadProcessOrTerminate(const BreakpadInfo& info,
header_content_encoding,
header_content_type,
post_file,
@ -164,7 +164,7 @@ index c72cd36..e9a79dd 100644
"--timeout=10", // Set a timeout so we don't hang forever.
"--tries=1", // Don't retry if the upload fails.
"-O", // Output reply to the file descriptor path.
@@ -1681,10 +1683,19 @@ void HandleCrashDump(const BreakpadInfo& info) {
@@ -1685,10 +1687,19 @@ void HandleCrashDump(const BreakpadInfo& info) {
GetCrashReporterClient()->GetProductNameAndVersion(&product_name, &version);
writer.AddBoundary();
@ -186,7 +186,7 @@ index c72cd36..e9a79dd 100644
if (info.pid > 0) {
char pid_value_buf[kUint64StringSize];
uint64_t pid_value_len = my_uint64_len(info.pid);
@@ -1789,10 +1800,20 @@ void HandleCrashDump(const BreakpadInfo& info) {
@@ -1793,10 +1804,20 @@ void HandleCrashDump(const BreakpadInfo& info) {
crash_reporter::internal::TransitionalCrashKeyStorage;
CrashKeyStorage::Iterator crash_key_iterator(*info.crash_keys);
const CrashKeyStorage::Entry* entry;
@ -208,7 +208,7 @@ index c72cd36..e9a79dd 100644
writer.AddBoundary();
writer.Flush();
}
@@ -2002,6 +2023,17 @@ void SetChannelCrashKey(const std::string& channel) {
@@ -2006,6 +2027,17 @@ void SetChannelCrashKey(const std::string& channel) {
channel_key.Set(channel);
}
@ -227,7 +227,7 @@ index c72cd36..e9a79dd 100644
void InitNonBrowserCrashReporterForAndroid(const std::string& process_type) {
SanitizationInfo sanitization_info;
diff --git components/crash/content/app/breakpad_linux.h components/crash/content/app/breakpad_linux.h
index 9ee8555..7af55dd 100644
index 9ee85554812c..7af55ddda8fe 100644
--- components/crash/content/app/breakpad_linux.h
+++ components/crash/content/app/breakpad_linux.h
@@ -19,6 +19,9 @@ extern void InitCrashReporter(const std::string& process_type);
@ -241,7 +241,7 @@ index 9ee8555..7af55dd 100644
extern void InitCrashKeysForTesting();
diff --git components/crash/content/app/crash_reporter_client.cc components/crash/content/app/crash_reporter_client.cc
index a37619c..e13a0f7 100644
index a37619c815e3..e13a0f7ade86 100644
--- components/crash/content/app/crash_reporter_client.cc
+++ components/crash/content/app/crash_reporter_client.cc
@@ -88,11 +88,12 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
@ -315,7 +315,7 @@ index a37619c..e13a0f7 100644
} // namespace crash_reporter
diff --git components/crash/content/app/crash_reporter_client.h components/crash/content/app/crash_reporter_client.h
index 75d3d6d..aa86f45 100644
index 75d3d6d93873..aa86f45c9746 100644
--- components/crash/content/app/crash_reporter_client.h
+++ components/crash/content/app/crash_reporter_client.h
@@ -5,7 +5,9 @@
@ -343,14 +343,14 @@ index 75d3d6d..aa86f45 100644
virtual base::FilePath GetReporterLogFilename();
// Custom crash minidump handler after the minidump is generated.
@@ -106,6 +109,7 @@ class CrashReporterClient {
@@ -105,6 +108,7 @@ class CrashReporterClient {
// WARNING: this handler runs in a compromised context. It may not call into
// libc nor allocate memory normally.
virtual bool HandleCrashDump(const char* crashdump_filename);
#endif
+#endif
#endif
// The location where minidump files should be written. Returns true if
// |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.
@ -383,10 +383,10 @@ index 75d3d6d..aa86f45 100644
} // namespace crash_reporter
diff --git components/crash/content/app/crashpad.cc components/crash/content/app/crashpad.cc
index dde11ea..1a1f8b0 100644
index 36ff7c219ad5..241156316efc 100644
--- components/crash/content/app/crashpad.cc
+++ components/crash/content/app/crashpad.cc
@@ -133,7 +133,8 @@ void InitializeCrashpadImpl(bool initial_client,
@@ -142,7 +142,8 @@ void InitializeCrashpadImpl(bool initial_client,
// 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
// time to chew on symbols.
@ -397,7 +397,7 @@ index dde11ea..1a1f8b0 100644
->set_system_crash_reporter_forwarding(crashpad::TriState::kDisabled);
}
diff --git components/crash/content/app/crashpad_mac.mm components/crash/content/app/crashpad_mac.mm
index 6508c2a..f51ce5a 100644
index 6508c2a06760..f51ce5a17e63 100644
--- components/crash/content/app/crashpad_mac.mm
+++ components/crash/content/app/crashpad_mac.mm
@@ -16,11 +16,14 @@
@ -498,7 +498,7 @@ index 6508c2a..f51ce5a 100644
handler_path, database_path, metrics_path, url, process_annotations,
arguments, true, false);
diff --git components/crash/content/app/crashpad_win.cc components/crash/content/app/crashpad_win.cc
index a5d1afc..91815d9 100644
index a5d1afc409f4..91815d949f2e 100644
--- components/crash/content/app/crashpad_win.cc
+++ components/crash/content/app/crashpad_win.cc
@@ -34,8 +34,8 @@ void GetPlatformCrashpadAnnotations(
@ -568,7 +568,7 @@ index a5d1afc..91815d9 100644
if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
diff --git content/browser/frame_host/debug_urls.cc content/browser/frame_host/debug_urls.cc
index 4695432..62a7ce8 100644
index 46954327b9c7..62a7ce8d4e46 100644
--- 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) {

View File

@ -146,7 +146,7 @@ index b64f74fbaf28..0c3c22e215b6 100644
struct Data;
diff --git third_party/crashpad/crashpad/handler/BUILD.gn third_party/crashpad/crashpad/handler/BUILD.gn
index 71037bb04d5d..61f7e8ca04ca 100644
index 9c337697b605..b1fbd1de6074 100644
--- third_party/crashpad/crashpad/handler/BUILD.gn
+++ third_party/crashpad/crashpad/handler/BUILD.gn
@@ -12,6 +12,7 @@

View File

@ -1,8 +1,8 @@
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
index 36525162ff0e..db28486fa6c0 100644
index 1a93ba92a9e0..2c4b116d25ea 100644
--- content/browser/devtools/devtools_http_handler.cc
+++ content/browser/devtools/devtools_http_handler.cc
@@ -503,7 +503,7 @@ void DevToolsHttpHandler::OnJsonRequest(
@@ -543,7 +543,7 @@ void DevToolsHttpHandler::OnJsonRequest(
version.SetString("Protocol-Version",
DevToolsAgentHost::GetProtocolVersion());
version.SetString("WebKit-Version", GetWebKitVersion());

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
index 3263eb9e324a..b5bde4cea8f7 100644
index d7342d69dd8e..33d538952375 100644
--- content/browser/frame_host/render_frame_host_manager.cc
+++ content/browser/frame_host/render_frame_host_manager.cc
@@ -890,10 +890,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
@@ -891,10 +891,11 @@ bool RenderFrameHostManager::ShouldSwapBrowsingInstancesForNavigation(
// TODO(alexmos): This check should've been enforced earlier in the
// navigation, in chrome::Navigate(). Verify this, and then convert this to
// a CHECK and remove the fallback.
@ -18,7 +18,7 @@ index 3263eb9e324a..b5bde4cea8f7 100644
return true;
}
@@ -1032,7 +1033,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
@@ -1033,7 +1034,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigation(
// Double-check that the new SiteInstance is associated with the right
// BrowserContext.
@ -29,10 +29,10 @@ index 3263eb9e324a..b5bde4cea8f7 100644
// If |new_instance| is a new SiteInstance for a subframe that requires a
// 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
index 18767b608ce9..41f5dc26ffdc 100644
index 5373ee07b5cd..2558e590ba7c 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -341,6 +341,13 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -354,6 +354,13 @@ class CONTENT_EXPORT ContentBrowserClient {
const GURL& current_url,
const GURL& new_url);
@ -152,10 +152,10 @@ index 34812c083bf5..1ccfaf6e1c45 100644
// 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
diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h
index 267a40121d8e..fc68e632465c 100644
index 9e8ebb1a4d59..b42e88b11f6a 100644
--- extensions/browser/extensions_browser_client.h
+++ extensions/browser/extensions_browser_client.h
@@ -53,6 +53,7 @@ class ComponentExtensionResourceManager;
@@ -54,6 +54,7 @@ class ComponentExtensionResourceManager;
class Extension;
class ExtensionCache;
class ExtensionError;
@ -163,7 +163,7 @@ index 267a40121d8e..fc68e632465c 100644
class ExtensionHostDelegate;
class ExtensionPrefsObserver;
class ExtensionApiFrameIdMap;
@@ -108,6 +109,11 @@ class ExtensionsBrowserClient {
@@ -109,6 +110,11 @@ class ExtensionsBrowserClient {
virtual content::BrowserContext* GetOriginalContext(
content::BrowserContext* context) = 0;
@ -175,7 +175,7 @@ index 267a40121d8e..fc68e632465c 100644
#if defined(OS_CHROMEOS)
// Returns a user id hash from |context| or an empty string if no hash could
// be extracted.
@@ -173,6 +179,14 @@ class ExtensionsBrowserClient {
@@ -191,6 +197,14 @@ class ExtensionsBrowserClient {
virtual std::unique_ptr<ExtensionHostDelegate>
CreateExtensionHostDelegate() = 0;

View File

@ -1,8 +1,8 @@
diff --git .gn .gn
index 20f642efb056..7f73f53c70ad 100644
index 50a8a2fe9f1e..719adff0da9b 100644
--- .gn
+++ .gn
@@ -234,6 +234,8 @@ exec_script_whitelist =
@@ -241,6 +241,8 @@ exec_script_whitelist =
# in the Chromium repo outside of //build.
"//build_overrides/build.gni",
@ -12,10 +12,10 @@ index 20f642efb056..7f73f53c70ad 100644
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index 92a8578280e6..11eb3b16a812 100644
index 161519ebfeac..c034f54603e8 100644
--- BUILD.gn
+++ BUILD.gn
@@ -183,6 +183,7 @@ group("gn_all") {
@@ -190,6 +190,7 @@ group("gn_all") {
if (!is_ios && !is_fuchsia) {
deps += [
@ -96,7 +96,7 @@ index a1d2ea4b2394..50514a54e64f 100644
diff --git build/vs_toolchain.py build/vs_toolchain.py
index 0a54e113f30f..d8ff277fcda6 100755
index 5f9541e4556f..c1144b30f237 100755
--- build/vs_toolchain.py
+++ build/vs_toolchain.py
@@ -81,11 +81,18 @@ def SetEnvironmentAndGetRuntimeDllDirs():
@ -119,10 +119,10 @@ index 0a54e113f30f..d8ff277fcda6 100755
# directory in order to run binaries locally, but they are needed in order
# to create isolates or the mini_installer. Copying them to the output
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index bd0fc70bb87f..79315464c57b 100644
index 94c5f759a0dd..a166b6302eeb 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -255,7 +255,7 @@ template("chrome_paks") {
@@ -253,7 +253,7 @@ template("chrome_paks") {
}
input_locales = locales
@ -132,15 +132,15 @@ index bd0fc70bb87f..79315464c57b 100644
if (is_mac) {
output_locales = locales_as_mac_outputs
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
index 3f65aa27ca38..3227cb17e460 100644
index 3ed598db3989..b23170bc4591 100644
--- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn
@@ -130,7 +130,7 @@ template("generate_mini_installer") {
@@ -143,7 +143,7 @@ template("generate_mini_installer") {
inputs = [
"$chrome_dll_file",
"$root_out_dir/chrome.exe",
- "$root_out_dir/locales/en-US.pak",
+ "$root_out_dir/chrome/locales/en-US.pak",
"$root_out_dir/setup.exe",
"$root_out_dir/v8_context_snapshot.bin",
"//chrome/tools/build/win/makecab.py",
release_file,

View File

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

View File

@ -1,29 +1,29 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 2673c6a79889..ca5726966ac0 100644
index 9a10137aa405..6dd8033a0b33 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -443,7 +443,7 @@ config("compiler") {
# 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
# other architectures.
- if ((!is_android && linux_use_bundled_binutils) || is_chromeos ||
+ if ((!is_android && linux_use_bundled_binutils && current_cpu != "x86") || is_chromeos ||
!(current_cpu == "x86" || current_cpu == "x64")) {
ldflags += [ "-Wl,--icf=all" ]
@@ -137,7 +137,7 @@ declare_args() {
is_posix && !using_sanitizer && !(is_android && use_order_profiling) &&
((use_lld && !is_nacl) ||
(use_gold &&
- ((!is_android && linux_use_bundled_binutils) || is_chromeos ||
+ ((!is_android && linux_use_bundled_binutils && current_cpu != "x86") || is_chromeos ||
!(current_cpu == "x86" || current_cpu == "x64"))))
}
diff --git chrome/browser/ui/libgtkui/gtk_util.cc chrome/browser/ui/libgtkui/gtk_util.cc
index fc6ffb9d..f6c22e5 100644
index 96f8c0e71472..49c462b37e12 100644
--- chrome/browser/ui/libgtkui/gtk_util.cc
+++ chrome/browser/ui/libgtkui/gtk_util.cc
@@ -56,6 +56,7 @@ void CommonInitFromCommandLine(const base::CommandLine& command_line,
}
@@ -237,6 +237,7 @@ float GetDeviceScaleFactor() {
return linux_ui ? linux_ui->GetDeviceScaleFactor() : 1;
}
+#if GTK_MAJOR_VERSION > 2
using GtkSetState = void (*)(GtkWidgetPath*, gint, GtkStateFlags);
PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetState>
_gtk_widget_path_iter_set_state;
@@ -63,6 +64,7 @@ PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetState>
@@ -244,6 +245,7 @@ PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetState>
using GtkSetObjectName = void (*)(GtkWidgetPath*, gint, const char*);
PROTECTED_MEMORY_SECTION base::ProtectedMemory<GtkSetObjectName>
_gtk_widget_path_iter_set_object_name;

View File

@ -33,7 +33,7 @@ index 27ee7fe8155b..353a61c3badd 100644
// if type_ is TYPE_CUSTOM and pump_ is null.
MessagePumpFactoryCallback pump_factory_;
diff --git base/message_loop/message_pump_win.cc base/message_loop/message_pump_win.cc
index 6f48da1c744e..e427941bfd06 100644
index 5069b8524924..e88a3c7974f2 100644
--- base/message_loop/message_pump_win.cc
+++ base/message_loop/message_pump_win.cc
@@ -366,20 +366,28 @@ bool MessagePumpForUI::ProcessMessageHelper(const MSG& msg) {

View File

@ -1,16 +1,16 @@
diff --git net/base/network_delegate.h net/base/network_delegate.h
index 22c428f90b16..1e0e6deaa7df 100644
index e3b6502ff7ee..a3b4b2d40d5f 100644
--- net/base/network_delegate.h
+++ net/base/network_delegate.h
@@ -16,6 +16,7 @@
@@ -17,6 +17,7 @@
#include "net/base/completion_callback.h"
#include "net/base/net_export.h"
#include "net/cookies/canonical_cookie.h"
+#include "net/filter/source_stream.h"
#include "net/proxy/proxy_retry_info.h"
#include "net/proxy_resolution/proxy_retry_info.h"
class GURL;
@@ -124,6 +125,10 @@ class NET_EXPORT NetworkDelegate {
@@ -127,6 +128,10 @@ class NET_EXPORT NetworkDelegate {
bool CanUseReportingClient(const url::Origin& origin,
const GURL& endpoint) const;
@ -22,10 +22,10 @@ index 22c428f90b16..1e0e6deaa7df 100644
THREAD_CHECKER(thread_checker_);
diff --git net/url_request/url_request_job.cc net/url_request/url_request_job.cc
index 25e971d7e6bc..2d14710ed4fe 100644
index 2dad8a230652..71666b08a212 100644
--- net/url_request/url_request_job.cc
+++ net/url_request/url_request_job.cc
@@ -447,6 +447,12 @@ void URLRequestJob::NotifyHeadersComplete() {
@@ -450,6 +450,12 @@ void URLRequestJob::NotifyHeadersComplete() {
DCHECK(!source_stream_);
source_stream_ = SetUpSourceStream();

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