Commit a028976a authored by Marshall Greenblatt's avatar Marshall Greenblatt
Browse files

Update to Chromium revision fa6a5d87 (#499098)

parent 22d2fc50
......@@ -270,7 +270,6 @@ source_set("webkit_set") {
defines = [
# Blink-internal defines.
"BLINK_IMPLEMENTATION=1",
"BLINK_WEB_IMPLEMENTATION=1",
"INSIDE_BLINK",
]
......@@ -629,8 +628,8 @@ static_library("libcef_static") {
"libcef/renderer/extensions/extensions_dispatcher_delegate.h",
"libcef/renderer/extensions/extensions_renderer_client.cc",
"libcef/renderer/extensions/extensions_renderer_client.h",
"libcef/renderer/extensions/print_web_view_helper_delegate.cc",
"libcef/renderer/extensions/print_web_view_helper_delegate.h",
"libcef/renderer/extensions/print_render_frame_helper_delegate.cc",
"libcef/renderer/extensions/print_render_frame_helper_delegate.h",
"libcef/renderer/frame_impl.cc",
"libcef/renderer/frame_impl.h",
"libcef/renderer/media/cef_key_systems.cc",
......@@ -717,7 +716,7 @@ static_library("libcef_static") {
"//components/keyed_service/content:content",
"//components/keyed_service/core:core",
"//components/navigation_interception",
"//components/network_session_configurator/common",
"//components/network_session_configurator/browser",
"//components/pdf/browser",
"//components/pdf/renderer",
"//components/plugins/renderer",
......@@ -781,6 +780,7 @@ static_library("libcef_static") {
"//third_party/widevine/cdm:headers",
"//third_party/icu",
"//third_party/zlib:minizip",
"//tools/v8_context_snapshot:v8_context_snapshot",
"//ui/base",
"//ui/base/ime",
"//ui/events:events_base",
......@@ -1078,7 +1078,7 @@ template("cef_pak_scaled") {
# Each input pak file should also have a deps line for completeness.
# Add associated .h files in the make_pack_header("resources") target.
sources = [
"$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
"$root_gen_dir/blink/public/resources/blink_scaled_resources_${percent}_percent.pak",
"$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
"$root_gen_dir/components/components_resources_${percent}_percent.pak",
"$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
......@@ -1090,7 +1090,7 @@ template("cef_pak_scaled") {
# the libcef_static target. Grit deps that generate .cc files must be
# listed both here and in the libcef_static target.
public_deps = [
"//third_party/WebKit/public:image_resources",
"//third_party/WebKit/public:scaled_resources",
"//chrome/renderer:resources",
"//components/resources:components_scaled_resources",
"//content/app/resources",
......@@ -1098,6 +1098,12 @@ template("cef_pak_scaled") {
"//ui/resources:ui_resources_grd",
]
deps = [
# This repack target generates the blink_scaled_resources_*_percent.pak
# file but doesn't expose the public_deps required by make_pack_header.
"//third_party/WebKit/public:scaled_resources_${percent}_percent",
]
if (toolkit_views) {
sources += [
"$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak"
......@@ -1265,6 +1271,7 @@ template("make_pack_header") {
make_pack_header("resources") {
header = "$root_out_dir/includes/include/cef_pack_resources.h"
inputs = [
"$root_gen_dir/blink/public/resources/grit/media_controls_resources.h",
"$root_gen_dir/blink/public/resources/grit/blink_image_resources.h",
"$root_gen_dir/blink/public/resources/grit/blink_resources.h",
"$root_gen_dir/cef/grit/cef_resources.h",
......@@ -1346,6 +1353,7 @@ if (is_mac) {
"$root_out_dir/cef_200_percent.pak",
"$root_out_dir/cef_extensions.pak",
"$root_out_dir/devtools_resources.pak",
"$root_out_dir/v8_context_snapshot.bin",
# TODO(cef): Restore this line once Widevine build errors are resolved.
# "$root_out_dir/$widevine_cdm_path/widevinecdmadapter.plugin",
]
......@@ -1358,6 +1366,7 @@ if (is_mac) {
":pak_extensions",
# TODO(cef): Restore this line once Widevine build errors are resolved.
# "//third_party/widevine/cdm:widevinecdmadapter",
"//tools/v8_context_snapshot:v8_context_snapshot",
]
if (icu_use_data_file) {
......
......@@ -7,5 +7,5 @@
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
{
'chromium_checkout': 'ff259bab28b35d242e10186cd63af7ed404fae0d',
'chromium_checkout': 'fa6a5d87adff761bc16afc5498c3f5944c1daa68',
}
......@@ -983,14 +983,12 @@ void CefBrowserHostImpl::SetAccessibilityState(
if (!web_contents_impl)
return;
content::AccessibilityMode accMode;
ui::AXMode accMode;
// In windowless mode set accessibility to TreeOnly mode. Else native
// accessibility APIs, specific to each platform, are also created.
if (accessibility_state == STATE_ENABLED) {
if (IsWindowless())
accMode = content::kAccessibilityModeWebContentsOnly;
else
accMode = content::kAccessibilityModeComplete;
accMode =
IsWindowless() ? ui::AXMode::kWebContents : ui::AXMode::kNativeAPIs;
}
web_contents_impl->SetAccessibilityMode(accMode);
}
......@@ -1609,7 +1607,7 @@ void CefBrowserHostImpl::Navigate(const CefNavigateParams& params) {
CefRequestImpl::BlinkReferrerPolicyToNetReferrerPolicy(
params.referrer.policy);
request.frame_id = params.frame_id;
request.first_party_for_cookies = params.first_party_for_cookies;
request.site_for_cookies = params.site_for_cookies;
request.headers = params.headers;
request.load_flags = params.load_flags;
request.upload_data = params.upload_data;
......@@ -2205,17 +2203,25 @@ void CefBrowserHostImpl::AddNewContents(content::WebContents* source,
void CefBrowserHostImpl::LoadingStateChanged(content::WebContents* source,
bool to_different_document) {
int current_index =
const int current_index =
web_contents_->GetController().GetLastCommittedEntryIndex();
int max_index = web_contents_->GetController().GetEntryCount() - 1;
const int max_index = web_contents_->GetController().GetEntryCount() - 1;
bool is_loading, can_go_back, can_go_forward;
const bool is_loading = web_contents_->IsLoading();
const bool can_go_back = (current_index > 0);
const bool can_go_forward = (current_index < max_index);
{
base::AutoLock lock_scope(state_lock_);
is_loading = is_loading_ = web_contents_->IsLoading();
can_go_back = can_go_back_ = (current_index > 0);
can_go_forward = can_go_forward_ = (current_index < max_index);
// This method may be called multiple times in a row with |is_loading| true
// as a result of https://crrev.com/5e750ad0. Ignore the 2nd+ times.
if (is_loading_ == is_loading)
return;
is_loading_ = is_loading;
can_go_back_ = can_go_back;
can_go_forward_ = can_go_forward;
}
if (client_.get()) {
......@@ -2754,8 +2760,7 @@ void CefBrowserHostImpl::DidFailLoad(
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) {
const base::string16& error_description) {
// The navigation failed after commit. OnLoadStart was called so we also call
// OnLoadEnd.
const bool is_main_frame = !render_frame_host->GetParent();
......
......@@ -496,8 +496,7 @@ class CefBrowserHostImpl : public CefBrowserHost,
void DidFailLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
int error_code,
const base::string16& error_description,
bool was_ignored_by_handler) override;
const base::string16& error_description) override;
void FrameDeleted(content::RenderFrameHost* render_frame_host) override;
void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override;
void PluginCrashed(const base::FilePath& plugin_path,
......
......@@ -160,14 +160,14 @@ int CefBrowserMainParts::PreCreateThreads() {
// before the IO thread is started.
content::GpuDataManager::GetInstance();
#if defined(USE_AURA)
display::Screen::SetScreenInstance(views::CreateDesktopScreen());
#endif
return 0;
}
void CefBrowserMainParts::PreMainMessageLoopRun() {
#if defined(USE_AURA)
display::Screen::SetScreenInstance(views::CreateDesktopScreen());
#endif
if (extensions::ExtensionsEnabled()) {
// Initialize extension global objects before creating the global
// BrowserContext.
......
......@@ -145,7 +145,7 @@ class CefBrowserURLRequest::Context
}
inline bool CalledOnValidThread() {
return task_runner_->RunsTasksOnCurrentThread();
return task_runner_->RunsTasksInCurrentSequence();
}
bool Start() {
......
......@@ -88,6 +88,11 @@ void ChromeBrowserProcessStub::EndSession() {
NOTREACHED();
};
void ChromeBrowserProcessStub::FlushLocalStateAndReply(
base::OnceClosure reply) {
NOTREACHED();
}
metrics_services_manager::MetricsServicesManager*
ChromeBrowserProcessStub::GetMetricsServicesManager() {
NOTREACHED();
......@@ -113,6 +118,12 @@ IOThread* ChromeBrowserProcessStub::io_thread() {
return NULL;
}
SystemNetworkContextManager*
ChromeBrowserProcessStub::system_network_context_manager() {
NOTREACHED();
return NULL;
}
WatchDogThread* ChromeBrowserProcessStub::watchdog_thread() {
NOTREACHED();
return NULL;
......@@ -321,11 +332,6 @@ ChromeBrowserProcessStub::media_file_system_registry() {
return NULL;
}
bool ChromeBrowserProcessStub::created_local_state() const {
NOTREACHED();
return false;
}
#if BUILDFLAG(ENABLE_WEBRTC)
WebRtcLogUploader* ChromeBrowserProcessStub::webrtc_log_uploader() {
NOTREACHED();
......
......@@ -42,12 +42,14 @@ class ChromeBrowserProcessStub : public BrowserProcess,
// BrowserProcess implementation.
void ResourceDispatcherHostCreated() override;
void EndSession() override;
void FlushLocalStateAndReply(base::OnceClosure reply) override;
metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager()
override;
metrics::MetricsService* metrics_service() override;
rappor::RapporServiceImpl* rappor_service() override;
ukm::UkmRecorder* ukm_recorder() override;
IOThread* io_thread() override;
SystemNetworkContextManager* system_network_context_manager() override;
WatchDogThread* watchdog_thread() override;
ProfileManager* profile_manager() override;
PrefService* local_state() override;
......@@ -98,7 +100,6 @@ class ChromeBrowserProcessStub : public BrowserProcess,
component_updater::SupervisedUserWhitelistInstaller*
supervised_user_whitelist_installer() override;
MediaFileSystemRegistry* media_file_system_registry() override;
bool created_local_state() const override;
#if BUILDFLAG(ENABLE_WEBRTC)
WebRtcLogUploader* webrtc_log_uploader() override;
#endif
......
......@@ -700,7 +700,7 @@ void CefContentBrowserClient::AppendExtraCommandLineSwitches(
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
arraysize(kSwitchNames));
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
if (!browser_cmd->HasSwitch(switches::kNoSandbox)) {
// Pass the Widevine CDM path to the Zygote process. See comments in
// CefWidevineLoader::AddPepperPlugins.
......@@ -958,7 +958,7 @@ CefContentBrowserClient::CreateThrottlesForNavigation(
void CefContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
content::FileDescriptorInfo* mappings) {
content::PosixFileDescriptorInfo* mappings) {
int crash_signal_fd = GetCrashSignalFD(command_line);
if (crash_signal_fd >= 0) {
mappings->Share(kCrashDumpSignal, crash_signal_fd);
......
......@@ -109,7 +109,7 @@ class CefContentBrowserClient : public content::ContentBrowserClient {
void GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,
int child_process_id,
content::FileDescriptorInfo* mappings) override;
content::PosixFileDescriptorInfo* mappings) override;
#endif
#if defined(OS_WIN)
......
......@@ -303,7 +303,8 @@ void CefQuitMessageLoop() {
return;
}
CefBrowserMessageLoop::current()->QuitWhenIdle();
// Quit the CefBrowserMessageLoop.
base::RunLoop::QuitCurrentWhenIdleDeprecated();
}
void CefSetOSModalLoop(bool osModalLoop) {
......@@ -499,7 +500,7 @@ void CefContext::OnContextInitialized() {
static_cast<ChromeBrowserProcessStub*>(g_browser_process)
->OnContextInitialized();
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS)
#if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_LIBRARY_CDMS)
CefWidevineLoader::GetInstance()->OnContextInitialized();
#endif
......
......@@ -88,9 +88,9 @@ int ResponseWriter::Write(net::IOBuffer* buffer,
content::BrowserThread::PostTask(
content::BrowserThread::UI, FROM_HERE,
base::Bind(&CefDevToolsFrontend::CallClientFunction, shell_devtools_,
"DevToolsAPI.streamWrite", base::Owned(id),
base::Owned(chunkValue), nullptr));
base::BindOnce(&CefDevToolsFrontend::CallClientFunction, shell_devtools_,
"DevToolsAPI.streamWrite", base::Owned(id),
base::Owned(chunkValue), nullptr));
return num_bytes;
}
......@@ -221,6 +221,8 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
scoped_refptr<content::DevToolsAgentHost> agent_host =
content::DevToolsAgentHost::GetOrCreateFor(inspected_contents_);
if (agent_host != agent_host_) {
if (agent_host_)
agent_host_->DetachClient(this);
agent_host_ = agent_host;
agent_host_->AttachClient(this);
if (!inspect_element_at_.IsEmpty()) {
......@@ -231,8 +233,10 @@ void CefDevToolsFrontend::DocumentAvailableInMainFrame() {
}
void CefDevToolsFrontend::WebContentsDestroyed() {
if (agent_host_)
if (agent_host_) {
agent_host_->DetachClient(this);
agent_host_ = nullptr;
}
delete this;
}
......@@ -270,8 +274,6 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
dict->GetList("params", &params);
if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
if (!agent_host_ || !agent_host_->IsAttached())
return;
std::string protocol_message;
if (!params->GetString(0, &protocol_message))
return;
......@@ -348,7 +350,7 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
return;
}
DictionaryPrefUpdate update(GetPrefs(), prefs::kDevToolsPreferences);
update.Get()->SetStringWithoutPathExpansion(name, value);
update.Get()->SetKey(name, base::Value(value));
} else if (method == "removePreference") {
std::string name;
if (!params->GetString(0, &name))
......
......@@ -9,7 +9,6 @@
#include <vector>
#include "libcef/browser/browser_host_impl.h"
#include "libcef/common/content_client.h"
#include "base/atomicops.h"
#include "base/bind.h"
......@@ -107,7 +106,7 @@ void CefDevToolsManagerDelegate::StartHttpHandler(
return;
content::DevToolsAgentHost::StartRemoteDebuggingServer(
std::move(socket_factory), std::string(), browser_context->GetPath(),
base::FilePath(), std::string(), CefContentClient::Get()->GetUserAgent());
base::FilePath());
}
// static
......
......@@ -216,7 +216,7 @@ void CefExtensionSystem::Init() {
// 11.The PDF extension requests a plugin to handle
// kPDFPluginOutOfProcessMimeType which loads the PDF PPAPI plugin.
// 12.Routing of print-related commands are handled by ChromePDFPrintClient
// and CefPrintWebViewHelperDelegate in the renderer process.
// and CefPrintRenderFrameHelperDelegate in the renderer process.
// 13.The PDF extension is granted access to chrome://resources via
// CefExtensionWebContentsObserver::RenderViewCreated in the browser
// process.
......
......@@ -5,8 +5,8 @@
#include "libcef/browser/extensions/extension_web_contents_observer.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/url_constants.h"
DEFINE_WEB_CONTENTS_USER_DATA_KEY(extensions::CefExtensionWebContentsObserver);
......@@ -21,15 +21,15 @@ CefExtensionWebContentsObserver::CefExtensionWebContentsObserver(
CefExtensionWebContentsObserver::~CefExtensionWebContentsObserver() {}
void CefExtensionWebContentsObserver::RenderViewCreated(
content::RenderViewHost* render_view_host) {
ExtensionWebContentsObserver::RenderViewCreated(render_view_host);
void CefExtensionWebContentsObserver::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
ExtensionWebContentsObserver::RenderFrameCreated(render_frame_host);
const Extension* extension = GetExtension(render_view_host);
const Extension* extension = GetExtensionFromFrame(render_frame_host, false);
if (!extension)
return;
int process_id = render_view_host->GetProcess()->GetID();
int process_id = render_frame_host->GetProcess()->GetID();
auto policy = content::ChildProcessSecurityPolicy::GetInstance();
// Components of chrome that are implemented as extensions or platform apps
......
......@@ -30,7 +30,7 @@ class CefExtensionWebContentsObserver
explicit CefExtensionWebContentsObserver(content::WebContents* web_contents);
// content::WebContentsObserver overrides.
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
// Our content script observers. Declare at top so that it will outlive all
// other members, since they might add themselves as observers.
......
......@@ -31,7 +31,7 @@
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_function_registry.h"
#include "extensions/browser/extension_host_delegate.h"
#include "extensions/browser/mojo/service_registration.h"
#include "extensions/browser/mojo/interface_registration.h"
#include "extensions/browser/serial_extension_host_queue.h"
#include "extensions/browser/url_request_util.h"
#include "extensions/common/constants.h"
......@@ -257,10 +257,12 @@ void CefExtensionsBrowserClient::RegisterExtensionFunctions(
api::cef::ChromeFunctionRegistry::RegisterAll(registry);
}
void CefExtensionsBrowserClient::RegisterMojoServices(
void CefExtensionsBrowserClient::RegisterExtensionInterfaces(
service_manager::BinderRegistryWithArgs<content::RenderFrameHost*>*
registry,
content::RenderFrameHost* render_frame_host,
const Extension* extension) const {
RegisterServicesForFrame(render_frame_host, extension);
RegisterInterfacesForExtension(registry, render_frame_host, extension);
}
std::unique_ptr<RuntimeAPIDelegate>
......@@ -320,6 +322,10 @@ bool CefExtensionsBrowserClient::IsLockScreenContext(
return false;
}
std::string CefExtensionsBrowserClient::GetApplicationLocale() {
return g_browser_process->GetApplicationLocale();
}
ExtensionHostQueue* CefExtensionsBrowserClient::GetExtensionHostQueue() {
if (!extension_host_queue_)
extension_host_queue_.reset(new SerialExtensionHostQueue);
......
......@@ -73,8 +73,10 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
ExtensionSystemProvider* GetExtensionSystemFactory() override;
void RegisterExtensionFunctions(
ExtensionFunctionRegistry* registry) const override;
void RegisterMojoServices(content::RenderFrameHost* render_frame_host,
const Extension* extension) const override;
void RegisterExtensionInterfaces(service_manager::BinderRegistryWithArgs<
content::RenderFrameHost*>* registry,
content::RenderFrameHost* render_frame_host,
const Extension* extension) const override;
std::unique_ptr<RuntimeAPIDelegate> CreateRuntimeAPIDelegate(
content::BrowserContext* context) const override;
const ComponentExtensionResourceManager*
......@@ -91,6 +93,7 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
content::WebContents* web_contents) override;
KioskDelegate* GetKioskDelegate() override;
bool IsLockScreenContext(content::BrowserContext* context) override;
std::string GetApplicationLocale() override;
ExtensionHostQueue* GetExtensionHostQueue();
......
......@@ -319,8 +319,7 @@ bool CefImageImpl::AddBitmap(float scale_factor, const SkBitmap& bitmap) {
gfx::ImageSkiaRep skia_rep(bitmap, scale_factor);
if (image_.IsEmpty()) {
gfx::Image image((gfx::ImageSkia(skia_rep)));
image_.SwapRepresentations(&image);
image_ = gfx::Image(gfx::ImageSkia(skia_rep));
} else {
image_.AsImageSkia().AddRepresentation(skia_rep);
}
......
......@@ -38,9 +38,9 @@ struct CefNavigateParams {
// Usually the URL of the document in the top-level window, which may be
// checked by the third-party cookie blocking policy. Leaving it empty may
// lead to undesired cookie blocking. Third-party cookie blocking can be
// bypassed by setting first_party_for_cookies = url, but this should ideally
// bypassed by setting site_for_cookies = url, but this should ideally
// only be done if there really is no way to determine the correct value.
GURL first_party_for_cookies;
GURL site_for_cookies;
// Additional HTTP request headers.
std::string headers;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment