Update to Chromium version 90.0.4430.0 (#857950)

- Linux ARM builds require use_vaapi=false (see https://crbug.com/1185348)
- Windows official builds require use_thin_lto=false (see https://crbug.com/1177001)
This commit is contained in:
Marshall Greenblatt 2021-03-04 17:36:57 -05:00
parent 1587d6da03
commit 74db00fc89
134 changed files with 1245 additions and 1204 deletions

View File

@ -1356,14 +1356,10 @@ make_pack_header("resources") {
"$root_gen_dir/chrome/grit/common_resources.h",
"$root_gen_dir/chrome/grit/component_extension_resources.h",
"$root_gen_dir/chrome/grit/dev_ui_browser_resources.h",
"$root_gen_dir/chrome/grit/net_internals_resources.h",
"$root_gen_dir/chrome/grit/pdf_resources.h",
"$root_gen_dir/chrome/grit/print_preview_resources.h",
"$root_gen_dir/chrome/grit/renderer_resources.h",
"$root_gen_dir/components/grit/components_resources.h",
"$root_gen_dir/components/grit/dev_ui_components_resources.h",
"$root_gen_dir/content/browser/devtools/grit/devtools_resources.h",
"$root_gen_dir/content/browser/resources/media/grit/media_internals_resources.h",
"$root_gen_dir/content/browser/tracing/grit/tracing_resources.h",
"$root_gen_dir/content/browser/webrtc/resources/grit/webrtc_internals_resources.h",
"$root_gen_dir/content/grit/content_resources.h",
@ -1385,15 +1381,11 @@ make_pack_header("resources") {
"//chrome/browser:dev_ui_browser_resources",
"//chrome/browser:resources",
"//chrome/browser/resources:component_extension_resources",
"//chrome/browser/resources/net_internals:net_internals_resources",
"//chrome/browser/resources/pdf:pdf_resources",
"//chrome/browser/resources/print_preview:print_preview_resources",
"//chrome/common:resources",
"//chrome/renderer:resources",
"//components/resources:components_resources",
"//components/resources:dev_ui_components_resources",
"//content/browser/devtools:devtools_resources",
"//content/browser/resources/media:media_internals_resources",
"//content/browser/tracing:resources",
"//content/browser/webrtc/resources",
"//content:content_resources",

View File

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

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=bd04d49bcd5d269f237c92163b40435d5588209b$
// $hash=175779df75a1405fcc5c337a09e6322c556698ba$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CONTEXT_MENU_HANDLER_CAPI_H_
@ -294,11 +294,6 @@ typedef struct _cef_context_menu_params_t {
// items).
///
int(CEF_CALLBACK* is_custom_menu)(struct _cef_context_menu_params_t* self);
///
// Returns true (1) if the context menu was invoked from a pepper plugin.
///
int(CEF_CALLBACK* is_pepper_menu)(struct _cef_context_menu_params_t* self);
} cef_context_menu_params_t;
#ifdef __cplusplus

View File

@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "89715b43c948313782d2546131f510eab1975844"
#define CEF_API_HASH_UNIVERSAL "694bc8d68956bd174529f72fea5710929ac8bbf0"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "80648a2c5a87db1581fdb994b7154ed77d74a3c5"
#define CEF_API_HASH_PLATFORM "597ae4ad020de2665469e7de990d784bfda8d514"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "3af393a2bf165edd934c5a59f6e6fce8a4bb579c"
#define CEF_API_HASH_PLATFORM "fa3b4a918791bf53a4a8715ac9f0c843a3c08061"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "8049cab9a43c1d554ccdd4dd3d5e38ecebce42af"
#define CEF_API_HASH_PLATFORM "83ff6d6fb2e0ac8447f68fa6141091cc9f666ca0"
#endif
#ifdef __cplusplus

View File

@ -281,12 +281,6 @@ class CefContextMenuParams : public virtual CefBaseRefCounted {
///
/*--cef()--*/
virtual bool IsCustomMenu() = 0;
///
// Returns true if the context menu was invoked from a pepper plugin.
///
/*--cef()--*/
virtual bool IsPepperMenu() = 0;
};
#endif // CEF_INCLUDE_CEF_CONTEXT_MENU_HANDLER_H_

View File

@ -298,6 +298,7 @@ AlloyBrowserContext::GetClientHintsControllerDelegate() {
}
void AlloyBrowserContext::SetCorsOriginAccessListForOrigin(
TargetBrowserContexts target_mode,
const url::Origin& source_origin,
std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
@ -437,6 +438,11 @@ AlloyBrowserContext::GetProfilePolicyConnector() const {
return nullptr;
}
bool AlloyBrowserContext::IsNewProfile() const {
NOTREACHED();
return false;
}
void AlloyBrowserContext::RebuildTable(
const scoped_refptr<URLEnumerator>& enumerator) {
// Called when visited links will not or cannot be loaded from disk.

View File

@ -59,6 +59,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate()
override;
void SetCorsOriginAccessListForOrigin(
TargetBrowserContexts target_mode,
const url::Origin& source_origin,
std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
@ -94,6 +95,7 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
policy::ProfilePolicyConnector* GetProfilePolicyConnector() override;
const policy::ProfilePolicyConnector* GetProfilePolicyConnector()
const override;
bool IsNewProfile() const override;
// Values checked in ProfileNetworkContextService::CreateNetworkContextParams
// when creating the NetworkContext.

View File

@ -1251,6 +1251,11 @@ void AlloyBrowserHostImpl::CloseContents(content::WebContents* source) {
// destroyed.
CefRefPtr<AlloyBrowserHostImpl> browser(this);
if (source) {
// Try to fast shutdown the associated process.
source->GetMainFrame()->GetProcess()->FastShutdownIfPossible(1, false);
}
// No window exists. Destroy the browser immediately. Don't call other
// browser methods after calling DestroyBrowser().
DestroyBrowser();
@ -1549,11 +1554,13 @@ void AlloyBrowserHostImpl::ExitPictureInPicture() {
// content::WebContentsObserver methods.
// -----------------------------------------------------------------------------
void AlloyBrowserHostImpl::RenderViewCreated(
content::RenderViewHost* render_view_host) {
new CefWidgetHostInterceptor(this, render_view_host);
platform_delegate_->RenderViewCreated(render_view_host);
void AlloyBrowserHostImpl::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
if (render_frame_host->GetParent() == nullptr) {
auto render_view_host = render_frame_host->GetRenderViewHost();
new CefWidgetHostInterceptor(this, render_view_host);
platform_delegate_->RenderViewCreated(render_view_host);
}
}
void AlloyBrowserHostImpl::RenderViewReady() {
@ -1672,8 +1679,8 @@ AlloyBrowserHostImpl::AlloyBrowserHostImpl(
// Associate the platform delegate with this browser.
platform_delegate_->BrowserCreated(this);
// Make sure RenderViewCreated is called at least one time.
RenderViewCreated(web_contents->GetRenderViewHost());
// Make sure RenderFrameCreated is called at least one time.
RenderFrameCreated(web_contents->GetMainFrame());
}
bool AlloyBrowserHostImpl::CreateHostWindow() {

View File

@ -306,7 +306,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
// content::WebContentsObserver methods.
using content::WebContentsObserver::BeforeUnloadFired;
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void RenderFrameCreated(content::RenderFrameHost* render_frame_host) override;
void RenderViewReady() override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;

View File

@ -52,7 +52,6 @@
#include "chrome/browser/chrome_browser_main_win.h"
#include "chrome/browser/win/parental_controls.h"
#include "components/os_crypt/os_crypt.h"
#include "ui/base/cursor/cursor_loader_win.h"
#endif
#endif // defined(USE_AURA)
@ -97,11 +96,6 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
CHECK(aura::Env::GetInstance());
wm_state_.reset(new wm::WMState);
#if defined(OS_WIN)
ui::CursorLoaderWin::SetCursorResourceModule(
CefAppManager::Get()->GetResourceDllName());
#endif
#endif // defined(USE_AURA)
#if defined(TOOLKIT_VIEWS)

View File

@ -51,7 +51,6 @@
#include "base/threading/thread_restrictions.h"
#include "cef/grit/cef_resources.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
@ -74,6 +73,8 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/services/printing/printing_service.h"
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/embedder_support/switches.h"
#include "components/embedder_support/user_agent_utils.h"
#include "components/spellcheck/common/spellcheck.mojom.h"
#include "components/version_info/version_info.h"
#include "content/browser/plugin_service_impl.h"
@ -696,7 +697,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kLogSeverity,
switches::kProductVersion,
switches::kResourcesDirPath,
switches::kUserAgent,
embedder_support::kUserAgent,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
base::size(kSwitchNames));
@ -950,8 +951,10 @@ bool AlloyContentBrowserClient::CanCreateWindow(
}
void AlloyContentBrowserClient::OverrideWebkitPrefs(
content::RenderViewHost* rvh,
content::WebContents* web_contents,
blink::web_pref::WebPreferences* prefs) {
auto rvh = web_contents->GetRenderViewHost();
// Using RVH instead of RFH here because rvh->GetMainFrame() may be nullptr
// when this method is called.
renderer_prefs::PopulateWebPreferences(rvh, *prefs);
@ -1009,7 +1012,7 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
// Used to substitute View ID for PDF contents when using the PDF plugin.
result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>(
request.resource_type, frame_tree_node_id));
request.destination, frame_tree_node_id));
Profile* profile = Profile::FromBrowserContext(browser_context);
@ -1035,13 +1038,6 @@ void AlloyContentBrowserClient::GetAdditionalMappedFilesForChildProcess(
}
#endif // defined(OS_LINUX)
#if defined(OS_WIN)
bool AlloyContentBrowserClient::PreSpawnRenderer(sandbox::TargetPolicy* policy,
RendererSpawnFlags flags) {
return true;
}
#endif // defined(OS_WIN)
void AlloyContentBrowserClient::ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry,
blink::AssociatedInterfaceRegistry* associated_registry,
@ -1191,7 +1187,8 @@ void AlloyContentBrowserClient::ConfigureNetworkContextParams(
bool in_memory,
const base::FilePath& relative_partition_path,
network::mojom::NetworkContextParams* network_context_params,
network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) {
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) {
// This method may be called during shutdown when using multi-threaded
// message loop mode. In that case exit early to avoid crashes.
if (!SystemNetworkContextManager::GetInstance()) {
@ -1325,8 +1322,7 @@ AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() {
}
std::string AlloyContentBrowserClient::GetProduct() {
// Match the logic in chrome_content_browser_client.cc GetProduct().
return ::GetProduct();
return embedder_support::GetProduct();
}
std::string AlloyContentBrowserClient::GetChromeProduct() {
@ -1334,8 +1330,7 @@ std::string AlloyContentBrowserClient::GetChromeProduct() {
}
std::string AlloyContentBrowserClient::GetUserAgent() {
// Match the logic in chrome_content_browser_client.cc GetUserAgent().
return ::GetUserAgent();
return embedder_support::GetUserAgent();
}
blink::UserAgentMetadata AlloyContentBrowserClient::GetUserAgentMetadata() {

View File

@ -101,7 +101,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool user_gesture,
bool opener_suppressed,
bool* no_javascript_access) override;
void OverrideWebkitPrefs(content::RenderViewHost* rvh,
void OverrideWebkitPrefs(content::WebContents* web_contents,
blink::web_pref::WebPreferences* prefs) override;
bool OverrideWebPreferencesAfterNavigation(
content::WebContents* web_contents,
@ -128,11 +128,6 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
content::PosixFileDescriptorInfo* mappings) override;
#endif
#if defined(OS_WIN)
bool PreSpawnRenderer(sandbox::TargetPolicy* policy,
RendererSpawnFlags flags) override;
#endif
void ExposeInterfacesToRenderer(
service_manager::BinderRegistry* registry,
blink::AssociatedInterfaceRegistry* associated_registry,
@ -177,8 +172,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
bool in_memory,
const base::FilePath& relative_partition_path,
network::mojom::NetworkContextParams* network_context_params,
network::mojom::CertVerifierCreationParams* cert_verifier_creation_params)
override;
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) override;
std::vector<base::FilePath> GetNetworkContextsParentDirectory() override;
bool HandleExternalProtocol(
const GURL& url,

View File

@ -206,7 +206,7 @@ void CefBrowserPlatformDelegateAlloy::CreateExtensionHost(
extension_host_ = new extensions::CefExtensionViewHost(
alloy_browser, extension, web_contents_, url, host_type);
// Trigger load of the extension URL.
extension_host_->CreateRenderViewSoon();
extension_host_->CreateRendererSoon();
} else if (host_type == extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE) {
is_background_host_ = true;
alloy_browser->is_background_host_ = true;

View File

@ -128,11 +128,6 @@ metrics::MetricsService* ChromeBrowserProcessAlloy::metrics_service() {
return nullptr;
}
rappor::RapporServiceImpl* ChromeBrowserProcessAlloy::rappor_service() {
// Called from PluginInfoHostImpl::ReportMetrics.
return nullptr;
}
SystemNetworkContextManager*
ChromeBrowserProcessAlloy::system_network_context_manager() {
DCHECK(SystemNetworkContextManager::GetInstance());

View File

@ -44,7 +44,6 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
metrics_services_manager::MetricsServicesManager* GetMetricsServicesManager()
override;
metrics::MetricsService* metrics_service() override;
rappor::RapporServiceImpl* rappor_service() override;
SystemNetworkContextManager* system_network_context_manager() override;
network::NetworkQualityTracker* network_quality_tracker() override;
WatchDogThread* watchdog_thread() override;

View File

@ -109,10 +109,6 @@ bool ChromeProfileAlloy::IsChild() const {
return false;
}
bool ChromeProfileAlloy::IsLegacySupervised() const {
return false;
}
ExtensionSpecialStoragePolicy*
ChromeProfileAlloy::GetExtensionSpecialStoragePolicy() {
NOTREACHED();

View File

@ -37,7 +37,6 @@ class ChromeProfileAlloy : public Profile {
const Profile* GetOriginalProfile() const override;
bool IsSupervised() const override;
bool IsChild() const override;
bool IsLegacySupervised() const override;
ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override;
PrefService* GetOffTheRecordPrefs() override;
bool IsSameOrParent(Profile* profile) override;

View File

@ -41,9 +41,7 @@ void CefBrowserContentsDelegate::ObserveWebContents(
content::Source<content::NavigationController>(
&new_contents->GetController()));
// Make sure RenderViewCreated is called at least one time.
RenderViewCreated(new_contents->GetRenderViewHost());
// Make sure RenderFrameCreated is called at least one time.
// Create the frame representation before OnAfterCreated is called for a new
// browser. Additionally, RenderFrameCreated is otherwise not called at all
// for new popup browsers.
@ -229,6 +227,18 @@ bool CefBrowserContentsDelegate::HandleKeyboardEvent(
void CefBrowserContentsDelegate::RenderFrameCreated(
content::RenderFrameHost* render_frame_host) {
browser_info_->MaybeCreateFrame(render_frame_host, false /* is_guest_view */);
if (render_frame_host->GetParent() == nullptr) {
// May be already registered if the renderer crashed previously.
auto render_view_host = render_frame_host->GetRenderViewHost();
if (!registrar_->IsRegistered(
this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
content::Source<content::RenderViewHost>(render_view_host))) {
registrar_->Add(
this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
content::Source<content::RenderViewHost>(render_view_host));
}
}
}
void CefBrowserContentsDelegate::RenderFrameHostChanged(
@ -249,17 +259,6 @@ void CefBrowserContentsDelegate::RenderFrameDeleted(
}
}
void CefBrowserContentsDelegate::RenderViewCreated(
content::RenderViewHost* render_view_host) {
// May be already registered if the renderer crashed previously.
if (!registrar_->IsRegistered(
this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
content::Source<content::RenderViewHost>(render_view_host))) {
registrar_->Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE,
content::Source<content::RenderViewHost>(render_view_host));
}
}
void CefBrowserContentsDelegate::RenderViewDeleted(
content::RenderViewHost* render_view_host) {
if (registrar_->IsRegistered(

View File

@ -108,7 +108,6 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
void RenderFrameHostChanged(content::RenderFrameHost* old_host,
content::RenderFrameHost* new_host) override;
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
void RenderViewDeleted(content::RenderViewHost* render_view_host) override;
void RenderViewReady() override;
void RenderProcessGone(base::TerminationStatus status) override;

View File

@ -422,6 +422,8 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
content::RenderProcessHost* host) {
CEF_REQUIRE_UIT();
host->RemoveObserver(this);
const int render_process_id = host->GetID();
DCHECK_GT(render_process_id, 0);

View File

@ -249,7 +249,8 @@ void ChromeContentBrowserClientCef::ConfigureNetworkContextParams(
bool in_memory,
const base::FilePath& relative_partition_path,
network::mojom::NetworkContextParams* network_context_params,
network::mojom::CertVerifierCreationParams* cert_verifier_creation_params) {
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) {
ChromeContentBrowserClient::ConfigureNetworkContextParams(
context, in_memory, relative_partition_path, network_context_params,
cert_verifier_creation_params);

View File

@ -80,8 +80,8 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
bool in_memory,
const base::FilePath& relative_partition_path,
network::mojom::NetworkContextParams* network_context_params,
network::mojom::CertVerifierCreationParams* cert_verifier_creation_params)
override;
cert_verifier::mojom::CertVerifierCreationParams*
cert_verifier_creation_params) override;
std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,

View File

@ -5,6 +5,7 @@
#include "libcef/browser/context_menu_params_impl.h"
#include "base/logging.h"
#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h"
CefContextMenuParamsImpl::CefContextMenuParamsImpl(
content::ContextMenuParams* value)
@ -146,8 +147,3 @@ bool CefContextMenuParamsImpl::IsCustomMenu() {
CEF_VALUE_VERIFY_RETURN(false, false);
return !const_value().custom_items.empty();
}
bool CefContextMenuParamsImpl::IsPepperMenu() {
CEF_VALUE_VERIFY_RETURN(false, false);
return const_value().custom_context.is_pepper_menu;
}

View File

@ -38,7 +38,6 @@ class CefContextMenuParamsImpl
bool IsSpellCheckEnabled() override;
EditStateFlags GetEditStateFlags() override;
bool IsCustomMenu() override;
bool IsPepperMenu() override;
DISALLOW_COPY_AND_ASSIGN(CefContextMenuParamsImpl);
};

View File

@ -65,15 +65,15 @@ CefComponentExtensionResourceManager::GetTemplateReplacementsForExtension(
}
void CefComponentExtensionResourceManager::AddComponentResourceEntries(
const GritResourceMap* entries,
const webui::ResourcePath* entries,
size_t size) {
for (size_t i = 0; i < size; ++i) {
base::FilePath resource_path =
base::FilePath().AppendASCII(entries[i].name);
base::FilePath().AppendASCII(entries[i].path);
resource_path = resource_path.NormalizePathSeparators();
DCHECK(!base::Contains(path_to_resource_info_, resource_path));
path_to_resource_info_[resource_path] = entries[i].value;
path_to_resource_info_[resource_path] = entries[i].id;
}
}

View File

@ -11,7 +11,9 @@
#include "base/macros.h"
#include "extensions/browser/component_extension_resource_manager.h"
struct GritResourceMap;
namespace webui {
struct ResourcePath;
}
namespace extensions {
@ -29,7 +31,8 @@ class CefComponentExtensionResourceManager
const std::string& extension_id) const override;
private:
void AddComponentResourceEntries(const GritResourceMap* entries, size_t size);
void AddComponentResourceEntries(const webui::ResourcePath* entries,
size_t size);
// A map from a resource path to the resource ID. Used by
// IsComponentExtensionResource.

View File

@ -20,7 +20,7 @@ CefExtensionHostDelegate::~CefExtensionHostDelegate() {}
void CefExtensionHostDelegate::OnExtensionHostCreated(
content::WebContents* web_contents) {}
void CefExtensionHostDelegate::OnRenderViewCreatedForBackgroundPage(
void CefExtensionHostDelegate::OnMainFrameCreatedForBackgroundPage(
ExtensionHost* host) {}
content::JavaScriptDialogManager*

View File

@ -19,7 +19,7 @@ class CefExtensionHostDelegate : public ExtensionHostDelegate {
// ExtensionHostDelegate implementation.
void OnExtensionHostCreated(content::WebContents* web_contents) override;
void OnRenderViewCreatedForBackgroundPage(ExtensionHost* host) override;
void OnMainFrameCreatedForBackgroundPage(ExtensionHost* host) override;
content::JavaScriptDialogManager* GetJavaScriptDialogManager() override;
void CreateTab(std::unique_ptr<content::WebContents> web_contents,
const std::string& extension_id,

View File

@ -407,7 +407,7 @@ ServiceWorkerManager* CefExtensionSystem::service_worker_manager() {
return service_worker_manager_.get();
}
SharedUserScriptManager* CefExtensionSystem::shared_user_script_manager() {
UserScriptManager* CefExtensionSystem::user_script_manager() {
return nullptr;
}

View File

@ -87,7 +87,7 @@ class CefExtensionSystem : public ExtensionSystem {
RuntimeData* runtime_data() override;
ManagementPolicy* management_policy() override;
ServiceWorkerManager* service_worker_manager() override;
SharedUserScriptManager* shared_user_script_manager() override;
UserScriptManager* user_script_manager() override;
StateStore* state_store() override;
StateStore* rules_store() override;
scoped_refptr<ValueStoreFactory> store_factory() override;

View File

@ -263,7 +263,7 @@ void CefMenuManager::MenuClosed(CefRefPtr<CefMenuModelImpl> source) {
// Notify the host after closing the context menu.
web_contents()->SetShowingContextMenu(false);
web_contents()->NotifyContextMenuClosed(params_.custom_context);
web_contents()->NotifyContextMenuClosed(params_.link_followed);
}
bool CefMenuManager::FormatLabel(CefRefPtr<CefMenuModelImpl> source,
@ -287,11 +287,11 @@ void CefMenuManager::CreateDefaultModel() {
if (!params_.custom_items.empty()) {
// Custom menu items originating from the renderer process. For example,
// plugin placeholder menu items.
for (size_t i = 0; i < params_.custom_items.size(); ++i) {
content::MenuItem menu_item = params_.custom_items[i];
menu_item.action += MENU_ID_CUSTOM_FIRST;
DCHECK_LE(static_cast<int>(menu_item.action), MENU_ID_CUSTOM_LAST);
model_->AddMenuItem(menu_item);
for (auto& item : params_.custom_items) {
auto new_item = item->Clone();
new_item->action += MENU_ID_CUSTOM_FIRST;
DCHECK_LE(static_cast<int>(new_item->action), MENU_ID_CUSTOM_LAST);
model_->AddMenuItem(*new_item);
}
return;
}
@ -375,7 +375,7 @@ void CefMenuManager::ExecuteDefaultCommand(int command_id) {
if (IsCustomContextMenuCommand(command_id)) {
if (web_contents()) {
web_contents()->ExecuteCustomContextMenuCommand(
command_id - MENU_ID_CUSTOM_FIRST, params_.custom_context);
command_id - MENU_ID_CUSTOM_FIRST, params_.link_followed);
}
return;
}
@ -465,7 +465,7 @@ bool CefMenuManager::IsCustomContextMenuCommand(int command_id) {
// Verify that the specific command ID was passed from the renderer process.
if (!params_.custom_items.empty()) {
for (size_t i = 0; i < params_.custom_items.size(); ++i) {
if (static_cast<int>(params_.custom_items[i].action) == command_id)
if (static_cast<int>(params_.custom_items[i]->action) == command_id)
return true;
}
}

View File

@ -12,7 +12,7 @@
#include "base/bind.h"
#include "base/logging.h"
#include "content/public/common/menu_item.h"
#include "third_party/blink/public/mojom/context_menu/context_menu.mojom.h"
#include "ui/base/accelerators/accelerator.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/geometry/point.h"
@ -927,37 +927,40 @@ bool CefMenuModelImpl::VerifyRefCount() {
return true;
}
void CefMenuModelImpl::AddMenuItem(const content::MenuItem& menu_item) {
void CefMenuModelImpl::AddMenuItem(
const blink::mojom::CustomContextMenuItem& menu_item) {
const int command_id = static_cast<int>(menu_item.action);
switch (menu_item.type) {
case content::MenuItem::OPTION:
case blink::mojom::CustomContextMenuItemType::kOption:
AddItem(command_id, menu_item.label);
break;
case content::MenuItem::CHECKABLE_OPTION:
case blink::mojom::CustomContextMenuItemType::kCheckableOption:
AddCheckItem(command_id, menu_item.label);
break;
case content::MenuItem::GROUP:
case blink::mojom::CustomContextMenuItemType::kGroup:
AddRadioItem(command_id, menu_item.label, 0);
break;
case content::MenuItem::SEPARATOR:
case blink::mojom::CustomContextMenuItemType::kSeparator:
AddSeparator();
break;
case content::MenuItem::SUBMENU: {
case blink::mojom::CustomContextMenuItemType::kSubMenu: {
CefRefPtr<CefMenuModelImpl> sub_menu = static_cast<CefMenuModelImpl*>(
AddSubMenu(command_id, menu_item.label).get());
for (size_t i = 0; i < menu_item.submenu.size(); ++i)
sub_menu->AddMenuItem(menu_item.submenu[i]);
sub_menu->AddMenuItem(*menu_item.submenu[i]);
break;
}
}
if (!menu_item.enabled && menu_item.type != content::MenuItem::SEPARATOR)
if (!menu_item.enabled &&
menu_item.type != blink::mojom::CustomContextMenuItemType::kSeparator)
SetEnabled(command_id, false);
if (menu_item.checked &&
(menu_item.type == content::MenuItem::CHECKABLE_OPTION ||
menu_item.type == content::MenuItem::GROUP)) {
(menu_item.type ==
blink::mojom::CustomContextMenuItemType::kCheckableOption ||
menu_item.type == blink::mojom::CustomContextMenuItemType::kGroup)) {
SetChecked(command_id, true);
}
}

View File

@ -13,13 +13,10 @@
#include "include/cef_menu_model_delegate.h"
#include "base/threading/platform_thread.h"
#include "third_party/blink/public/mojom/context_menu/context_menu.mojom-forward.h"
#include "ui/base/models/menu_model.h"
#include "ui/gfx/font_list.h"
namespace content {
struct MenuItem;
}
class CefMenuModelImpl : public CefMenuModel {
public:
class Delegate {
@ -176,7 +173,7 @@ class CefMenuModelImpl : public CefMenuModel {
bool VerifyRefCount();
// Helper for adding custom menu items originating from the renderer process.
void AddMenuItem(const content::MenuItem& menu_item);
void AddMenuItem(const blink::mojom::CustomContextMenuItem& menu_item);
ui::MenuModel* model() const { return model_.get(); }

View File

@ -7,6 +7,7 @@
#include "libcef/browser/browser_host_base.h"
#include "content/common/cursors/webcursor.h"
#include "ui/base/cursor/cursor_factory.h"
#include "ui/base/cursor/mojom/cursor_type.mojom.h"
namespace cursor_util {
@ -34,19 +35,24 @@ bool OnCursorChange(CefBrowserHostBase* browser, const ui::Cursor& ui_cursor) {
bool handled = false;
#if defined(USE_AURA)
content::WebCursor web_cursor(ui_cursor);
CefCursorHandle platform_cursor;
ui::PlatformCursor image_cursor = nullptr;
if (ui_cursor.type() == ui::mojom::CursorType::kCustom) {
// |web_cursor| owns the resulting |platform_cursor|.
platform_cursor =
cursor_util::ToCursorHandle(web_cursor.GetPlatformCursor(ui_cursor));
image_cursor = ui::CursorFactory::GetInstance()->CreateImageCursor(
ui::mojom::CursorType::kCustom, ui_cursor.custom_bitmap(),
ui_cursor.custom_hotspot());
platform_cursor = cursor_util::ToCursorHandle(image_cursor);
} else {
platform_cursor = cursor_util::GetPlatformCursor(ui_cursor.type());
}
handled = handler->OnCursorChange(browser, platform_cursor, cursor_type,
custom_cursor_info);
if (image_cursor) {
ui::CursorFactory::GetInstance()->UnrefImageCursor(image_cursor);
}
#elif defined(OS_MAC)
// |web_cursor| owns the resulting |native_cursor|.
content::WebCursor web_cursor(ui_cursor);

View File

@ -9,6 +9,7 @@
#include "libcef/common/app_manager.h"
#include "ui/base/cursor/mojom/cursor_type.mojom.h"
#include "ui/base/cursor/win/win_cursor.h"
#include "ui/resources/grit/ui_unscaled_resources.h"
namespace cursor_util {
@ -152,7 +153,7 @@ cef_cursor_handle_t GetPlatformCursor(ui::mojom::CursorType type) {
}
cef_cursor_handle_t ToCursorHandle(ui::PlatformCursor cursor) {
return cursor;
return static_cast<ui::WinCursor*>(cursor)->hcursor();
}
} // namespace cursor_util

View File

@ -304,7 +304,7 @@ class CefNativeMenuWin::MenuHostWindow {
DCHECK(type != ui::MenuModel::TYPE_CHECK);
std::unique_ptr<SkCanvas> canvas = skia::CreatePlatformCanvas(
skia_icon.width(), skia_icon.height(), false);
canvas->drawBitmap(*skia_icon.bitmap(), 0, 0);
canvas->drawImage(skia_icon.bitmap()->asImage(), 0, 0);
DrawToNativeContext(
canvas.get(), dc, draw_item_struct->rcItem.left + kItemLeftMargin,
draw_item_struct->rcItem.top +

View File

@ -22,6 +22,9 @@
#include "base/logging.h"
#include "base/memory/weak_ptr.h"
#include "base/strings/string_util.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/storage_partition_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/global_request_id.h"
#include "content/public/browser/render_frame_host.h"
#include "net/base/mime_util.h"
@ -49,6 +52,10 @@ int32_t MakeRequestID() {
return --request_id;
}
bool IsValidRequestID(int32_t request_id) {
return request_id < kInitialRequestID;
}
// Manages the mapping of request IDs to request objects.
class RequestManager {
public:
@ -190,9 +197,16 @@ class CefBrowserURLRequest::Context
CefBrowserContext* cef_browser_context =
request_context_impl->GetBrowserContext();
DCHECK(cef_browser_context);
auto browser_context = cef_browser_context->AsBrowserContext();
int render_frame_id = MSG_ROUTING_NONE;
scoped_refptr<net_service::URLLoaderFactoryGetter> loader_factory_getter;
// Used to route authentication and certificate callbacks through the
// associated StoragePartition instance.
mojo::PendingRemote<network::mojom::AuthenticationAndCertificateObserver>
auth_cert_observer;
if (frame) {
// The request will be associated with this frame/browser if it's valid,
// otherwise the request will be canceled.
@ -207,26 +221,35 @@ class CefBrowserURLRequest::Context
// network::mojom::kBrowserProcessId (value 0) for these requests.
render_frame_id = rfh->GetFrameTreeNodeId();
loader_factory_getter = net_service::URLLoaderFactoryGetter::Create(
rfh, cef_browser_context->AsBrowserContext());
loader_factory_getter =
net_service::URLLoaderFactoryGetter::Create(rfh, browser_context);
auth_cert_observer = static_cast<content::RenderFrameHostImpl*>(rfh)
->CreateAuthAndCertObserver();
}
} else {
loader_factory_getter = net_service::URLLoaderFactoryGetter::Create(
nullptr, cef_browser_context->AsBrowserContext());
loader_factory_getter =
net_service::URLLoaderFactoryGetter::Create(nullptr, browser_context);
auth_cert_observer =
static_cast<content::StoragePartitionImpl*>(
content::BrowserContext::GetDefaultStoragePartition(
browser_context))
->CreateAuthCertObserverForServiceWorker();
}
task_runner->PostTask(
FROM_HERE,
base::BindOnce(
&CefBrowserURLRequest::Context::ContinueOnOriginatingThread, self,
render_frame_id, MakeRequestID(), loader_factory_getter));
render_frame_id, MakeRequestID(), loader_factory_getter,
std::move(auth_cert_observer)));
}
void ContinueOnOriginatingThread(
int render_frame_id,
int32_t request_id,
scoped_refptr<net_service::URLLoaderFactoryGetter>
loader_factory_getter) {
scoped_refptr<net_service::URLLoaderFactoryGetter> loader_factory_getter,
mojo::PendingRemote<network::mojom::AuthenticationAndCertificateObserver>
auth_cert_observer) {
DCHECK(CalledOnValidThread());
// The request may have been canceled.
@ -268,6 +291,13 @@ class CefBrowserURLRequest::Context
net::SiteForCookies::FromOrigin(*resource_request->request_initiator);
}
if (auth_cert_observer) {
resource_request->trusted_params =
network::ResourceRequest::TrustedParams();
resource_request->trusted_params->auth_cert_observer =
std::move(auth_cert_observer);
}
// SimpleURLLoader is picky about the body contents. Try to populate them
// correctly below.
auto request_body = resource_request->request_body;
@ -573,17 +603,17 @@ class CefBrowserURLRequest::Context
// static
base::Optional<CefBrowserURLRequest::RequestInfo>
CefBrowserURLRequest::FromRequestID(int32_t request_id) {
return g_manager.Get().Get(request_id);
if (IsValidRequestID(request_id)) {
return g_manager.Get().Get(request_id);
}
return base::nullopt;
}
// static
base::Optional<CefBrowserURLRequest::RequestInfo>
CefBrowserURLRequest::FromRequestID(
const content::GlobalRequestID& request_id) {
if (request_id.child_id == network::mojom::kBrowserProcessId) {
return FromRequestID(request_id.request_id);
}
return base::nullopt;
return FromRequestID(request_id.request_id);
}
CefBrowserURLRequest::CefBrowserURLRequest(

View File

@ -36,6 +36,10 @@ net::CookieOptions GetCookieOptions(const network::ResourceRequest& request) {
bool should_treat_as_first_party =
request.url.SchemeIsCryptographic() &&
request.site_for_cookies.scheme() == content::kChromeUIScheme;
bool is_main_frame_navigation =
request.trusted_params &&
request.trusted_params->isolation_info.request_type() ==
net::IsolationInfo::RequestType::kMainFrame;
// Match the logic from URLRequestHttpJob::AddCookieHeaderAndStart.
net::CookieOptions options;
@ -43,7 +47,8 @@ net::CookieOptions GetCookieOptions(const network::ResourceRequest& request) {
options.set_same_site_cookie_context(
net::cookie_util::ComputeSameSiteContextForRequest(
request.method, request.url, request.site_for_cookies,
request.request_initiator, should_treat_as_first_party));
request.request_initiator, is_main_frame_navigation,
should_treat_as_first_party));
return options;
}

View File

@ -19,6 +19,7 @@
#include "content/public/browser/resource_context.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "net/http/http_status_code.h"
#include "net/url_request/redirect_util.h"
#include "net/url_request/url_request.h"
@ -274,7 +275,7 @@ class InterceptedRequest : public network::mojom::URLLoader,
void OnURLLoaderError(uint32_t custom_reason, const std::string& description);
// Call OnComplete on |target_client_|. If |wait_for_loader_error| is true
// then this object will wait for |proxied_loader_binding_| to have a
// then this object will wait for |proxied_loader_receiver_| to have a
// connection error before destructing.
void CallOnComplete(const network::URLLoaderCompletionStatus& status,
bool wait_for_loader_error);
@ -319,12 +320,13 @@ class InterceptedRequest : public network::mojom::URLLoader,
GURL header_client_redirect_url_;
const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
mojo::Binding<network::mojom::URLLoader> proxied_loader_binding_;
network::mojom::URLLoaderClientPtr target_client_;
mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
mojo::Remote<network::mojom::URLLoaderClient> target_client_;
mojo::Binding<network::mojom::URLLoaderClient> proxied_client_binding_;
network::mojom::URLLoaderPtr target_loader_;
network::mojom::URLLoaderFactoryPtr target_factory_;
mojo::Receiver<network::mojom::URLLoaderClient> proxied_client_receiver_{
this};
mojo::Remote<network::mojom::URLLoader> target_loader_;
mojo::Remote<network::mojom::URLLoaderFactory> target_factory_;
bool current_request_uses_header_client_ = false;
OnHeadersReceivedCallback on_headers_received_callback_;
@ -387,9 +389,8 @@ InterceptedRequest::InterceptedRequest(
options_(options),
request_(request),
traffic_annotation_(traffic_annotation),
proxied_loader_binding_(this, std::move(loader_receiver)),
proxied_loader_receiver_(this, std::move(loader_receiver)),
target_client_(std::move(client)),
proxied_client_binding_(this),
target_factory_(std::move(target_factory)),
weak_factory_(this) {
status_ = network::URLLoaderCompletionStatus(net::OK);
@ -400,11 +401,10 @@ InterceptedRequest::InterceptedRequest(
&removed_headers);
// If there is a client error, clean up the request.
target_client_.set_connection_error_handler(base::BindOnce(
target_client_.set_disconnect_handler(base::BindOnce(
&InterceptedRequest::OnURLLoaderClientError, base::Unretained(this)));
proxied_loader_binding_.set_connection_error_with_reason_handler(
base::BindOnce(&InterceptedRequest::OnURLLoaderError,
base::Unretained(this)));
proxied_loader_receiver_.set_disconnect_with_reason_handler(base::BindOnce(
&InterceptedRequest::OnURLLoaderError, base::Unretained(this)));
}
InterceptedRequest::~InterceptedRequest() {
@ -418,8 +418,8 @@ InterceptedRequest::~InterceptedRequest() {
void InterceptedRequest::Restart() {
stream_loader_ = nullptr;
if (proxied_client_binding_.is_bound()) {
proxied_client_binding_.Unbind();
if (proxied_client_receiver_.is_bound()) {
proxied_client_receiver_.reset();
target_loader_.reset();
}
@ -427,7 +427,7 @@ void InterceptedRequest::Restart() {
ignore_result(header_client_receiver_.Unbind());
current_request_uses_header_client_ =
!!factory_->url_loader_header_client_receiver_;
factory_->url_loader_header_client_receiver_.is_bound();
if (request_.request_initiator &&
network::cors::ShouldCheckCors(request_.url, request_.request_initiator,
@ -501,8 +501,8 @@ void InterceptedRequest::OnBeforeSendHeaders(
std::move(callback).Run(net::OK, base::nullopt);
// Resume handling of client messages after continuing from an async callback.
if (proxied_client_binding_)
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
if (proxied_client_receiver_.is_bound())
proxied_client_receiver_.Resume();
}
void InterceptedRequest::OnHeadersReceived(
@ -661,7 +661,7 @@ void InterceptedRequest::FollowRedirect(
&removed_headers);
// If |OnURLLoaderClientError| was called then we're just waiting for the
// connection error handler of |proxied_loader_binding_|. Don't restart the
// connection error handler of |proxied_loader_receiver_|. Don't restart the
// job since that'll create another URLLoader.
if (!target_client_)
return;
@ -772,32 +772,26 @@ void InterceptedRequest::InterceptResponseReceived(
void InterceptedRequest::ContinueAfterIntercept() {
if (!target_loader_ && target_factory_) {
network::mojom::URLLoaderClientPtr proxied_client;
proxied_client_binding_.Bind(mojo::MakeRequest(&proxied_client));
// Even if this request does not use the header client, future redirects
// might, so we need to set the option on the loader.
uint32_t options = options_ | network::mojom::kURLLoadOptionUseHeaderClient;
target_factory_->CreateLoaderAndStart(
mojo::MakeRequest(&target_loader_), id_.routing_id(), id_.request_id(),
options, request_, proxied_client.PassInterface(), traffic_annotation_);
target_loader_.BindNewPipeAndPassReceiver(), id_.routing_id(),
id_.request_id(), options, request_,
proxied_client_receiver_.BindNewPipeAndPassRemote(),
traffic_annotation_);
}
}
void InterceptedRequest::ContinueAfterInterceptWithOverride(
std::unique_ptr<ResourceResponse> response) {
network::mojom::URLLoaderClientPtr proxied_client;
proxied_client_binding_.Bind(mojo::MakeRequest(&proxied_client));
// StreamReaderURLLoader will synthesize TrustedHeaderClient callbacks to
// avoid having Set-Cookie headers stripped by the IPC layer.
current_request_uses_header_client_ = true;
network::mojom::TrustedHeaderClientPtr header_client;
header_client_receiver_.Bind(mojo::MakeRequest(&header_client));
stream_loader_ = new StreamReaderURLLoader(
id_, request_, std::move(proxied_client), std::move(header_client),
traffic_annotation_,
id_, request_, proxied_client_receiver_.BindNewPipeAndPassRemote(),
header_client_receiver_.BindNewPipeAndPassRemote(), traffic_annotation_,
std::make_unique<InterceptDelegate>(std::move(response),
weak_factory_.GetWeakPtr()));
stream_loader_->Start();
@ -820,8 +814,8 @@ void InterceptedRequest::HandleResponseOrRedirectHeaders(
id_, request_, redirect_url_, headers.get());
// Pause handling of client messages before waiting on an async callback.
if (proxied_client_binding_)
proxied_client_binding_.PauseIncomingMethodCallProcessing();
if (proxied_client_receiver_.is_bound())
proxied_client_receiver_.Pause();
factory_->request_handler_->OnRequestResponse(
id_, &request_, headers.get(), redirect_info,
@ -872,8 +866,8 @@ void InterceptedRequest::ContinueToHandleOverrideHeaders(int error_code) {
redirect_url_ = GURL();
// Resume handling of client messages after continuing from an async callback.
if (proxied_client_binding_)
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
if (proxied_client_receiver_.is_bound())
proxied_client_receiver_.Resume();
}
net::RedirectInfo InterceptedRequest::MakeRedirectResponseAndInfo(
@ -918,8 +912,8 @@ void InterceptedRequest::ContinueToBeforeRedirect(
redirect_url_ = GURL();
// Resume handling of client messages after continuing from an async callback.
if (proxied_client_binding_)
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
if (proxied_client_receiver_.is_bound())
proxied_client_receiver_.Resume();
const auto original_url = request_.url;
const auto original_method = request_.method;
@ -1023,8 +1017,8 @@ void InterceptedRequest::ContinueToResponseStarted(int error_code) {
// Resume handling of client messages after continuing from an async
// callback.
if (proxied_client_binding_)
proxied_client_binding_.ResumeIncomingMethodCallProcessing();
if (proxied_client_receiver_.is_bound())
proxied_client_receiver_.Resume();
target_client_->OnReceiveResponse(std::move(current_response_));
}
@ -1086,9 +1080,9 @@ void InterceptedRequest::CallOnComplete(
if (target_client_)
target_client_->OnComplete(status);
if (proxied_loader_binding_ &&
if (proxied_loader_receiver_.is_bound() &&
(wait_for_loader_error && !got_loader_error_)) {
// Don't delete |this| yet, in case the |proxied_loader_binding_|'s
// Don't delete |this| yet, in case the |proxied_loader_receiver_|'s
// error_handler is called with a reason to indicate an error which we want
// to send to the client bridge. Also reset |target_client_| so we don't
// get its error_handler called and then delete |this|.
@ -1096,7 +1090,7 @@ void InterceptedRequest::CallOnComplete(
// Since the original client is gone no need to continue loading the
// request.
proxied_client_binding_.Close();
proxied_client_receiver_.reset();
header_client_receiver_.reset();
target_loader_.reset();
@ -1198,11 +1192,11 @@ ProxyURLLoaderFactory::ProxyURLLoaderFactory(
// Actual creation of the factory.
if (target_factory_info) {
target_factory_.Bind(std::move(target_factory_info));
target_factory_.set_connection_error_handler(base::BindOnce(
target_factory_.set_disconnect_handler(base::BindOnce(
&ProxyURLLoaderFactory::OnTargetFactoryError, base::Unretained(this)));
}
proxy_bindings_.AddBinding(this, std::move(factory_receiver));
proxy_bindings_.set_connection_error_handler(base::BindRepeating(
proxy_receivers_.Add(this, std::move(factory_receiver));
proxy_receivers_.set_disconnect_handler(base::BindRepeating(
&ProxyURLLoaderFactory::OnProxyBindingError, base::Unretained(this)));
if (header_client_receiver)
@ -1330,7 +1324,7 @@ void ProxyURLLoaderFactory::CreateLoaderAndStart(
void ProxyURLLoaderFactory::Clone(
mojo::PendingReceiver<network::mojom::URLLoaderFactory> factory) {
CEF_REQUIRE_IOT();
proxy_bindings_.AddBinding(this, std::move(factory));
proxy_receivers_.Add(this, std::move(factory));
}
void ProxyURLLoaderFactory::OnLoaderCreated(
@ -1352,13 +1346,13 @@ void ProxyURLLoaderFactory::OnLoaderForCorsPreflightCreated(
void ProxyURLLoaderFactory::OnTargetFactoryError() {
// Stop calls to CreateLoaderAndStart() when |target_factory_| is invalid.
target_factory_.reset();
proxy_bindings_.CloseAllBindings();
proxy_receivers_.Clear();
MaybeDestroySelf();
}
void ProxyURLLoaderFactory::OnProxyBindingError() {
if (proxy_bindings_.empty())
if (proxy_receivers_.empty())
target_factory_.reset();
MaybeDestroySelf();

View File

@ -16,8 +16,8 @@
#include "base/strings/string_piece.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "mojo/public/cpp/bindings/binding_set.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
@ -203,9 +203,9 @@ class ProxyURLLoaderFactory
void RemoveRequest(InterceptedRequest* request);
void MaybeDestroySelf();
mojo::BindingSet<network::mojom::URLLoaderFactory> proxy_bindings_;
network::mojom::URLLoaderFactoryPtr target_factory_;
mojo::Binding<network::mojom::TrustedURLLoaderHeaderClient>
mojo::ReceiverSet<network::mojom::URLLoaderFactory> proxy_receivers_;
mojo::Remote<network::mojom::URLLoaderFactory> target_factory_;
mojo::Receiver<network::mojom::TrustedURLLoaderHeaderClient>
url_loader_header_client_receiver_{this};
std::unique_ptr<InterceptedRequestHandler> request_handler_;

View File

@ -68,7 +68,7 @@ bool ResponseFilterWrapper::CreateOutputHandle(
}
mojo::ScopedDataPipeProducerHandle forwarding_handle;
if (CreateDataPipe(nullptr, &forwarding_handle, output_handle) !=
if (CreateDataPipe(nullptr, forwarding_handle, *output_handle) !=
MOJO_RESULT_OK) {
*output_handle = std::move(source_handle_);
return false;

View File

@ -480,8 +480,8 @@ std::ostream& operator<<(std::ostream& out, const RequestId& request_id) {
StreamReaderURLLoader::StreamReaderURLLoader(
const RequestId& request_id,
const network::ResourceRequest& request,
network::mojom::URLLoaderClientPtr client,
network::mojom::TrustedHeaderClientPtr header_client,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
std::unique_ptr<Delegate> response_delegate)
: request_id_(request_id),
@ -496,7 +496,7 @@ StreamReaderURLLoader::StreamReaderURLLoader(
weak_factory_(this) {
DCHECK(response_delegate_);
// If there is a client error, clean up the request.
client_.set_connection_error_handler(
client_.set_disconnect_handler(
base::BindOnce(&StreamReaderURLLoader::RequestComplete,
weak_factory_.GetWeakPtr(), net::ERR_ABORTED));
@ -734,8 +734,8 @@ void StreamReaderURLLoader::SendBody() {
DCHECK(thread_checker_.CalledOnValidThread());
mojo::ScopedDataPipeConsumerHandle consumer_handle;
if (CreateDataPipe(nullptr /*options*/, &producer_handle_,
&consumer_handle) != MOJO_RESULT_OK) {
if (CreateDataPipe(nullptr /*options*/, producer_handle_, consumer_handle) !=
MOJO_RESULT_OK) {
RequestComplete(net::ERR_FAILED);
return;
}

View File

@ -160,8 +160,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
StreamReaderURLLoader(
const RequestId& request_id,
const network::ResourceRequest& request,
network::mojom::URLLoaderClientPtr client,
network::mojom::TrustedHeaderClientPtr header_client,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::TrustedHeaderClient> header_client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation,
std::unique_ptr<Delegate> response_delegate);
~StreamReaderURLLoader() override;
@ -214,8 +214,8 @@ class StreamReaderURLLoader : public network::mojom::URLLoader {
net::HttpByteRange byte_range_;
network::ResourceRequest request_;
network::mojom::URLLoaderClientPtr client_;
network::mojom::TrustedHeaderClientPtr header_client_;
mojo::Remote<network::mojom::URLLoaderClient> client_;
mojo::Remote<network::mojom::TrustedHeaderClient> header_client_;
const net::MutableNetworkTrafficAnnotationTag traffic_annotation_;
std::unique_ptr<Delegate> response_delegate_;
scoped_refptr<InputStreamReader> input_stream_reader_;

View File

@ -38,7 +38,6 @@
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/common/content_switches_internal.h"
#include "content/common/input_messages.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"
@ -101,8 +100,9 @@ class CefDelegatedFrameHostClient : public content::DelegatedFrameHostClient {
return *view_->GetBackgroundColor();
}
void OnFrameTokenChanged(uint32_t frame_token) override {
view_->render_widget_host()->DidProcessFrame(frame_token);
void OnFrameTokenChanged(uint32_t frame_token,
base::TimeTicks activation_time) override {
view_->render_widget_host()->DidProcessFrame(frame_token, activation_time);
}
float GetDeviceScaleFactor() const override {
@ -207,7 +207,7 @@ CefRenderWidgetHostViewOSR::CefRenderWidgetHostViewOSR(
DCHECK(render_widget_host_);
DCHECK(!render_widget_host_->GetView());
current_device_scale_factor_ = kDefaultScaleFactor;
set_current_device_scale_factor(kDefaultScaleFactor);
if (parent_host_view_) {
browser_impl_ = parent_host_view_->browser_impl();
@ -667,7 +667,7 @@ void CefRenderWidgetHostViewOSR::SetTooltipText(
gfx::Size CefRenderWidgetHostViewOSR::GetCompositorViewportPixelSize() {
return gfx::ScaleToCeiledSize(GetRequestedRendererSize(),
current_device_scale_factor_);
current_device_scale_factor());
}
uint32_t CefRenderWidgetHostViewOSR::GetCaptureSequenceNumber() const {
@ -903,7 +903,8 @@ void CefRenderWidgetHostViewOSR::OnFrameComplete(
// TODO(cef): is there something we need to track with this notification?
}
void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation() {
void CefRenderWidgetHostViewOSR::OnRenderFrameMetadataChangedAfterActivation(
base::TimeTicks activation_time) {
auto metadata =
host_->render_frame_metadata_provider()->LastRenderFrameMetadata();
@ -1393,7 +1394,7 @@ void CefRenderWidgetHostViewOSR::UpdateFrameRate() {
gfx::Size CefRenderWidgetHostViewOSR::SizeInPixels() {
return gfx::ScaleToCeiledSize(GetViewBounds().size(),
current_device_scale_factor_);
current_device_scale_factor());
}
#if defined(OS_MAC)
@ -1480,18 +1481,21 @@ bool CefRenderWidgetHostViewOSR::SetDeviceScaleFactor() {
DCHECK(!hold_resize_);
const float new_scale_factor = ::GetDeviceScaleFactor(browser_impl_.get());
if (new_scale_factor == current_device_scale_factor_)
if (new_scale_factor == current_device_scale_factor())
return false;
current_device_scale_factor_ = new_scale_factor;
set_current_device_scale_factor(new_scale_factor);
// Notify the guest hosts if any.
for (auto guest_host_view : guest_host_views_) {
content::RenderWidgetHostImpl* rwhi = guest_host_view->render_widget_host();
if (!rwhi)
continue;
if (rwhi->GetView())
rwhi->GetView()->set_current_device_scale_factor(new_scale_factor);
auto guest_view_osr =
static_cast<CefRenderWidgetHostViewOSR*>(rwhi->GetView());
if (guest_view_osr) {
guest_view_osr->set_current_device_scale_factor(new_scale_factor);
}
}
return true;
@ -1524,7 +1528,7 @@ bool CefRenderWidgetHostViewOSR::SetRootLayerSize(bool force) {
if (compositor_) {
compositor_local_surface_id_allocator_.GenerateId();
compositor_->SetScaleAndSize(
current_device_scale_factor_, SizeInPixels(),
current_device_scale_factor(), SizeInPixels(),
compositor_local_surface_id_allocator_.GetCurrentLocalSurfaceId());
}

View File

@ -183,7 +183,8 @@ class CefRenderWidgetHostViewOSR
// RenderFrameMetadataProvider::Observer implementation.
void OnRenderFrameMetadataChangedBeforeActivation(
const cc::RenderFrameMetadata& metadata) override {}
void OnRenderFrameMetadataChangedAfterActivation() override;
void OnRenderFrameMetadataChangedAfterActivation(
base::TimeTicks activation_time) override;
void OnRenderFrameSubmission() override {}
void OnLocalSurfaceIdChanged(
const cc::RenderFrameMetadata& metadata) override {}

View File

@ -41,9 +41,9 @@ void CefSyntheticGestureTargetOSR::DispatchWebMouseEventToPlatform(
latency_info);
}
content::SyntheticGestureParams::GestureSourceType
content::mojom::GestureSourceType
CefSyntheticGestureTargetOSR::GetDefaultSyntheticGestureSourceType() const {
return content::SyntheticGestureParams::MOUSE_INPUT;
return content::mojom::GestureSourceType::kMouseInput;
}
float CefSyntheticGestureTargetOSR::GetTouchSlopInDips() const {

View File

@ -29,8 +29,8 @@ class CefSyntheticGestureTargetOSR
const ui::LatencyInfo& latency_info) override;
// SyntheticGestureTarget:
content::SyntheticGestureParams::GestureSourceType
GetDefaultSyntheticGestureSourceType() const override;
content::mojom::GestureSourceType GetDefaultSyntheticGestureSourceType()
const override;
float GetTouchSlopInDips() const override;
float GetSpanSlopInDips() const override;
float GetMinScalingSpanInDips() const override;

View File

@ -182,7 +182,7 @@ void SetExtensionPrefs(content::RenderViewHost* rvh,
// correct scheme. Without this check, chrome-guest:// schemes used by webview
// tags as well as hosts that happen to match the id of an installed extension
// would get the wrong preferences.
const GURL& site_url = rvh->GetSiteInstance()->GetSiteURL();
const GURL& site_url = rvh->GetMainFrame()->GetSiteInstance()->GetSiteURL();
if (!site_url.SchemeIs(extensions::kExtensionScheme))
return;
@ -416,8 +416,8 @@ void PopulateWebPreferences(content::RenderViewHost* rvh,
break;
}
UpdatePreferredColorScheme(&web, rvh->GetSiteInstance()->GetSiteURL(),
native_theme);
UpdatePreferredColorScheme(
&web, rvh->GetMainFrame()->GetSiteInstance()->GetSiteURL(), native_theme);
// Set preferences based on the extension.
SetExtensionPrefs(rvh, web);

View File

@ -22,12 +22,10 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_preview_dialog_controller.h"
#include "chrome/browser/printing/print_preview_message_handler.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
#include "components/printing/common/print.mojom.h"
#include "components/printing/common/print_messages.h"
#include "content/browser/download/download_manager_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
@ -178,9 +176,7 @@ struct CefPrintViewManager::PdfPrintState {
};
CefPrintViewManager::CefPrintViewManager(content::WebContents* web_contents)
: PrintViewManager(web_contents) {
PrintPreviewMessageHandler::CreateForWebContents(web_contents);
}
: PrintViewManager(web_contents) {}
CefPrintViewManager::~CefPrintViewManager() {
TerminatePdfPrintJob();
@ -209,7 +205,13 @@ bool CefPrintViewManager::PrintToPDF(content::RenderFrameHost* rfh,
FillInDictionaryFromPdfPrintSettings(settings, ++next_pdf_request_id_,
pdf_print_state_->settings_);
GetPrintRenderFrame(rfh)->InitiatePrintPreview({}, !!settings.selection_only);
auto& print_render_frame = GetPrintRenderFrame(rfh);
if (!pdf_print_receiver_.is_bound()) {
print_render_frame->SetPrintPreviewUI(
pdf_print_receiver_.BindNewEndpointAndPassRemote());
}
print_render_frame->InitiatePrintPreview({}, !!settings.selection_only);
return true;
}
@ -243,6 +245,59 @@ void CefPrintViewManager::RequestPrintPreview(
->PrintPreview(pdf_print_state_->settings_.Clone());
}
void CefPrintViewManager::CheckForCancel(int32_t preview_ui_id,
int32_t request_id,
CheckForCancelCallback callback) {
if (!pdf_print_state_) {
return PrintViewManager::CheckForCancel(preview_ui_id, request_id,
std::move(callback));
}
std::move(callback).Run(/*cancel=*/false);
}
void CefPrintViewManager::MetafileReadyForPrinting(
mojom::DidPreviewDocumentParamsPtr params,
int32_t request_id) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
StopWorker(params->document_cookie);
if (!pdf_print_state_)
return;
GetPrintRenderFrame(pdf_print_state_->printing_rfh_)
->OnPrintPreviewDialogClosed();
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
params->content->metafile_data_region);
if (!shared_buf) {
TerminatePdfPrintJob();
return;
}
const base::FilePath output_path = pdf_print_state_->output_path_;
const PdfPrintCallback print_callback = pdf_print_state_->callback_;
// Reset state information.
pdf_print_state_.reset();
pdf_print_receiver_.reset();
// Save the PDF file to disk and then execute the callback.
CEF_POST_USER_VISIBLE_TASK(
base::Bind(&SavePdfFile, shared_buf, output_path, print_callback));
}
void CefPrintViewManager::PrintPreviewFailed(int32_t document_cookie,
int32_t request_id) {
TerminatePdfPrintJob();
}
void CefPrintViewManager::PrintPreviewCancelled(int32_t document_cookie,
int32_t request_id) {
// Should never be canceled by CheckForCancel().
NOTREACHED();
}
void CefPrintViewManager::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
if (pdf_print_state_ &&
@ -262,25 +317,6 @@ void CefPrintViewManager::RenderProcessGone(base::TerminationStatus status) {
PrintViewManager::RenderProcessGone(status);
}
bool CefPrintViewManager::OnMessageReceived(
const IPC::Message& message,
content::RenderFrameHost* render_frame_host) {
bool handled = true;
if (!pdf_print_state_) {
return PrintViewManager::OnMessageReceived(message, render_frame_host);
}
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(CefPrintViewManager, message,
render_frame_host)
IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
OnMetafileReadyForPrinting_PrintToPdf)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled ||
PrintViewManager::OnMessageReceived(message, render_frame_host);
}
// static
void CefPrintViewManager::CreateForWebContents(content::WebContents* contents) {
DCHECK(contents);
@ -306,42 +342,6 @@ const CefPrintViewManager* CefPrintViewManager::FromWebContents(
contents->GetUserData(PrintViewManager::UserDataKey()));
}
void CefPrintViewManager::OnMetafileReadyForPrinting_PrintToPdf(
content::RenderFrameHost* rfh,
const mojom::DidPreviewDocumentParams& params,
const mojom::PreviewIds& ids) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
StopWorker(params.document_cookie);
if (!pdf_print_state_)
return;
DCHECK_EQ(pdf_print_state_->printing_rfh_, rfh);
mojo::AssociatedRemote<printing::mojom::PrintRenderFrame>
print_render_frame_remote;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(
&print_render_frame_remote);
print_render_frame_remote->OnPrintPreviewDialogClosed();
auto shared_buf = base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
params.content->metafile_data_region);
if (!shared_buf) {
TerminatePdfPrintJob();
return;
}
const base::FilePath output_path = pdf_print_state_->output_path_;
const PdfPrintCallback print_callback = pdf_print_state_->callback_;
// Reset state information.
pdf_print_state_.reset();
// Save the PDF file to disk and then execute the callback.
CEF_POST_USER_VISIBLE_TASK(
base::Bind(&SavePdfFile, shared_buf, output_path, print_callback));
}
void CefPrintViewManager::TerminatePdfPrintJob() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (!pdf_print_state_)
@ -355,6 +355,7 @@ void CefPrintViewManager::TerminatePdfPrintJob() {
// Reset state information.
pdf_print_state_.reset();
pdf_print_receiver_.reset();
}
} // namespace printing

View File

@ -26,7 +26,8 @@ struct PrintHostMsg_RequestPrintPreview_Params;
namespace printing {
// CEF handler for print commands.
class CefPrintViewManager : public PrintViewManager {
class CefPrintViewManager : public PrintViewManager,
public mojom::PrintPreviewUI {
public:
~CefPrintViewManager() override;
@ -44,13 +45,35 @@ class CefPrintViewManager : public PrintViewManager {
GetDefaultPrintSettingsCallback callback) override;
void DidShowPrintDialog() override;
void RequestPrintPreview(mojom::RequestPrintPreviewParamsPtr params) override;
void CheckForCancel(int32_t preview_ui_id,
int32_t request_id,
CheckForCancelCallback callback) override;
// printing::mojo::PrintPreviewUI methods:
void SetOptionsFromDocument(const mojom::OptionsFromDocumentParamsPtr params,
int32_t request_id) override {}
void DidPrepareDocumentForPreview(int32_t document_cookie,
int32_t request_id) override {}
void DidPreviewPage(mojom::DidPreviewPageParamsPtr params,
int32_t request_id) override {}
void MetafileReadyForPrinting(mojom::DidPreviewDocumentParamsPtr params,
int32_t request_id) override;
void PrintPreviewFailed(int32_t document_cookie, int32_t request_id) override;
void PrintPreviewCancelled(int32_t document_cookie,
int32_t request_id) override;
void PrinterSettingsInvalid(int32_t document_cookie,
int32_t request_id) override {}
void DidGetDefaultPageLayout(mojom::PageSizeMarginsPtr page_layout_in_points,
const gfx::Rect& printable_area_in_points,
bool has_custom_page_size_style,
int32_t request_id) override {}
void DidStartPreview(mojom::DidStartPreviewParamsPtr params,
int32_t request_id) override {}
// content::WebContentsObserver methods:
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
void NavigationStopped() override;
void RenderProcessGone(base::TerminationStatus status) override;
bool OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* render_frame_host) override;
// Inline versions of the content::WebContentsUserData methods to avoid
// ambiguous warnings due to the PrintViewManager base class also extending
@ -63,17 +86,13 @@ class CefPrintViewManager : public PrintViewManager {
private:
explicit CefPrintViewManager(content::WebContents* web_contents);
// IPC Message handlers.
void OnMetafileReadyForPrinting_PrintToPdf(
content::RenderFrameHost* rfh,
const mojom::DidPreviewDocumentParams& params,
const mojom::PreviewIds& ids);
void TerminatePdfPrintJob();
// Used for printing to PDF. Only accessed on the browser process UI thread.
int next_pdf_request_id_ = content::RenderFrameHost::kNoFrameTreeNodeId;
struct PdfPrintState;
std::unique_ptr<PdfPrintState> pdf_print_state_;
mojo::AssociatedReceiver<mojom::PrintPreviewUI> pdf_print_receiver_{this};
DISALLOW_COPY_AND_ASSIGN(CefPrintViewManager);
};

View File

@ -18,7 +18,6 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/ssl_host_state_delegate.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/cpp/resolve_host_client_base.h"

View File

@ -30,6 +30,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/utility/chrome_content_utility_client.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/embedder_support/switches.h"
#include "components/viz/common/features.h"
#include "content/browser/browser_process_sub_thread.h"
#include "content/public/common/content_features.h"
@ -147,7 +148,7 @@ bool AlloyMainDelegate::BasicStartupComplete(int* exit_code) {
command_line->AppendSwitch(sandbox::policy::switches::kNoSandbox);
if (settings_->user_agent.length > 0) {
command_line->AppendSwitchASCII(switches::kUserAgent,
command_line->AppendSwitchASCII(embedder_support::kUserAgent,
CefString(&settings_->user_agent));
} else if (settings_->product_version.length > 0) {
command_line->AppendSwitchASCII(switches::kProductVersion,

View File

@ -305,7 +305,7 @@ bool GetDefaultUserDataDirectory(std::wstring* result,
// This environment variable should be set on Windows Vista and later
// (https://msdn.microsoft.com/library/windows/desktop/dd378457.aspx).
std::wstring user_data_dir =
install_static::GetEnvironmentString16(L"LOCALAPPDATA");
install_static::GetEnvironmentString(L"LOCALAPPDATA");
if (user_data_dir.empty()) {
// LOCALAPPDATA was not set; fallback to the temporary files path.
@ -558,11 +558,11 @@ void CefCrashReporterClient::InitializeCrashReportingForProcess() {
!g_crash_reporter_client->HasCrashExternalHandler();
if (embedded_handler) {
crash_reporter::InitializeCrashpadWithEmbeddedHandler(
process_type.empty(), install_static::UTF16ToUTF8(process_type),
process_type.empty(), install_static::WideToUTF8(process_type),
std::string(), base::FilePath());
} else {
crash_reporter::InitializeCrashpad(
process_type.empty(), install_static::UTF16ToUTF8(process_type));
process_type.empty(), install_static::WideToUTF8(process_type));
}
}
}
@ -571,8 +571,7 @@ bool CefCrashReporterClient::GetAlternativeCrashDumpLocation(
base::string16* crash_dir) {
// By setting the BREAKPAD_DUMP_LOCATION environment variable, an alternate
// location to write breakpad crash dumps can be set.
*crash_dir =
install_static::GetEnvironmentString16(L"BREAKPAD_DUMP_LOCATION");
*crash_dir = install_static::GetEnvironmentString(L"BREAKPAD_DUMP_LOCATION");
return !crash_dir->empty();
}
@ -701,14 +700,14 @@ void CefCrashReporterClient::GetCrashOptionalArguments(
#if defined(OS_WIN)
base::string16 CefCrashReporterClient::GetCrashExternalHandler(
const base::string16& exe_dir) {
std::wstring CefCrashReporterClient::GetCrashExternalHandler(
const std::wstring& exe_dir) {
if (external_handler_.empty())
return CrashReporterClient::GetCrashExternalHandler(exe_dir);
if (isAbsolutePath(external_handler_))
return base::UTF8ToUTF16(external_handler_);
return base::UTF8ToWide(external_handler_);
return base::UTF8ToWide(
joinPath(base::UTF16ToUTF8(exe_dir), external_handler_));
joinPath(base::WideToUTF8(exe_dir), external_handler_));
}
bool CefCrashReporterClient::HasCrashExternalHandler() const {

View File

@ -79,8 +79,7 @@ class CefCrashReporterClient : public crash_reporter::CrashReporterClient {
void GetCrashOptionalArguments(std::vector<std::string>* arguments) override;
#if defined(OS_WIN)
base::string16 GetCrashExternalHandler(
const base::string16& exe_dir) override;
std::wstring GetCrashExternalHandler(const std::wstring& exe_dir) override;
bool HasCrashExternalHandler() const;
#endif

View File

@ -30,12 +30,7 @@
},
{
"channel": "stable",
"extension_types": ["platform_app"],
"whitelist": [
"AE27D69DBE571F4B1694F05C89B710C646792231", // Published ADT.
// TODO(grv): clean up once Apps developer tool is published.
"5107DE9024C329EEA9C9A72D94C16723790C6422" // Apps Developer Tool.
]
"extension_types": ["platform_app"]
}
]
}

View File

@ -171,10 +171,10 @@ CEF_EXPORT int cef_string_utf16_cmp(const cef_string_utf16_t* str1,
if (str1->length == 0 && str2->length == 0)
return 0;
#if defined(WCHAR_T_IS_UTF32)
int r =
base::c16memcmp(reinterpret_cast<base::string16::value_type*>(str1->str),
reinterpret_cast<base::string16::value_type*>(str2->str),
std::min(str1->length, str2->length));
int r = std::char_traits<base::string16::value_type>::compare(
reinterpret_cast<base::string16::value_type*>(str1->str),
reinterpret_cast<base::string16::value_type*>(str2->str),
std::min(str1->length, str2->length));
#else
int r = wcsncmp(str1->str, str2->str, std::min(str1->length, str2->length));
#endif

View File

@ -237,12 +237,6 @@ void AlloyContentRendererClient::RenderThreadStarted() {
pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get());
}
for (auto& origin_or_hostname_pattern :
network::SecureOriginAllowlist::GetInstance().GetCurrentAllowlist()) {
blink::WebSecurityPolicy::AddOriginToTrustworthySafelist(
blink::WebString::FromUTF8(origin_or_hostname_pattern));
}
if (extensions::ExtensionsEnabled())
extensions_renderer_client_->RenderThreadStarted();
}

View File

@ -8,7 +8,6 @@
#include "libcef/common/net/net_resource_provider.h"
#include "base/no_destructor.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "net/base/net_module.h"
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"

View File

@ -14,7 +14,6 @@
#include "chrome/common/renderer_configuration.mojom.h"
#include "components/content_settings/core/common/content_settings.h"
#include "content/public/renderer/render_thread_observer.h"
#include "mojo/public/cpp/bindings/associated_binding_set.h"
#include "mojo/public/cpp/bindings/associated_receiver_set.h"
// This class sends and receives control messages in the renderer process.

View File

@ -13,7 +13,6 @@
#include "chrome/common/google_url_loader_throttle.h"
#include "content/public/common/content_features.h"
#include "content/public/renderer/render_frame.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/public/common/loader/resource_type_util.h"
#include "third_party/blink/public/platform/web_url.h"
@ -59,23 +58,6 @@ CefURLLoaderThrottleProviderImpl::CreateThrottles(
DCHECK(!is_frame_resource ||
type_ == content::URLLoaderThrottleProviderType::kFrame);
if (extensions::ExtensionsEnabled() &&
type_ == content::URLLoaderThrottleProviderType::kFrame &&
request_destination == network::mojom::RequestDestination::kObject) {
content::RenderFrame* render_frame =
content::RenderFrame::FromRoutingID(render_frame_id);
auto mime_handlers =
extensions::MimeHandlerViewContainer::FromRenderFrame(render_frame);
GURL gurl(request.Url());
for (auto* handler : mime_handlers) {
auto throttle = handler->MaybeCreatePluginThrottle(gurl);
if (throttle) {
throttles.push_back(std::move(throttle));
break;
}
}
}
throttles.push_back(std::make_unique<GoogleURLLoaderThrottle>(
AlloyRenderThreadObserver::GetDynamicParams()));

View File

@ -30,6 +30,7 @@
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_local_frame_impl.h"
#include "third_party/blink/renderer/core/loader/frame_load_request.h"
#include "third_party/blink/renderer/core/script/classic_script.h"
#include "third_party/blink/renderer/platform/bindings/script_forbidden_scope.h"
#include "third_party/blink/renderer/platform/bindings/v8_binding.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
@ -101,6 +102,12 @@ std::string DumpDocumentText(blink::WebLocalFrame* frame) {
return blink::WebString(web_element->innerText()).Utf8();
}
std::string DumpDocumentMarkup(blink::WebLocalFrame* frame) {
const auto& string = blink::CreateMarkup(
blink::To<blink::WebLocalFrameImpl>(frame)->GetFrame()->GetDocument());
return string.Utf8();
}
cef_dom_node_type_t GetNodeType(const blink::WebNode& node) {
const blink::Node* web_node = node.ConstUnwrap<blink::Node>();
switch (web_node->getNodeType()) {
@ -174,11 +181,7 @@ v8::Local<v8::Value> ExecuteV8ScriptAndReturnValue(
const blink::WebString& source_url,
int start_line,
v8::Local<v8::Context> context,
v8::Isolate* isolate,
v8::TryCatch& tryCatch) {
// Based on ScriptController::executeScriptAndReturnValue
DCHECK(isolate);
if (start_line < 1)
start_line = 1;
@ -193,12 +196,14 @@ v8::Local<v8::Value> ExecuteV8ScriptAndReturnValue(
WTF::TextPosition(WTF::OrdinalNumber::FromOneBasedInt(start_line),
WTF::OrdinalNumber::FromZeroBasedInt(0)));
auto* script = blink::MakeGarbageCollected<blink::ClassicScript>(
ssc, ssc.Url(), blink::ScriptFetchOptions(),
blink::SanitizeScriptErrors::kDoNotSanitize);
// The Rethrow() message is unused due to kDoNotSanitize but it still needs
// to be non-nullopt for exceptions to be re-thrown as expected.
auto result = blink::V8ScriptRunner::CompileAndRunScript(
isolate, blink::ScriptState::From(context), frame->DomWindow(), ssc,
ssc.Url(), blink::SanitizeScriptErrors::kDoNotSanitize,
blink::ScriptFetchOptions(),
blink::ScriptState::From(context), script,
blink::ExecuteScriptPolicy::kExecuteScriptWhenScriptsDisabled,
blink::V8ScriptRunner::RethrowErrorsOption::Rethrow(""));

View File

@ -42,6 +42,8 @@ BLINK_EXPORT void GoForward(blink::WebView* view);
// Returns the text of the document element.
BLINK_EXPORT std::string DumpDocumentText(blink::WebLocalFrame* frame);
// Returns the markup of the document element.
BLINK_EXPORT std::string DumpDocumentMarkup(blink::WebLocalFrame* frame);
// Expose additional actions on WebNode.
BLINK_EXPORT cef_dom_node_type_t GetNodeType(const blink::WebNode& node);
@ -65,7 +67,6 @@ BLINK_EXPORT v8::Local<v8::Value> ExecuteV8ScriptAndReturnValue(
const blink::WebString& source_url,
int start_line,
v8::Local<v8::Context> context,
v8::Isolate* isolate,
v8::TryCatch& tryCatch);
BLINK_EXPORT bool IsScriptForbidden();

View File

@ -58,32 +58,32 @@ CefRefPtr<CefBrowserHost> CefBrowserImpl::GetHost() {
bool CefBrowserImpl::CanGoBack() {
CEF_REQUIRE_RT_RETURN(false);
return blink_glue::CanGoBack(render_view()->GetWebView());
return blink_glue::CanGoBack(GetWebView());
}
void CefBrowserImpl::GoBack() {
CEF_REQUIRE_RT_RETURN_VOID();
blink_glue::GoBack(render_view()->GetWebView());
blink_glue::GoBack(GetWebView());
}
bool CefBrowserImpl::CanGoForward() {
CEF_REQUIRE_RT_RETURN(false);
return blink_glue::CanGoForward(render_view()->GetWebView());
return blink_glue::CanGoForward(GetWebView());
}
void CefBrowserImpl::GoForward() {
CEF_REQUIRE_RT_RETURN_VOID();
blink_glue::GoForward(render_view()->GetWebView());
blink_glue::GoForward(GetWebView());
}
bool CefBrowserImpl::IsLoading() {
CEF_REQUIRE_RT_RETURN(false);
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame)
return main_frame->ToWebLocalFrame()->IsLoading();
}
@ -93,8 +93,8 @@ bool CefBrowserImpl::IsLoading() {
void CefBrowserImpl::Reload() {
CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
main_frame->ToWebLocalFrame()->StartReload(
blink::WebFrameLoadType::kReload);
@ -105,8 +105,8 @@ void CefBrowserImpl::Reload() {
void CefBrowserImpl::ReloadIgnoreCache() {
CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
main_frame->ToWebLocalFrame()->StartReload(
blink::WebFrameLoadType::kReloadBypassingCache);
@ -117,8 +117,8 @@ void CefBrowserImpl::ReloadIgnoreCache() {
void CefBrowserImpl::StopLoad() {
CEF_REQUIRE_RT_RETURN_VOID();
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
main_frame->ToWebLocalFrame()->DeprecatedStopLoading();
}
@ -147,8 +147,8 @@ bool CefBrowserImpl::IsPopup() {
bool CefBrowserImpl::HasDocument() {
CEF_REQUIRE_RT_RETURN(false);
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return !main_frame->ToWebLocalFrame()->GetDocument().IsNull();
}
@ -159,8 +159,8 @@ bool CefBrowserImpl::HasDocument() {
CefRefPtr<CefFrame> CefBrowserImpl::GetMainFrame() {
CEF_REQUIRE_RT_RETURN(nullptr);
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return GetWebFrameImpl(main_frame->ToWebLocalFrame()).get();
}
@ -171,9 +171,8 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetMainFrame() {
CefRefPtr<CefFrame> CefBrowserImpl::GetFocusedFrame() {
CEF_REQUIRE_RT_RETURN(nullptr);
if (render_view()->GetWebView() &&
render_view()->GetWebView()->FocusedFrame()) {
return GetWebFrameImpl(render_view()->GetWebView()->FocusedFrame()).get();
if (GetWebView() && GetWebView()->FocusedFrame()) {
return GetWebFrameImpl(GetWebView()->FocusedFrame()).get();
}
return nullptr;
}
@ -187,7 +186,7 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(int64 identifier) {
CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
CEF_REQUIRE_RT_RETURN(nullptr);
blink::WebView* web_view = render_view()->GetWebView();
blink::WebView* web_view = GetWebView();
if (web_view) {
const blink::WebString& frame_name =
blink::WebString::FromUTF16(name.ToString16());
@ -220,9 +219,9 @@ size_t CefBrowserImpl::GetFrameCount() {
int count = 0;
if (render_view()->GetWebView()) {
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
if (GetWebView()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
count++;
}
}
@ -236,9 +235,9 @@ void CefBrowserImpl::GetFrameIdentifiers(std::vector<int64>& identifiers) {
if (identifiers.size() > 0)
identifiers.clear();
if (render_view()->GetWebView()) {
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
if (GetWebView()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame())
identifiers.push_back(
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()));
@ -252,9 +251,9 @@ void CefBrowserImpl::GetFrameNames(std::vector<CefString>& names) {
if (names.size() > 0)
names.clear();
if (render_view()->GetWebView()) {
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
if (GetWebView()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame())
names.push_back(render_frame_util::GetName(frame->ToWebLocalFrame()));
}
@ -268,7 +267,7 @@ CefBrowserImpl::CefBrowserImpl(content::RenderView* render_view,
int browser_id,
bool is_popup,
bool is_windowless)
: content::RenderViewObserver(render_view),
: blink::WebViewObserver(render_view->GetWebView()),
browser_id_(browser_id),
is_popup_(is_popup),
is_windowless_(is_windowless) {}
@ -293,8 +292,8 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
if (frame_id == blink_glue::kInvalidFrameId) {
if (render_view()->GetWebView()) {
blink::WebFrame* main_frame = render_view()->GetWebView()->MainFrame();
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return GetWebFrameImpl(main_frame->ToWebLocalFrame());
}
@ -307,10 +306,10 @@ CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
if (it != frames_.end())
return it->second;
if (render_view()->GetWebView()) {
if (GetWebView()) {
// Check if the frame exists but we don't know about it yet.
for (blink::WebFrame* frame = render_view()->GetWebView()->MainFrame();
frame; frame = frame->TraverseNext()) {
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame() &&
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()) ==
frame_id) {
@ -379,7 +378,7 @@ void CefBrowserImpl::OnLoadingStateChange(bool isLoading) {
if (handler.get()) {
CefRefPtr<CefLoadHandler> load_handler = handler->GetLoadHandler();
if (load_handler.get()) {
blink::WebView* web_view = render_view()->GetWebView();
blink::WebView* web_view = GetWebView();
const bool canGoBack = blink_glue::CanGoBack(web_view);
const bool canGoForward = blink_glue::CanGoForward(web_view);

View File

@ -19,19 +19,23 @@
#include "libcef/common/tracker.h"
#include "libcef/renderer/frame_impl.h"
#include "content/public/renderer/render_view_observer.h"
#include "third_party/blink/public/web/web_view_observer.h"
namespace blink {
class WebFrame;
class WebNode;
} // namespace blink
namespace content {
class RenderView;
}
// Renderer plumbing for CEF features. There is a one-to-one relationship
// between RenderView on the renderer side and RenderViewHost on the browser
// side.
//
// RenderViewObserver: Interface for observing RenderView notifications.
class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
public:
// Returns the browser associated with the specified RenderView.
static CefRefPtr<CefBrowserImpl> GetBrowserForView(content::RenderView* view);
@ -78,7 +82,7 @@ class CefBrowserImpl : public CefBrowser, public content::RenderViewObserver {
bool is_popup() const { return is_popup_; }
bool is_windowless() const { return is_windowless_; }
// RenderViewObserver methods.
// blink::WebViewObserver methods.
void OnDestruct() override;
void FrameDetached(int64_t frame_id);

View File

@ -33,10 +33,10 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_thread.h"
#include "content/public/renderer/render_view.h"
#include "content/public/renderer/render_view_observer.h"
#include "services/network/public/mojom/cors_origin_pattern.mojom.h"
#include "third_party/blink/public/web/web_security_policy.h"
#include "third_party/blink/public/web/web_view.h"
#include "third_party/blink/public/web/web_view_observer.h"
namespace {
@ -45,12 +45,12 @@ CefBrowserManager* g_manager = nullptr;
} // namespace
// Placeholder object for guest views.
class CefGuestView : public content::RenderViewObserver {
class CefGuestView : public blink::WebViewObserver {
public:
CefGuestView(CefBrowserManager* manager,
content::RenderView* render_view,
bool is_windowless)
: content::RenderViewObserver(render_view),
: blink::WebViewObserver(render_view->GetWebView()),
manager_(manager),
is_windowless_(is_windowless) {}
@ -138,9 +138,8 @@ CefRefPtr<CefBrowserImpl> CefBrowserManager::GetBrowserForMainFrame(
blink::WebFrame* frame) {
BrowserMap::const_iterator it = browsers_.begin();
for (; it != browsers_.end(); ++it) {
content::RenderView* render_view = it->second->render_view();
if (render_view && render_view->GetWebView() &&
render_view->GetWebView()->MainFrame() == frame) {
auto web_view = it->second->GetWebView();
if (web_view && web_view->MainFrame() == frame) {
return it->second;
}
}

View File

@ -390,8 +390,8 @@ CefRect CefDOMNodeImpl::GetElementBounds() {
}
WebElement element = node_.To<blink::WebElement>();
blink::WebRect rc = element.BoundsInViewport();
rect.Set(rc.x, rc.y, rc.width, rc.height);
const auto& rc = element.BoundsInViewport();
rect.Set(rc.x(), rc.y(), rc.width(), rc.height());
return rect;
}

View File

@ -15,7 +15,7 @@
#include "chrome/common/url_constants.h"
#include "content/public/renderer/render_frame.h"
#include "extensions/common/constants.h"
#include "extensions/renderer/guest_view/mime_handler_view/mime_handler_view_container.h"
#include "extensions/renderer/guest_view/mime_handler_view/post_message_support.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"

View File

@ -35,6 +35,7 @@
#include "content/public/renderer/render_view.h"
#include "content/renderer/render_frame_impl.h"
#include "third_party/blink/public/mojom/frame/frame.mojom-blink.h"
#include "third_party/blink/public/platform/web_back_forward_cache_loader_helper.h"
#include "third_party/blink/public/platform/web_data.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
@ -98,8 +99,7 @@ void CefFrameImpl::ViewSource() {
void CefFrameImpl::GetSource(CefRefPtr<CefStringVisitor> visitor) {
CEF_REQUIRE_RT_RETURN_VOID();
if (frame_) {
const CefString& content =
std::string(blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8());
const CefString& content = blink_glue::DumpDocumentMarkup(frame_);
visitor->Visit(content);
}
}
@ -309,7 +309,7 @@ std::unique_ptr<blink::WebURLLoader> CefFrameImpl::CreateURLLoader() {
blink::WebURLRequest(),
blink_glue::CreateResourceLoadingTaskRunnerHandle(frame_),
blink_glue::CreateResourceLoadingMaybeUnfreezableTaskRunnerHandle(frame_),
std::move(keep_alive_handle));
std::move(keep_alive_handle), blink::WebBackForwardCacheLoaderHelper());
}
std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
@ -490,7 +490,7 @@ void CefFrameImpl::OnRequest(const Cef_Request_Params& params) {
DCHECK(!command.empty());
if (base::LowerCaseEqualsASCII(command, "getsource")) {
response = blink::WebFrameContentDumper::DumpAsMarkup(frame_).Utf8();
response = blink_glue::DumpDocumentMarkup(frame_);
success = true;
} else if (base::LowerCaseEqualsASCII(command, "gettext")) {
response = blink_glue::DumpDocumentText(frame_);

View File

@ -1104,7 +1104,7 @@ bool CefV8ContextImpl::Eval(const CefString& code,
try_catch.SetVerbose(true);
v8::Local<v8::Value> func_rv = blink_glue::ExecuteV8ScriptAndReturnValue(
source, source_url, start_line, context, isolate, try_catch);
source, source_url, start_line, context, try_catch);
if (try_catch.HasCaught()) {
exception = new CefV8ExceptionImpl(context, try_catch.Message());

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=a8f51263f539c707f45abb95a6fb1f9f3bfef3b3$
// $hash=4ff1017b303be65e38e293470384dc891bb26b15$
//
#include "libcef_dll/cpptoc/context_menu_params_cpptoc.h"
@ -383,23 +383,6 @@ context_menu_params_is_custom_menu(struct _cef_context_menu_params_t* self) {
return _retval;
}
int CEF_CALLBACK
context_menu_params_is_pepper_menu(struct _cef_context_menu_params_t* self) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefContextMenuParamsCppToC::Get(self)->IsPepperMenu();
// Return type: bool
return _retval;
}
} // namespace
// CONSTRUCTOR - Do not edit by hand.
@ -429,7 +412,6 @@ CefContextMenuParamsCppToC::CefContextMenuParamsCppToC() {
context_menu_params_is_spell_check_enabled;
GetStruct()->get_edit_state_flags = context_menu_params_get_edit_state_flags;
GetStruct()->is_custom_menu = context_menu_params_is_custom_menu;
GetStruct()->is_pepper_menu = context_menu_params_is_pepper_menu;
}
// DESTRUCTOR - Do not edit by hand.

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=cc3fb995a3c9384fae1f1bbeb118ff6ff1d78ea2$
// $hash=dad7a3eb64c0bc6c4eddd2935513af61f7e8b510$
//
#include "libcef_dll/ctocpp/context_menu_params_ctocpp.h"
@ -230,7 +230,7 @@ CefContextMenuParams::MediaType CefContextMenuParamsCToCpp::GetMediaType() {
NO_SANITIZE("cfi-icall")
CefContextMenuParams::MediaStateFlags
CefContextMenuParamsCToCpp::GetMediaStateFlags() {
CefContextMenuParamsCToCpp::GetMediaStateFlags() {
shutdown_checker::AssertNotShutdown();
cef_context_menu_params_t* _struct = GetStruct();
@ -351,7 +351,7 @@ bool CefContextMenuParamsCToCpp::IsSpellCheckEnabled() {
NO_SANITIZE("cfi-icall")
CefContextMenuParams::EditStateFlags
CefContextMenuParamsCToCpp::GetEditStateFlags() {
CefContextMenuParamsCToCpp::GetEditStateFlags() {
shutdown_checker::AssertNotShutdown();
cef_context_menu_params_t* _struct = GetStruct();
@ -384,22 +384,6 @@ NO_SANITIZE("cfi-icall") bool CefContextMenuParamsCToCpp::IsCustomMenu() {
return _retval ? true : false;
}
NO_SANITIZE("cfi-icall") bool CefContextMenuParamsCToCpp::IsPepperMenu() {
shutdown_checker::AssertNotShutdown();
cef_context_menu_params_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, is_pepper_menu))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->is_pepper_menu(_struct);
// Return type: bool
return _retval ? true : false;
}
// CONSTRUCTOR - Do not edit by hand.
CefContextMenuParamsCToCpp::CefContextMenuParamsCToCpp() {}

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=326bac53cf2af1a1f80e036cbbb3bd643ef6f7dd$
// $hash=7de11c340a42046de92ca4cb8c5852269f3a3101$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_
@ -56,7 +56,6 @@ class CefContextMenuParamsCToCpp
bool IsSpellCheckEnabled() OVERRIDE;
EditStateFlags GetEditStateFlags() OVERRIDE;
bool IsCustomMenu() OVERRIDE;
bool IsPepperMenu() OVERRIDE;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_CONTEXT_MENU_PARAMS_CTOCPP_H_

View File

@ -250,11 +250,7 @@ patches = [
# Support override of the User-Agent product component when NetworkService
# is enabled.
# https://bitbucket.org/chromiumembedded/cef/issues/2622
#
# Changes to support the Chrome runtime in CEF
# (chrome_content_browser_client.cc).
# https://bitbucket.org/chromiumembedded/cef/issues/2969
'name': 'chrome_browser_product_override',
'name': 'embedder_product_override',
},
{
# Fix Jumbo/component build dependency issue.
@ -352,11 +348,6 @@ patches = [
# Don't initialize PrerenderContents object in StreamsPrivateAPI.
'name': 'extensions_1947',
},
{
# Don't enable sandbox::MITIGATION_STRICT_HANDLE_CHECKS in WinRT apps.
# https://bitbucket.org/chromiumembedded/cef/issues/2274
'name': 'win_rt_2274',
},
{
# macOS: Fix undesirable switch to discrete GPU during startup.
# https://bitbucket.org/chromiumembedded/cef/issues/2398
@ -484,6 +475,11 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2819
'name': 'win_cpp17_msvc_sandbox_2819',
},
{
# Fix duplicate symbols in libphonenumber.
'name': 'libphonenumber',
'path': 'third_party/libphonenumber/dist',
},
{
# libxml access is now limited to targets audited by the Security Team.
# https://chromium-review.googlesource.com/c/chromium/src/+/1884750

View File

@ -1,5 +1,5 @@
diff --git base/BUILD.gn base/BUILD.gn
index 4516b3575892..db53b698a7d4 100644
index 70911a215498..52aea5cc2e70 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -34,6 +34,7 @@ import("//build/config/ui.gni")
@ -10,7 +10,7 @@ index 4516b3575892..db53b698a7d4 100644
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//third_party/icu/config.gni")
@@ -1666,7 +1667,11 @@ component("base") {
@@ -1731,7 +1732,11 @@ component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]
@ -23,7 +23,7 @@ index 4516b3575892..db53b698a7d4 100644
sources += [
"hash/md5_nacl.cc",
"hash/md5_nacl.h",
@@ -1867,6 +1872,12 @@ component("base") {
@@ -1938,6 +1943,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}

View File

@ -1,5 +1,5 @@
diff --git base/strings/string_piece.h base/strings/string_piece.h
index b10707d94ef9..1bfa980cbbe6 100644
index 038165ea1e1c..a559312bba57 100644
--- base/strings/string_piece.h
+++ base/strings/string_piece.h
@@ -24,6 +24,7 @@

View File

@ -1,8 +1,8 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index d403f389af0d..c8ff688fd11f 100644
index 52ebdbbc7c2e..822f2e41afec 100644
--- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc
@@ -1685,6 +1685,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(
@@ -1706,6 +1706,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForOrigin(
// DeclarativeApiTest.PersistRules.
if (actual_process_lock.matches_scheme(url::kDataScheme))
return true;

View File

@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index 5928c561b5a3..6f342bb0e036 100644
index 266b74b3b50a..f242e8b08ec1 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -1779,8 +1779,6 @@ config("thin_archive") {
@@ -1824,8 +1824,6 @@ config("thin_archive") {
# archives.
if ((is_posix && !is_nacl && (!is_apple || use_lld)) || is_fuchsia) {
arflags = [ "-T" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 40c07e2d724a..1cfe14f8cd6f 100644
index 72d91d05c23a..bfa8860bcd89 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -12,6 +12,7 @@ import("//build/config/crypto.gni")
@ -10,7 +10,7 @@ index 40c07e2d724a..1cfe14f8cd6f 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni")
@@ -1966,6 +1967,7 @@ static_library("browser") {
@@ -1964,6 +1965,7 @@ static_library("browser") {
"//build:chromeos_buildflags",
"//build/config/compiler:compiler_buildflags",
"//cc",
@ -18,7 +18,7 @@ index 40c07e2d724a..1cfe14f8cd6f 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2489,6 +2491,10 @@ static_library("browser") {
@@ -2504,6 +2506,10 @@ static_library("browser") {
]
}
@ -29,7 +29,7 @@ index 40c07e2d724a..1cfe14f8cd6f 100644
if (is_android) {
sources += [
"after_startup_task_utils_android.cc",
@@ -5104,7 +5110,7 @@ static_library("browser") {
@@ -5166,7 +5172,7 @@ static_library("browser") {
]
}

View File

@ -1,16 +1,16 @@
diff --git chrome/browser/app_controller_mac.mm chrome/browser/app_controller_mac.mm
index e2eb5c2c73d0..d08b0a9a2a54 100644
index 596eabd15f44..b9b24760b7c2 100644
--- chrome/browser/app_controller_mac.mm
+++ chrome/browser/app_controller_mac.mm
@@ -29,6 +29,7 @@
#include "base/task/thread_pool.h"
@@ -30,6 +30,7 @@
#include "base/threading/scoped_blocking_call.h"
#include "base/threading/thread_restrictions.h"
#include "build/branding_buildflags.h"
+#include "cef/libcef/features/features.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/apps/app_shim/app_shim_manager_mac.h"
#include "chrome/browser/apps/app_shim/app_shim_termination_manager.h"
@@ -1194,6 +1195,7 @@ - (void)commandDispatch:(id)sender {
@@ -1219,6 +1220,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
// Run a (background) application in a new tab.
- (void)executeApplication:(id)sender {
@ -18,7 +18,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644
NSInteger tag = [sender tag];
Profile* profile = [self lastProfile];
DCHECK(profile);
@@ -1202,6 +1204,7 @@ - (void)executeApplication:(id)sender {
@@ -1227,6 +1229,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
tag < static_cast<int>(applications.size()));
const extensions::Extension* extension = applications.GetExtension(tag);
BackgroundModeManager::LaunchBackgroundApplication(profile, extension);
@ -26,7 +26,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644
}
// Same as |-commandDispatch:|, but executes commands using a disposition
@@ -1599,6 +1602,7 @@ - (NSMenu*)applicationDockMenu:(NSApplication*)sender {
@@ -1614,6 +1617,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
// TODO(rickcam): Mock out BackgroundApplicationListModel, then add unit
// tests which use the mock in place of the profile-initialized model.
@ -34,7 +34,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644
// Avoid breaking unit tests which have no profile.
if (profile) {
BackgroundApplicationListModel applications(profile);
@@ -1625,6 +1629,7 @@ - (NSMenu*)applicationDockMenu:(NSApplication*)sender {
@@ -1640,6 +1644,7 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
}
}
}
@ -42,7 +42,7 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644
return dockMenu;
}
@@ -1835,11 +1840,13 @@ - (void)handoffActiveURLChanged:(content::WebContents*)webContents {
@@ -1850,11 +1855,13 @@ static base::mac::ScopedObjCClassSwizzler* g_swizzle_imk_input_session;
namespace {
void UpdateProfileInUse(Profile* profile, Profile::CreateStatus status) {
@ -57,69 +57,58 @@ index e2eb5c2c73d0..d08b0a9a2a54 100644
} // namespace
diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h
index 1ea08a7ad6ae..473ebde08451 100644
index 3d634db18900..96e44ad48e5e 100644
--- chrome/browser/browser_process.h
+++ chrome/browser/browser_process.h
@@ -202,10 +202,12 @@ class BrowserProcess {
@@ -197,9 +197,9 @@ class BrowserProcess {
virtual DownloadStatusUpdater* download_status_updater() = 0;
virtual DownloadRequestLimiter* download_request_limiter() = 0;
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
// Returns the object that manages background applications.
virtual BackgroundModeManager* background_mode_manager() = 0;
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
virtual void set_background_mode_manager_for_test(
std::unique_ptr<BackgroundModeManager> manager) = 0;
+#endif
// Returns the StatusTray, which provides an API for displaying status icons
// in the system status tray. Returns NULL if status icons are not supported
#endif
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index 35510d179897..79cdc358903c 100644
index 067873339ce4..4bc021eb8c9a 100644
--- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc
@@ -957,24 +957,19 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
@@ -943,18 +943,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
return download_request_limiter_.get();
}
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
-BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
+BackgroundModeManager* BrowserProcessImpl::background_mode_manager() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
if (!background_mode_manager_)
CreateBackgroundModeManager();
return background_mode_manager_.get();
-#else
- NOTIMPLEMENTED();
- return NULL;
- return nullptr;
-#endif
}
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
void BrowserProcessImpl::set_background_mode_manager_for_test(
std::unique_ptr<BackgroundModeManager> manager) {
-#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
background_mode_manager_ = std::move(manager);
-#endif
}
+#endif
StatusTray* BrowserProcessImpl::status_tray() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
index 1d3c566cc59b..230c16644234 100644
index b4ceefbccd08..7d60206c83b1 100644
--- chrome/browser/browser_process_impl.h
+++ chrome/browser/browser_process_impl.h
@@ -166,9 +166,11 @@ class BrowserProcessImpl : public BrowserProcess,
@@ -169,8 +169,8 @@ class BrowserProcessImpl : public BrowserProcess,
void SetApplicationLocale(const std::string& actual_locale) override;
DownloadStatusUpdater* download_status_updater() override;
DownloadRequestLimiter* download_request_limiter() override;
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
BackgroundModeManager* background_mode_manager() override;
- BackgroundModeManager* background_mode_manager() override;
#if BUILDFLAG(ENABLE_BACKGROUND_MODE)
+ BackgroundModeManager* background_mode_manager() override;
void set_background_mode_manager_for_test(
std::unique_ptr<BackgroundModeManager> manager) override;
+#endif
StatusTray* status_tray() override;
safe_browsing::SafeBrowsingService* safe_browsing_service() override;
subresource_filter::RulesetService* subresource_filter_ruleset_service()
#endif
diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc
index e0cafee5eedd..06ded156be3c 100644
--- chrome/browser/lifetime/browser_close_manager.cc
@ -140,11 +129,11 @@ index e0cafee5eedd..06ded156be3c 100644
// Make a copy of the BrowserList to simplify the case where we need to
// destroy a Browser during the loop.
diff --git chrome/browser/sessions/session_service.cc chrome/browser/sessions/session_service.cc
index cbddcc52a8f6..02ab085c481c 100644
index 867da7e78e1a..de849b67b1e3 100644
--- chrome/browser/sessions/session_service.cc
+++ chrome/browser/sessions/session_service.cc
@@ -968,12 +968,19 @@ void SessionService::MaybeDeleteSessionOnlyData() {
if (!profile() || profile()->AsTestingProfile())
@@ -1047,12 +1047,19 @@ void SessionService::MaybeDeleteSessionOnlyData() {
if (profile()->AsTestingProfile())
return;
+#if BUILDFLAG(ENABLE_BACKGROUND_MODE)

View File

@ -13,10 +13,10 @@ index ba0c5c3fc044..b4df9af95ecd 100644
return false;
}
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index 1dc23535c42a..4aae0399346f 100644
index f225525e74eb..ee5932936215 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -257,6 +257,20 @@
@@ -256,6 +256,20 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif
@ -51,7 +51,7 @@ index 1dc23535c42a..4aae0399346f 100644
location_bar_model_ = std::make_unique<LocationBarModelImpl>(
location_bar_model_delegate_.get(), content::kMaxURLDisplayChars);
@@ -1343,6 +1364,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
@@ -1310,6 +1331,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED;
@ -66,7 +66,7 @@ index 1dc23535c42a..4aae0399346f 100644
return window()->PreHandleKeyboardEvent(event);
}
@@ -1350,8 +1379,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
@@ -1317,8 +1346,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source);
@ -87,7 +87,7 @@ index 1dc23535c42a..4aae0399346f 100644
}
bool Browser::TabsNeedBeforeUnloadFired() {
@@ -1579,6 +1618,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
@@ -1538,6 +1577,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
return window->OpenURLFromTab(source, params);
}
@ -102,7 +102,7 @@ index 1dc23535c42a..4aae0399346f 100644
NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source;
@@ -1692,6 +1739,8 @@ void Browser::LoadingStateChanged(WebContents* source,
@@ -1651,6 +1698,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool to_different_document) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, to_different_document);
@ -111,7 +111,7 @@ index 1dc23535c42a..4aae0399346f 100644
}
void Browser::CloseContents(WebContents* source) {
@@ -1719,6 +1768,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -1678,6 +1727,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@ -120,7 +120,7 @@ index 1dc23535c42a..4aae0399346f 100644
if (!GetStatusBubble())
return;
@@ -1726,6 +1777,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -1685,6 +1736,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url);
}
@ -138,7 +138,7 @@ index 1dc23535c42a..4aae0399346f 100644
void Browser::ContentsMouseEvent(WebContents* source,
bool motion,
bool exited) {
@@ -1842,6 +1904,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
@@ -1801,6 +1863,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents);
@ -149,7 +149,7 @@ index 1dc23535c42a..4aae0399346f 100644
}
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
@@ -1878,6 +1944,8 @@ void Browser::RendererResponsive(
@@ -1837,6 +1903,8 @@ void Browser::RendererResponsive(
void Browser::DidNavigateMainFramePostCommit(WebContents* web_contents) {
if (web_contents == tab_strip_model_->GetActiveWebContents())
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TAB_STATE);
@ -158,7 +158,7 @@ index 1dc23535c42a..4aae0399346f 100644
}
content::JavaScriptDialogManager* Browser::GetJavaScriptDialogManager(
@@ -1924,11 +1992,15 @@ void Browser::EnterFullscreenModeForTab(
@@ -1883,11 +1951,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@ -174,7 +174,7 @@ index 1dc23535c42a..4aae0399346f 100644
}
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2826,6 +2898,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
@@ -2730,6 +2802,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
content_translate_driver->RemoveTranslationObserver(this);
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
}
@ -184,7 +184,7 @@ index 1dc23535c42a..4aae0399346f 100644
void Browser::CloseFrame() {
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 7287ec00c3f5..93df2551fab7 100644
index 3a0202c2139b..700de9a44461 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -22,6 +22,7 @@
@ -206,9 +206,9 @@ index 7287ec00c3f5..93df2551fab7 100644
#if defined(OS_ANDROID)
#error This file should only be included on desktop.
#endif
@@ -269,6 +274,11 @@ class Browser : public TabStripModelObserver,
// User-set title of this browser window, if there is one.
std::string user_title;
@@ -281,6 +286,11 @@ class Browser : public TabStripModelObserver,
// maximizable.
bool can_maximize = true;
+#if BUILDFLAG(ENABLE_CEF)
+ // Opaque CEF-specific configuration. Will be propagated to new Browsers.
@ -218,9 +218,9 @@ index 7287ec00c3f5..93df2551fab7 100644
private:
friend class Browser;
friend class WindowSizerChromeOSTest;
@@ -386,6 +396,12 @@ class Browser : public TabStripModelObserver,
return &signin_view_controller_;
}
@@ -403,6 +413,12 @@ class Browser : public TabStripModelObserver,
base::WeakPtr<Browser> AsWeakPtr();
+#if BUILDFLAG(ENABLE_CEF)
+ cef::BrowserDelegate* cef_delegate() const {
@ -231,7 +231,7 @@ index 7287ec00c3f5..93df2551fab7 100644
// Get the FindBarController for this browser, creating it if it does not
// yet exist.
FindBarController* GetFindBarController();
@@ -770,6 +786,11 @@ class Browser : public TabStripModelObserver,
@@ -783,6 +799,11 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@ -243,7 +243,7 @@ index 7287ec00c3f5..93df2551fab7 100644
void ContentsMouseEvent(content::WebContents* source,
bool motion,
bool exited) override;
@@ -1240,6 +1261,10 @@ class Browser : public TabStripModelObserver,
@@ -1242,6 +1263,10 @@ class Browser : public TabStripModelObserver,
extension_browser_window_helper_;
#endif
@ -253,12 +253,12 @@ index 7287ec00c3f5..93df2551fab7 100644
+
const base::ElapsedTimer creation_timer_;
// Stores the list of browser windows showing via a menu.
// The following factory is used for chrome update coalescing.
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index 4bf854459b2c..20e348eb9293 100644
index 019834353c02..894de692f35d 100644
--- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc
@@ -453,6 +453,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
@@ -454,6 +454,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
std::unique_ptr<WebContents> target_contents =
WebContents::Create(create_params);

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 cf62b79358e1..4fe90fde38ff 100644
index c1e6c77a5726..d3c41d3dac05 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -8,6 +8,7 @@
@ -8,9 +8,9 @@ index cf62b79358e1..4fe90fde38ff 100644
#include "build/buildflag.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/content_settings/one_time_geolocation_permission_provider.h"
#include "chrome/browser/permissions/last_tab_standing_tracker_factory.h"
#include "chrome/browser/profiles/off_the_record_profile_impl.h"
#include "chrome/browser/profiles/profile.h"
@@ -21,6 +22,10 @@
@@ -22,6 +23,10 @@
#include "extensions/buildflags/buildflags.h"
#include "ui/webui/webui_allowlist_provider.h"
@ -21,7 +21,7 @@ index cf62b79358e1..4fe90fde38ff 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_system.h"
@@ -49,8 +54,14 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
@@ -51,8 +56,14 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
DependsOn(SupervisedUserSettingsServiceFactory::GetInstance());
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
@ -36,7 +36,7 @@ index cf62b79358e1..4fe90fde38ff 100644
#endif
}
@@ -108,10 +119,16 @@ scoped_refptr<RefcountedKeyedService>
@@ -110,10 +121,16 @@ scoped_refptr<RefcountedKeyedService>
}
#if BUILDFLAG(ENABLE_EXTENSIONS)

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index afee70a01862..e49e769b6366 100644
index ea17679df248..fe9280cb59ce 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -12,6 +12,7 @@ import("//build/config/features.gni")
@ -10,7 +10,7 @@ index afee70a01862..e49e769b6366 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni")
@@ -327,6 +328,10 @@ static_library("ui") {
@@ -332,6 +333,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@ -21,7 +21,7 @@ index afee70a01862..e49e769b6366 100644
# Since browser and browser_ui actually depend on each other,
# we must omit the dependency from browser_ui to browser.
# However, this means browser_ui and browser should more or less
@@ -349,6 +354,7 @@ static_library("ui") {
@@ -355,6 +360,7 @@ static_library("ui") {
"//build:branding_buildflags",
"//build:chromeos_buildflags",
"//cc/paint",
@ -29,7 +29,7 @@ index afee70a01862..e49e769b6366 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -1553,6 +1559,7 @@ static_library("ui") {
@@ -1581,6 +1587,7 @@ static_library("ui") {
"//components/page_load_metrics/browser",
"//components/performance_manager:site_data_proto",
"//components/printing/browser",
@ -37,7 +37,7 @@ index afee70a01862..e49e769b6366 100644
"//components/profile_metrics",
"//components/reading_list/features:flags",
"//components/safe_browsing/core/common:safe_browsing_policy_handler",
@@ -3370,7 +3377,9 @@ static_library("ui") {
@@ -3392,7 +3399,9 @@ static_library("ui") {
"views/frame/browser_desktop_window_tree_host_platform.h",
]
}

View File

@ -1,64 +0,0 @@
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 19c5989c8b67..659e6dbebea5 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -37,6 +37,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/accessibility/caption_util.h"
@@ -1067,10 +1068,6 @@ void LaunchURL(const GURL& url,
}
}
-std::string GetProduct() {
- return version_info::GetProductNameAndVersionForUserAgent();
-}
-
void MaybeAppendSecureOriginsAllowlistSwitch(base::CommandLine* cmdline) {
// |allowlist| combines pref/policy + cmdline switch in the browser process.
// For renderer and utility (e.g. NetworkService) processes the switch is the
@@ -1258,6 +1255,14 @@ const blink::UserAgentBrandList& GetBrandVersionList() {
return *greased_brand_version_list;
}
+std::string GetProduct() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kProductVersion))
+ return command_line->GetSwitchValueASCII(switches::kProductVersion);
+
+ return version_info::GetProductNameAndVersionForUserAgent();
+}
+
std::string GetUserAgent() {
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kUserAgent)) {
@@ -3610,9 +3615,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // defined(OS_ANDROID)
+#if !BUILDFLAG(ENABLE_CEF)
// chrome: & friends.
handler->AddHandlerPair(&ChromeContentBrowserClient::HandleWebUI,
&ChromeContentBrowserClient::HandleWebUIReverse);
+#endif
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {
diff --git chrome/browser/chrome_content_browser_client.h chrome/browser/chrome_content_browser_client.h
index 3ef2329ac8a6..3e3ede99e042 100644
--- chrome/browser/chrome_content_browser_client.h
+++ chrome/browser/chrome_content_browser_client.h
@@ -108,7 +108,8 @@ class ChromeXrIntegrationClient;
}
#endif
-// Returns the user agent of Chrome.
+// Returns the product and user agent of Chrome.
+std::string GetProduct();
std::string GetUserAgent();
blink::UserAgentMetadata GetUserAgentMetadata();

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 102a4c5ce183..a6ce775156b4 100644
index 71730949d2bd..eedcde617f01 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -390,7 +390,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@@ -397,7 +397,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSE_CANCELLED,
content::NotificationService::AllSources());
@ -12,10 +12,10 @@ index 102a4c5ce183..a6ce775156b4 100644
}
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index 1be24b4ee39c..4288383cb2a8 100644
index 743dccc6ddf4..204be4916f14 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -106,7 +106,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -113,7 +113,7 @@ class ProfileManager : public content::NotificationObserver,
// acceptable. Returns null if creation of the new profile fails.
// TODO(bauerb): Migrate calls from other code to GetProfileByPath(), then
// make this method private.
@ -24,7 +24,7 @@ index 1be24b4ee39c..4288383cb2a8 100644
// Returns regular or off-the-record profile given its profile key.
static Profile* GetProfileFromProfileKey(ProfileKey* profile_key);
@@ -139,7 +139,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -146,7 +146,7 @@ class ProfileManager : public content::NotificationObserver,
// Returns true if the profile pointer is known to point to an existing
// profile.
@ -33,7 +33,7 @@ index 1be24b4ee39c..4288383cb2a8 100644
// Returns the directory where the first created profile is stored,
// relative to the user data directory currently in use.
@@ -148,7 +148,7 @@ class ProfileManager : public content::NotificationObserver,
@@ -155,7 +155,7 @@ class ProfileManager : public content::NotificationObserver,
// Get the Profile last used (the Profile to which owns the most recently
// focused window) with this Chrome build. If no signed profile has been
// stored in Local State, hand back the Default profile.

View File

@ -1,12 +1,12 @@
diff --git chrome/browser/safe_browsing/BUILD.gn chrome/browser/safe_browsing/BUILD.gn
index ae8aef3a076c..f7e6a91047ef 100644
index a940b0d2a09b..328976b55299 100644
--- chrome/browser/safe_browsing/BUILD.gn
+++ chrome/browser/safe_browsing/BUILD.gn
@@ -23,6 +23,7 @@ static_library("safe_browsing") {
@@ -26,6 +26,7 @@ static_library("safe_browsing") {
"//chrome/common:constants",
"//components/browser_sync",
"//components/enterprise/common:strings",
+ "//components/gcm_driver:gcm_buildflags",
"//components/keyed_service/content",
"//components/language/core/browser",
"//components/page_info",
"//components/no_state_prefetch/browser",

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 dfa34db9255e..0a79d11c7e0c 100644
index 6de814c6ed1e..302d6dcc789a 100644
--- chrome/browser/plugins/plugin_info_host_impl.cc
+++ chrome/browser/plugins/plugin_info_host_impl.cc
@@ -18,6 +18,7 @@
@ -56,17 +56,7 @@ index dfa34db9255e..0a79d11c7e0c 100644
}
PluginInfoHostImpl::Context::~Context() {}
@@ -207,7 +220,8 @@ void PluginInfoHostImpl::PluginsLoaded(
plugin_metadata->identifier(), &output->status);
}
- if (output->status == chrome::mojom::PluginStatus::kNotFound) {
+ if (!cef::IsAlloyRuntimeEnabled() &&
+ output->status == chrome::mojom::PluginStatus::kNotFound) {
// Check to see if the component updater can fetch an implementation.
std::unique_ptr<component_updater::ComponentInfo> cus_plugin_info =
g_browser_process->component_updater()->GetComponentForMimeType(
@@ -228,6 +242,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus(
@@ -218,6 +231,15 @@ void PluginInfoHostImpl::Context::DecidePluginStatus(
PluginMetadata::SecurityStatus security_status,
const std::string& plugin_identifier,
chrome::mojom::PluginStatus* status) const {
@ -82,7 +72,7 @@ index dfa34db9255e..0a79d11c7e0c 100644
if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
*status = chrome::mojom::PluginStatus::kAllowed;
return;
@@ -344,17 +367,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin(
@@ -334,17 +356,41 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin(
return false;
}
@ -163,7 +153,7 @@ index e547d5f00617..831d5794ecde 100644
Profile* profile = Profile::FromBrowserContext(browser_context);
const std::vector<std::string>& allowlist =
diff --git chrome/common/google_url_loader_throttle.cc chrome/common/google_url_loader_throttle.cc
index ce40f0039fe0..c8cbecb61455 100644
index 6555dfc37d5c..d54030b6f236 100644
--- chrome/common/google_url_loader_throttle.cc
+++ chrome/common/google_url_loader_throttle.cc
@@ -7,6 +7,7 @@
@ -174,9 +164,9 @@ index ce40f0039fe0..c8cbecb61455 100644
#include "chrome/common/chrome_features.h"
#include "chrome/common/net/safe_search_util.h"
#include "components/google/core/common/google_util.h"
@@ -14,6 +15,10 @@
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/public/mojom/x_frame_options.mojom.h"
@@ -18,6 +19,10 @@
#include "ui/base/device_form_factor.h"
#endif
+#if BUILDFLAG(ENABLE_CEF)
+#include "cef/libcef/common/extensions/extensions_util.h"
@ -185,7 +175,7 @@ index ce40f0039fe0..c8cbecb61455 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/common/extension_urls.h"
#endif
@@ -153,6 +158,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse(
@@ -168,6 +173,11 @@ void GoogleURLLoaderThrottle::WillProcessResponse(
const GURL& response_url,
network::mojom::URLResponseHead* response_head,
bool* defer) {
@ -198,10 +188,10 @@ index ce40f0039fe0..c8cbecb61455 100644
// that the X-Frame-Options protection mechanism is set to either DENY or
// SAMEORIGIN.
diff --git chrome/renderer/chrome_content_renderer_client.cc chrome/renderer/chrome_content_renderer_client.cc
index a1c26dfbd5cc..aaf96b069c32 100644
index b6fe493a6ddc..bc2f6487044f 100644
--- chrome/renderer/chrome_content_renderer_client.cc
+++ chrome/renderer/chrome_content_renderer_client.cc
@@ -848,6 +848,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -858,6 +858,7 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
if ((status == chrome::mojom::PluginStatus::kUnauthorized ||
status == chrome::mojom::PluginStatus::kBlocked) &&
@ -209,7 +199,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644
content_settings_agent_delegate->IsPluginTemporarilyAllowed(
identifier)) {
status = chrome::mojom::PluginStatus::kAllowed;
@@ -1046,7 +1047,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1053,7 +1054,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
render_frame->GetRemoteAssociatedInterfaces()->GetInterface(
plugin_auth_host.BindNewEndpointAndPassReceiver());
plugin_auth_host->BlockedUnauthorizedPlugin(group_name, identifier);
@ -219,7 +209,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644
break;
}
case chrome::mojom::PluginStatus::kBlocked: {
@@ -1055,7 +1057,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1062,7 +1064,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name));
placeholder->AllowLoading();
RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
@ -229,7 +219,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedByPolicy: {
@@ -1065,7 +1068,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1072,7 +1075,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
group_name));
RenderThread::Get()->RecordAction(
UserMetricsAction("Plugin_BlockedByPolicy"));
@ -239,7 +229,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644
break;
}
case chrome::mojom::PluginStatus::kBlockedNoLoading: {
@@ -1073,7 +1077,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
@@ -1080,7 +1084,8 @@ WebPlugin* ChromeContentRendererClient::CreatePlugin(
IDR_BLOCKED_PLUGIN_HTML,
l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED_NO_LOADING,
group_name));
@ -248,7 +238,7 @@ index a1c26dfbd5cc..aaf96b069c32 100644
+ content_settings_agent->DidBlockContentType(content_type);
break;
}
case chrome::mojom::PluginStatus::kComponentUpdateRequired: {
}
diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h
index 06b6875bd37e..13c197b532ad 100644
--- content/browser/browser_plugin/browser_plugin_guest.h

View File

@ -1,5 +1,5 @@
diff --git chrome/renderer/BUILD.gn chrome/renderer/BUILD.gn
index 6a837ad9df98..7abef83f2a47 100644
index a69e547cdaa1..5fde8ab27021 100644
--- chrome/renderer/BUILD.gn
+++ chrome/renderer/BUILD.gn
@@ -5,6 +5,7 @@
@ -10,7 +10,7 @@ index 6a837ad9df98..7abef83f2a47 100644
import("//chrome/common/features.gni")
import("//components/nacl/features.gni")
import("//components/offline_pages/buildflags/features.gni")
@@ -145,6 +146,7 @@ static_library("renderer") {
@@ -146,6 +147,7 @@ static_library("renderer") {
deps = [
"//base/allocator:buildflags",
"//build:chromeos_buildflags",
@ -18,7 +18,7 @@ index 6a837ad9df98..7abef83f2a47 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/common",
@@ -226,6 +228,10 @@ static_library("renderer") {
@@ -229,6 +231,10 @@ static_library("renderer") {
configs += [ "//build/config/compiler:wexit_time_destructors" ]

View File

@ -1,8 +1,8 @@
diff --git chrome/app/chrome_main_delegate.cc chrome/app/chrome_main_delegate.cc
index db85b6b2fcf5..bcf6867e8f4e 100644
index 826ef32f3033..238750f1c2ba 100644
--- chrome/app/chrome_main_delegate.cc
+++ chrome/app/chrome_main_delegate.cc
@@ -28,6 +28,7 @@
@@ -29,6 +29,7 @@
#include "base/trace_event/trace_event_impl.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
@ -10,7 +10,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
#include "chrome/browser/chrome_content_browser_client.h"
#include "chrome/browser/chrome_resource_bundle_helper.h"
#include "chrome/browser/defaults.h"
@@ -381,6 +382,8 @@ struct MainFunction {
@@ -380,6 +381,8 @@ struct MainFunction {
// Initializes the user data dir. Must be called before InitializeLocalState().
void InitializeUserDataDir(base::CommandLine* command_line) {
@ -19,7 +19,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
#if defined(OS_WIN)
// Reach out to chrome_elf for the truth on the user data directory.
// Note that in tests, this links to chrome_elf_test_stubs.
@@ -658,7 +661,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() {
@@ -657,7 +660,9 @@ void ChromeMainDelegate::PostFieldTrialInitialization() {
}
#if defined(OS_WIN)
@ -29,7 +29,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
base::sequence_manager::internal::ThreadControllerPowerMonitor::
InitializeOnMainThread();
#endif
@@ -943,6 +948,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -950,6 +955,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
@ -37,7 +37,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
crash_reporter::InitializeCrashKeys();
#if defined(OS_POSIX)
@@ -953,6 +959,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -960,6 +966,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
InitMacCrashReporter(command_line, process_type);
SetUpInstallerPreferences(command_line);
#endif
@ -45,7 +45,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
#if defined(OS_WIN)
child_process_logging::Init();
@@ -1075,6 +1082,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1083,6 +1090,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
locale;
}
@ -53,7 +53,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
#if defined(OS_POSIX) && !defined(OS_MAC)
// Zygote needs to call InitCrashReporter() in RunZygote().
if (process_type != switches::kZygoteProcess) {
@@ -1107,6 +1115,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
@@ -1115,6 +1123,7 @@ void ChromeMainDelegate::PreSandboxStartup() {
// After all the platform Breakpads have been initialized, store the command
// line for crash reporting.
crash_keys::SetCrashKeysFromCommandLine(command_line);
@ -61,7 +61,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
#if BUILDFLAG(ENABLE_PDF)
MaybeInitializeGDI();
@@ -1205,6 +1214,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1213,6 +1222,7 @@ void ChromeMainDelegate::ZygoteForked() {
SetUpProfilingShutdownHandler();
}
@ -69,7 +69,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
// Needs to be called after we have chrome::DIR_USER_DATA. BrowserMain sets
// this up for the browser process in a different manner.
const base::CommandLine* command_line =
@@ -1221,6 +1231,7 @@ void ChromeMainDelegate::ZygoteForked() {
@@ -1229,6 +1239,7 @@ void ChromeMainDelegate::ZygoteForked() {
// Reset the command line for the newly spawned process.
crash_keys::SetCrashKeysFromCommandLine(*command_line);
@ -78,7 +78,7 @@ index db85b6b2fcf5..bcf6867e8f4e 100644
#endif // defined(OS_LINUX) || defined(OS_CHROMEOS)
diff --git chrome/browser/chrome_browser_main.cc chrome/browser/chrome_browser_main.cc
index fee4d5f1a8ca..2e4fb506d851 100644
index 65465803bd38..b521fd91a93b 100644
--- chrome/browser/chrome_browser_main.cc
+++ chrome/browser/chrome_browser_main.cc
@@ -49,6 +49,7 @@
@ -89,7 +89,7 @@ index fee4d5f1a8ca..2e4fb506d851 100644
#include "chrome/browser/about_flags.h"
#include "chrome/browser/active_use_util.h"
#include "chrome/browser/after_startup_task_utils.h"
@@ -902,8 +903,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
@@ -900,8 +901,10 @@ int ChromeBrowserMainParts::PreCreateThreadsImpl() {
#if !defined(OS_ANDROID)
// Create the RunLoop for MainMessageLoopRun() to use, and pass a copy of
// its QuitClosure to the BrowserProcessImpl to call when it is time to exit.
@ -101,7 +101,7 @@ index fee4d5f1a8ca..2e4fb506d851 100644
// These members must be initialized before returning from this function.
// Android doesn't use StartupBrowserCreator.
@@ -1634,11 +1637,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
@@ -1633,11 +1636,13 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
// This step is costly and is already measured in
// Startup.StartupBrowserCreator_Start.
// See the comment above for an explanation of |process_command_line|.
@ -117,7 +117,7 @@ index fee4d5f1a8ca..2e4fb506d851 100644
// of lacros-chrome is complete.
#if defined(OS_WIN) || (defined(OS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS))
diff --git chrome/browser/chrome_browser_main_mac.mm chrome/browser/chrome_browser_main_mac.mm
index c30b73c2575f..5da45a243f9b 100644
index 8a33ce57766c..ca69a37eee22 100644
--- chrome/browser/chrome_browser_main_mac.mm
+++ chrome/browser/chrome_browser_main_mac.mm
@@ -16,6 +16,7 @@
@ -128,7 +128,7 @@ index c30b73c2575f..5da45a243f9b 100644
#import "chrome/browser/app_controller_mac.h"
#include "chrome/browser/apps/app_shim/app_shim_listener.h"
#include "chrome/browser/browser_process.h"
@@ -111,6 +112,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
@@ -110,6 +111,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
}
}
@ -136,7 +136,7 @@ index c30b73c2575f..5da45a243f9b 100644
// Create the app delegate. This object is intentionally leaked as a global
// singleton. It is accessed through -[NSApp delegate].
AppController* app_controller = [[AppController alloc] init];
@@ -119,6 +121,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
@@ -118,6 +120,7 @@ void ChromeBrowserMainPartsMac::PreMainMessageLoopStart() {
chrome::BuildMainMenu(NSApp, app_controller,
l10n_util::GetStringUTF16(IDS_PRODUCT_NAME), false);
[app_controller mainMenuCreated];
@ -144,7 +144,7 @@ index c30b73c2575f..5da45a243f9b 100644
PrefService* local_state = g_browser_process->local_state();
DCHECK(local_state);
@@ -175,7 +178,9 @@ void ChromeBrowserMainPartsMac::PostProfileInit() {
@@ -170,7 +173,9 @@ void ChromeBrowserMainPartsMac::PostProfileInit() {
}
void ChromeBrowserMainPartsMac::DidEndMainMessageLoop() {
@ -154,28 +154,27 @@ index c30b73c2575f..5da45a243f9b 100644
[appController didEndMainMessageLoop];
+#endif
}
diff --git chrome/browser/notifications/notification_platform_bridge_mac.mm chrome/browser/notifications/notification_platform_bridge_mac.mm
index 9e8fcb9f9f91..2a9eaca0fb0d 100644
--- chrome/browser/notifications/notification_platform_bridge_mac.mm
+++ chrome/browser/notifications/notification_platform_bridge_mac.mm
@@ -24,6 +24,7 @@
#include "base/strings/sys_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/notification_display_service_impl.h"
@@ -451,6 +452,12 @@ getDisplayedAlertsForProfileId:(NSString*)profileId
- (id<NotificationDelivery>)serviceProxy {
id<NotificationDelivery> proxy = [_xpcConnection remoteObjectProxy];
diff --git chrome/browser/chrome_content_browser_client.cc chrome/browser/chrome_content_browser_client.cc
index 29ba5f21b38f..3ce05420eb78 100644
--- chrome/browser/chrome_content_browser_client.cc
+++ chrome/browser/chrome_content_browser_client.cc
@@ -37,6 +37,7 @@
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
+#include "cef/libcef/features/features.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/accessibility/caption_util.h"
@@ -3591,9 +3592,11 @@ void ChromeContentBrowserClient::BrowserURLHandlerCreated(
&search::HandleNewTabURLReverseRewrite);
#endif // defined(OS_ANDROID)
+ // Skip exception port configuration when running CEF with crash reporting disabled.
+ if (!_setExceptionPort && cef::IsChromeRuntimeEnabled() &&
+ !cef::IsCrashReportingEnabled()) {
+ _setExceptionPort = YES;
+ }
+
if (!_setExceptionPort) {
base::mac::ScopedMachSendRight exceptionPort(
crash_reporter::GetCrashpadClient().GetHandlerMachPort());
+#if !BUILDFLAG(ENABLE_CEF)
// chrome: & friends.
handler->AddHandlerPair(&ChromeContentBrowserClient::HandleWebUI,
&ChromeContentBrowserClient::HandleWebUIReverse);
+#endif
}
base::FilePath ChromeContentBrowserClient::GetDefaultDownloadDirectory() {

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
index 5c03f250e500..ecfce9c2c7c7 100644
index 7c0229c202ca..67320e907526 100644
--- chrome/browser/ui/views/frame/browser_frame.cc
+++ chrome/browser/ui/views/frame/browser_frame.cc
@@ -63,15 +63,23 @@ bool IsUsingGtkTheme(Profile* profile) {
@@ -64,15 +64,23 @@ bool IsUsingGtkTheme(Profile* profile) {
////////////////////////////////////////////////////////////////////////////////
// BrowserFrame, public:
@ -28,7 +28,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644
}
BrowserFrame::~BrowserFrame() {}
@@ -133,6 +141,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion(
@@ -131,6 +139,12 @@ gfx::Rect BrowserFrame::GetBoundsForTabStripRegion(
}
int BrowserFrame::GetTopInset() const {
@ -41,7 +41,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644
return browser_frame_view_->GetTopInset(false);
}
@@ -167,15 +181,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds,
@@ -165,15 +179,21 @@ void BrowserFrame::GetWindowPlacement(gfx::Rect* bounds,
content::KeyboardEventProcessingResult BrowserFrame::PreHandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
@ -63,7 +63,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644
browser_frame_view_->OnBrowserViewInitViewsComplete();
}
@@ -208,7 +228,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
@@ -206,7 +226,8 @@ const ui::ThemeProvider* BrowserFrame::GetThemeProvider() const {
}
const ui::NativeTheme* BrowserFrame::GetNativeTheme() const {
@ -74,7 +74,7 @@ index 5c03f250e500..ecfce9c2c7c7 100644
->UsingDefaultTheme()) {
return ui::NativeTheme::GetInstanceForDarkUI();
diff --git chrome/browser/ui/views/frame/browser_frame.h chrome/browser/ui/views/frame/browser_frame.h
index 3a1314f21ce4..f9464abc97a7 100644
index 050c0e05e4e3..0bbcf4af9a92 100644
--- chrome/browser/ui/views/frame/browser_frame.h
+++ chrome/browser/ui/views/frame/browser_frame.h
@@ -53,7 +53,9 @@ enum class TabDragKind {
@ -88,12 +88,12 @@ index 3a1314f21ce4..f9464abc97a7 100644
// Initialize the frame (creates the underlying native window).
diff --git chrome/browser/ui/views/frame/browser_view.cc chrome/browser/ui/views/frame/browser_view.cc
index c4d99326bacf..3c7b45b99186 100644
index 7d93faeadd2c..9b10c7f86c5c 100644
--- chrome/browser/ui/views/frame/browser_view.cc
+++ chrome/browser/ui/views/frame/browser_view.cc
@@ -545,16 +545,26 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
// static
const char BrowserView::kViewClassName[] = "BrowserView";
@@ -557,11 +557,22 @@ class BrowserView::AccessibilityModeObserver : public ui::AXModeObserver {
///////////////////////////////////////////////////////////////////////////////
// BrowserView, public:
+BrowserView::BrowserView() : BrowserView(nullptr) {}
+
@ -113,14 +113,17 @@ index c4d99326bacf..3c7b45b99186 100644
+ immersive_mode_controller_ = chrome::CreateImmersiveModeController();
+
SetShowIcon(::ShouldShowWindowIcon(browser_.get()));
SetHasWindowSizeControls(!chrome::IsRunningInForcedAppMode());
// In forced app mode, all size controls are always disabled. Otherwise, use
@@ -575,7 +586,6 @@ BrowserView::BrowserView(std::unique_ptr<Browser> browser)
}
browser_->tab_strip_model()->AddObserver(this);
- immersive_mode_controller_ = chrome::CreateImmersiveModeController();
// Top container holds tab strip region and toolbar and lives at the front of
// the view hierarchy.
@@ -1340,6 +1350,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
@@ -1368,6 +1378,8 @@ bool BrowserView::ShouldHideUIForFullscreen() const {
if (immersive_mode_controller_->IsEnabled())
return false;
@ -129,7 +132,7 @@ index c4d99326bacf..3c7b45b99186 100644
return frame_->GetFrameView()->ShouldHideTopUIForFullscreen();
}
@@ -2357,7 +2369,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const {
@@ -2393,7 +2405,8 @@ BrowserView::GetNativeViewHostsForTopControlsSlide() const {
}
void BrowserView::ReparentTopContainerForEndOfImmersive() {
@ -139,7 +142,7 @@ index c4d99326bacf..3c7b45b99186 100644
top_container()->DestroyLayer();
AddChildViewAt(top_container(), 0);
EnsureFocusOrder();
@@ -2804,7 +2817,8 @@ void BrowserView::Layout() {
@@ -2841,7 +2854,8 @@ void BrowserView::Layout() {
// TODO(jamescook): Why was this in the middle of layout code?
toolbar_->location_bar()->omnibox_view()->SetFocusBehavior(
IsToolbarVisible() ? FocusBehavior::ALWAYS : FocusBehavior::NEVER);
@ -149,7 +152,7 @@ index c4d99326bacf..3c7b45b99186 100644
// Some of the situations when the BrowserView is laid out are:
// - Enter/exit immersive fullscreen mode.
@@ -2907,7 +2921,8 @@ void BrowserView::AddedToWidget() {
@@ -2944,7 +2958,8 @@ void BrowserView::AddedToWidget() {
SetToolbarButtonProvider(toolbar_);
frame_->OnBrowserViewInitViewsComplete();
@ -160,24 +163,24 @@ index c4d99326bacf..3c7b45b99186 100644
MaybeInitializeWebUITabStrip();
diff --git chrome/browser/ui/views/frame/browser_view.h chrome/browser/ui/views/frame/browser_view.h
index 986798357dbc..2793bf7b184e 100644
index e4955ccbb929..e678754ee361 100644
--- chrome/browser/ui/views/frame/browser_view.h
+++ chrome/browser/ui/views/frame/browser_view.h
@@ -117,7 +117,9 @@ class BrowserView : public BrowserWindow,
// The browser view's class name.
static const char kViewClassName[];
@@ -114,7 +114,9 @@ class BrowserView : public BrowserWindow,
public webapps::AppBannerManager::Observer {
public:
METADATA_HEADER(BrowserView);
+ BrowserView();
explicit BrowserView(std::unique_ptr<Browser> browser);
+ void InitBrowser(std::unique_ptr<Browser> browser);
BrowserView(const BrowserView&) = delete;
BrowserView& operator=(const BrowserView&) = delete;
~BrowserView() override;
void set_frame(BrowserFrame* frame) { frame_ = frame; }
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
index 824acb2c7c8a..cd81e0e3f4d3 100644
index 975817e079eb..f77c24d294bc 100644
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
+++ chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
@@ -578,37 +578,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
@@ -571,37 +571,53 @@ gfx::Range BrowserTabStripController::ListTabsInGroup(
}
bool BrowserTabStripController::IsFrameCondensed() const {

View File

@ -1,9 +1,9 @@
diff --git third_party/widevine/cdm/BUILD.gn third_party/widevine/cdm/BUILD.gn
index 71bc09b46ad6..ddf0da9b330e 100644
index e5009f30f6f5..8190a72bd450 100644
--- third_party/widevine/cdm/BUILD.gn
+++ third_party/widevine/cdm/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")
@@ -7,6 +7,7 @@ import("//build/config/chrome_build.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/features.gni")
+import("//cef/libcef/features/features.gni")

View File

@ -1,5 +1,5 @@
diff --git content/browser/devtools/devtools_instrumentation.h content/browser/devtools/devtools_instrumentation.h
index 36ab5d592ecb..e61236132220 100644
index 572f521ae88c..995d17a90f0d 100644
--- content/browser/devtools/devtools_instrumentation.h
+++ content/browser/devtools/devtools_instrumentation.h
@@ -12,6 +12,7 @@
@ -20,7 +20,7 @@ index 36ab5d592ecb..e61236132220 100644
bool is_navigation,
bool is_download,
diff --git content/browser/renderer_host/input/synthetic_gesture_target_base.h content/browser/renderer_host/input/synthetic_gesture_target_base.h
index 4dd9b2645d60..23b46ce1a43a 100644
index eef661b3e095..6c0dacfa4bc3 100644
--- content/browser/renderer_host/input/synthetic_gesture_target_base.h
+++ content/browser/renderer_host/input/synthetic_gesture_target_base.h
@@ -9,6 +9,7 @@

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
index 21ab45886df2..ee7394fd10eb 100644
index f094105ac70c..b5f4616ff821 100644
--- chrome/browser/download/download_target_determiner.cc
+++ chrome/browser/download/download_target_determiner.cc
@@ -660,7 +660,7 @@ void IsHandledBySafePlugin(int render_process_id,
@@ -672,7 +672,7 @@ void IsHandledBySafePlugin(int render_process_id,
content::PluginService* plugin_service =
content::PluginService::GetInstance();
bool plugin_found = plugin_service->GetPluginInfo(
@ -36,7 +36,7 @@ index 937d3d5bc84f..ac327392dcf3 100644
content::WebPluginInfo* plugin) override;
diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
index 5b780f8bf34c..a75d0da983b4 100644
index d0a5a12620bd..a02e13bbd815 100644
--- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
+++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
@@ -65,7 +65,7 @@ bool IsPDFPluginEnabled(content::NavigationHandle* navigation_handle,
@ -49,10 +49,10 @@ index 5b780f8bf34c..a75d0da983b4 100644
false /* allow_wildcard */, is_stale, &plugin_info,
nullptr /* actual_mime_type */);
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
index 88fa7da1411e..98d0ea7650ed 100644
index c2418d12834a..6705fd4c60b3 100644
--- chrome/browser/ui/views/frame/browser_root_view.cc
+++ chrome/browser/ui/views/frame/browser_root_view.cc
@@ -77,7 +77,7 @@ void OnFindURLMimeType(const GURL& url,
@@ -81,7 +81,7 @@ void OnFindURLMimeType(const GURL& url,
#if BUILDFLAG(ENABLE_PLUGINS)
content::WebPluginInfo plugin;
result = result || content::PluginService::GetInstance()->GetPluginInfo(
@ -75,10 +75,10 @@ index 962bb7e2de76..40fc7e92c7cb 100644
GetContentClient()->browser()->GetUserAgent());
version.SetString("V8-Version", V8_VERSION_STRING);
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
index 2b0f1c354cf2..2d2dde9412c3 100644
index 4ff0e88bce7a..abca390b7f82 100644
--- content/browser/loader/navigation_url_loader_impl.cc
+++ content/browser/loader/navigation_url_loader_impl.cc
@@ -611,6 +611,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest(
@@ -628,6 +628,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest(
resource_request_->has_user_gesture,
resource_request_->request_initiator, &loader_factory);
@ -92,7 +92,7 @@ index 2b0f1c354cf2..2d2dde9412c3 100644
if (loader_factory) {
factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
std::move(loader_factory));
@@ -814,7 +821,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse(
@@ -831,7 +838,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse(
frame_tree_node->current_frame_host()->GetProcess()->GetID();
int routing_id = frame_tree_node->current_frame_host()->GetRoutingID();
bool has_plugin = PluginService::GetInstance()->GetPluginInfo(
@ -187,73 +187,67 @@ index 632ae86c6fd6..55b749ec1242 100644
GetPluginsCallback callback,
const std::vector<WebPluginInfo>& all_plugins);
diff --git content/browser/renderer_host/render_frame_message_filter.cc content/browser/renderer_host/render_frame_message_filter.cc
index 9cc3d077d14b..94af64f0c960 100644
--- content/browser/renderer_host/render_frame_message_filter.cc
+++ content/browser/renderer_host/render_frame_message_filter.cc
@@ -144,6 +144,7 @@ void RenderFrameMessageFilter::OverrideThreadForMessage(
void RenderFrameMessageFilter::OnGetPluginInfo(
int render_frame_id,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool* found,
@@ -151,8 +152,9 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
std::string* actual_mime_type) {
bool allow_wildcard = true;
*found = plugin_service_->GetPluginInfo(
- render_process_id_, render_frame_id, url, main_frame_origin, mime_type,
- allow_wildcard, nullptr, info, actual_mime_type);
+ render_process_id_, render_frame_id, url, is_main_frame,
+ main_frame_origin, mime_type, allow_wildcard, nullptr, info,
+ actual_mime_type);
diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc
index ea74ff6875fd..0c14ce034b96 100644
--- content/browser/renderer_host/render_frame_host_impl.cc
+++ content/browser/renderer_host/render_frame_host_impl.cc
@@ -10452,6 +10452,7 @@ void RenderFrameHostImpl::BindHungDetectorHost(
}
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
diff --git content/browser/renderer_host/render_frame_message_filter.h content/browser/renderer_host/render_frame_message_filter.h
index 100c3936190c..b6a37c4220d9 100644
--- content/browser/renderer_host/render_frame_message_filter.h
+++ content/browser/renderer_host/render_frame_message_filter.h
@@ -66,6 +66,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter {
void OnGetPluginInfo(int render_frame_id,
const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
bool* found,
diff --git content/common/frame_messages.h content/common/frame_messages.h
index 4bb04980b544..4e1e448a8bfc 100644
--- content/common/frame_messages.h
+++ content/common/frame_messages.h
@@ -249,9 +249,10 @@ IPC_MESSAGE_ROUTED2(FrameMsg_CustomContextMenuAction,
// type. If there is no matching plugin, |found| is false.
// |actual_mime_type| is the actual mime type supported by the
// found plugin.
-IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo,
+IPC_SYNC_MESSAGE_CONTROL5_3(FrameHostMsg_GetPluginInfo,
int /* render_frame_id */,
GURL /* url */,
+ bool /* is_main_frame */,
url::Origin /* main_frame_origin */,
std::string /* mime_type */,
bool /* found */,
void RenderFrameHostImpl::GetPluginInfo(const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
GetPluginInfoCallback callback) {
@@ -10459,7 +10460,8 @@ void RenderFrameHostImpl::GetPluginInfo(const GURL& url,
WebPluginInfo info;
std::string actual_mime_type;
bool found = PluginServiceImpl::GetInstance()->GetPluginInfo(
- GetProcess()->GetID(), routing_id_, url, main_frame_origin, mime_type,
+ GetProcess()->GetID(), routing_id_, url, is_main_frame,
+ main_frame_origin, mime_type,
allow_wildcard, nullptr, &info, &actual_mime_type);
std::move(callback).Run(found, info, actual_mime_type);
}
diff --git content/browser/renderer_host/render_frame_host_impl.h content/browser/renderer_host/render_frame_host_impl.h
index 6f7b14d24a4d..8b34229944a8 100644
--- content/browser/renderer_host/render_frame_host_impl.h
+++ content/browser/renderer_host/render_frame_host_impl.h
@@ -2234,6 +2234,7 @@ class CONTENT_EXPORT RenderFrameHostImpl
int32_t plugin_child_id,
const base::FilePath& path) override;
void GetPluginInfo(const GURL& url,
+ bool is_main_frame,
const url::Origin& main_frame_origin,
const std::string& mime_type,
GetPluginInfoCallback callback) override;
diff --git content/common/pepper_plugin.mojom content/common/pepper_plugin.mojom
index a415743ed665..5115a2407a8b 100644
--- content/common/pepper_plugin.mojom
+++ content/common/pepper_plugin.mojom
@@ -29,6 +29,7 @@ interface PepperHost {
// found plugin.
[Sync]
GetPluginInfo(url.mojom.Url url,
+ bool is_main_frame,
url.mojom.Origin main_frame_origin,
string mime_type) =>
(bool found,
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
index 4438e0417b3c..cdc59afa7f54 100644
index c8926e0e832d..d50adb22082e 100644
--- content/public/browser/content_browser_client.cc
+++ content/public/browser/content_browser_client.cc
@@ -9,7 +9,7 @@
// declarations instead of including more headers. If that is infeasible, adjust
// the limit. For more info, see
// https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md
-#pragma clang max_tokens_here 830000
+// #pragma clang max_tokens_here 830000
-#pragma clang max_tokens_here 850000
+// #pragma clang max_tokens_here 850000
#include <utility>
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
index df6e463d1518..68ab6d8748eb 100644
index 3aed911c525b..1ac73a132e3c 100644
--- content/public/browser/content_browser_client.h
+++ content/public/browser/content_browser_client.h
@@ -32,6 +32,7 @@
@ -264,7 +258,7 @@ index df6e463d1518..68ab6d8748eb 100644
#include "content/public/common/page_visibility_state.h"
#include "content/public/common/window_container_type.mojom-forward.h"
#include "device/vr/buildflags/buildflags.h"
@@ -1686,6 +1687,14 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1731,6 +1732,14 @@ class CONTENT_EXPORT ContentBrowserClient {
const base::Optional<url::Origin>& initiating_origin,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
@ -279,7 +273,7 @@ index df6e463d1518..68ab6d8748eb 100644
// Creates an OverlayWindow to be used for Picture-in-Picture. This window
// will house the content shown when in Picture-in-Picture mode. This will
// return a new OverlayWindow.
@@ -1757,6 +1766,10 @@ class CONTENT_EXPORT ContentBrowserClient {
@@ -1802,6 +1811,10 @@ class CONTENT_EXPORT ContentBrowserClient {
// Used as part of the user agent string.
virtual std::string GetProduct();
@ -315,10 +309,10 @@ index 98c59005599e..69752184745d 100644
WebPluginInfo* plugin) = 0;
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
index a4695ba832fc..3eb41cb569b1 100644
index 007e4df297a8..52017e661809 100644
--- content/public/renderer/content_renderer_client.h
+++ content/public/renderer/content_renderer_client.h
@@ -85,6 +85,9 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -83,6 +83,9 @@ class CONTENT_EXPORT ContentRendererClient {
// binding requests from RenderProcessHost::BindReceiver().
virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {}
@ -328,7 +322,7 @@ index a4695ba832fc..3eb41cb569b1 100644
// Notifies that a new RenderFrame has been created.
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
@@ -301,6 +304,10 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -299,6 +302,10 @@ class CONTENT_EXPORT ContentRendererClient {
// This method may invalidate the frame.
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
@ -340,24 +334,24 @@ index a4695ba832fc..3eb41cb569b1 100644
// started.
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
index fcb99889673b..9d50aa58f325 100644
index 0c9fc86e80a1..6653b5de4385 100644
--- content/renderer/render_frame_impl.cc
+++ content/renderer/render_frame_impl.cc
@@ -3639,7 +3639,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
@@ -3564,7 +3564,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
WebPluginInfo info;
std::string mime_type;
bool found = false;
Send(new FrameHostMsg_GetPluginInfo(
- routing_id_, params.url, frame_->Top()->GetSecurityOrigin(),
+ routing_id_, params.url, frame_->Parent() == nullptr,
+ frame_->Top()->GetSecurityOrigin(),
params.mime_type.Utf8(), &found, &info, &mime_type));
- GetPepperHost()->GetPluginInfo(params.url, frame_->Top()->GetSecurityOrigin(),
+ GetPepperHost()->GetPluginInfo(params.url, frame_->Parent() == nullptr,
+ frame_->Top()->GetSecurityOrigin(),
params.mime_type.Utf8(), &found, &info,
&mime_type);
if (!found)
return nullptr;
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
index aa1fc3821b47..922aacc8f08e 100644
index ebc8e7006453..51f7d8044925 100644
--- content/renderer/render_thread_impl.cc
+++ content/renderer/render_thread_impl.cc
@@ -609,6 +609,8 @@ void RenderThreadImpl::Init() {
@@ -608,6 +608,8 @@ void RenderThreadImpl::Init() {
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
URLLoaderThrottleProviderType::kFrame);
@ -367,10 +361,10 @@ index aa1fc3821b47..922aacc8f08e 100644
&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this)));
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
index d21f7e95c856..98f3739e60fc 100644
index c5974db34669..520536f76c72 100644
--- content/renderer/renderer_blink_platform_impl.cc
+++ content/renderer/renderer_blink_platform_impl.cc
@@ -996,6 +996,15 @@ void RendererBlinkPlatformImpl::SetActiveURL(const blink::WebURL& url,
@@ -1026,6 +1026,15 @@ void RendererBlinkPlatformImpl::SetActiveURL(const blink::WebURL& url,
//------------------------------------------------------------------------------
@ -387,10 +381,10 @@ index d21f7e95c856..98f3739e60fc 100644
if (!code_cache_host_) {
code_cache_host_ = mojo::SharedRemote<blink::mojom::CodeCacheHost>(
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
index c8470ab1919a..2c000a557a0a 100644
index bd141ff762ab..857a92a35a84 100644
--- content/renderer/renderer_blink_platform_impl.h
+++ content/renderer/renderer_blink_platform_impl.h
@@ -218,6 +218,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -219,6 +219,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
void SetActiveURL(const blink::WebURL& url,
const blink::WebString& top_url) override;

View File

@ -111,18 +111,18 @@ index 2aba28d210db..00edc202e2c4 100644
return RunContentProcess(params, runner.get());
}
diff --git content/app/content_main_runner_impl.cc content/app/content_main_runner_impl.cc
index 811017f5d455..57055727e83d 100644
index 7873fad0a61b..425c30a56699 100644
--- content/app/content_main_runner_impl.cc
+++ content/app/content_main_runner_impl.cc
@@ -48,6 +48,7 @@
#include "base/task/post_task.h"
@@ -44,6 +44,7 @@
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/threading/hang_watcher.h"
#include "base/threading/platform_thread.h"
+#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "components/discardable_memory/service/discardable_shared_memory_manager.h"
#include "components/download/public/common/download_task_runner.h"
@@ -1089,6 +1090,11 @@ void ContentMainRunnerImpl::Shutdown() {
#include "build/build_config.h"
@@ -1092,6 +1093,11 @@ void ContentMainRunnerImpl::Shutdown() {
is_shutdown_ = true;
}

View File

@ -209,10 +209,10 @@ index 9ea80370a842..3043f7d32f33 100644
extern void InitCrashKeysForTesting();
diff --git components/crash/core/app/crash_reporter_client.cc components/crash/core/app/crash_reporter_client.cc
index 1d0fb4f2a633..8226a3d792be 100644
index 89b4bfccd5d3..7cb0a85470d2 100644
--- components/crash/core/app/crash_reporter_client.cc
+++ components/crash/core/app/crash_reporter_client.cc
@@ -88,7 +88,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
@@ -87,7 +87,7 @@ int CrashReporterClient::GetResultCodeRespawnFailed() {
}
#endif
@ -221,7 +221,7 @@ index 1d0fb4f2a633..8226a3d792be 100644
void CrashReporterClient::GetProductNameAndVersion(const char** product_name,
const char** version) {
}
@@ -97,6 +97,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
@@ -96,6 +96,7 @@ void CrashReporterClient::GetProductNameAndVersion(std::string* product_name,
std::string* version,
std::string* channel) {}
@ -229,15 +229,15 @@ index 1d0fb4f2a633..8226a3d792be 100644
base::FilePath CrashReporterClient::GetReporterLogFilename() {
return base::FilePath();
}
@@ -106,6 +107,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename,
@@ -105,6 +106,7 @@ bool CrashReporterClient::HandleCrashDump(const char* crashdump_filename,
return false;
}
#endif
+#endif
#if defined(OS_WIN)
bool CrashReporterClient::GetCrashDumpLocation(base::string16* crash_dir) {
@@ -140,6 +142,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
bool CrashReporterClient::GetCrashDumpLocation(std::wstring* crash_dir) {
@@ -139,6 +141,28 @@ bool CrashReporterClient::ReportingIsEnforcedByPolicy(bool* breakpad_enabled) {
return false;
}
@ -251,8 +251,8 @@ index 1d0fb4f2a633..8226a3d792be 100644
+}
+
+#if defined(OS_WIN)
+base::string16 CrashReporterClient::GetCrashExternalHandler(
+ const base::string16& exe_dir) {
+std::wstring CrashReporterClient::GetCrashExternalHandler(
+ const std::wstring& exe_dir) {
+ return exe_dir + L"\\crashpad_handler.exe";
+}
+#endif
@ -266,7 +266,7 @@ index 1d0fb4f2a633..8226a3d792be 100644
#if defined(OS_ANDROID)
unsigned int CrashReporterClient::GetCrashDumpPercentage() {
return 100;
@@ -202,9 +226,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
@@ -201,9 +225,11 @@ bool CrashReporterClient::ShouldMonitorCrashHandlerExpensively() {
return false;
}
@ -282,7 +282,7 @@ index 1d0fb4f2a633..8226a3d792be 100644
} // namespace crash_reporter
diff --git components/crash/core/app/crash_reporter_client.h components/crash/core/app/crash_reporter_client.h
index aaa9ad1d58d7..14b98b2e6598 100644
index 39557cce4744..236806090021 100644
--- components/crash/core/app/crash_reporter_client.h
+++ components/crash/core/app/crash_reporter_client.h
@@ -5,7 +5,9 @@
@ -293,9 +293,9 @@ index aaa9ad1d58d7..14b98b2e6598 100644
#include <string>
+#include <vector>
#include "base/strings/string16.h"
#include "build/build_config.h"
@@ -88,7 +90,7 @@ class CrashReporterClient {
@@ -87,7 +89,7 @@ class CrashReporterClient {
virtual int GetResultCodeRespawnFailed();
#endif
@ -304,7 +304,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644
// Returns a textual description of the product type and version to include
// in the crash report. Neither out parameter should be set to NULL.
// TODO(jperaza): Remove the 2-parameter overload of this method once all
@@ -99,6 +101,7 @@ class CrashReporterClient {
@@ -98,6 +100,7 @@ class CrashReporterClient {
std::string* version,
std::string* channel);
@ -312,7 +312,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644
virtual base::FilePath GetReporterLogFilename();
// Custom crash minidump handler after the minidump is generated.
@@ -108,6 +111,7 @@ class CrashReporterClient {
@@ -107,6 +110,7 @@ class CrashReporterClient {
// libc nor allocate memory normally.
virtual bool HandleCrashDump(const char* crashdump_filename,
uint64_t crash_pid);
@ -320,7 +320,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644
#endif
// The location where minidump files should be written. Returns true if
@@ -205,6 +209,27 @@ class CrashReporterClient {
@@ -204,6 +208,27 @@ class CrashReporterClient {
// Returns true if breakpad should run in the given process type.
virtual bool EnableBreakpadForProcess(const std::string& process_type);
@ -330,7 +330,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644
+
+#if defined(OS_WIN)
+ // Returns the absolute path to the external crash handler exe.
+ virtual base::string16 GetCrashExternalHandler(const base::string16& exe_dir);
+ virtual std::wstring GetCrashExternalHandler(const std::wstring& exe_dir);
+#endif
+
+#if defined(OS_MAC)
@ -349,7 +349,7 @@ index aaa9ad1d58d7..14b98b2e6598 100644
} // namespace crash_reporter
diff --git components/crash/core/app/crashpad.cc components/crash/core/app/crashpad.cc
index 64ca38330be7..4de20a66cd99 100644
index 5117ded1e214..0d86e0363315 100644
--- components/crash/core/app/crashpad.cc
+++ components/crash/core/app/crashpad.cc
@@ -152,7 +152,8 @@ void InitializeCrashpadImpl(bool initial_client,
@ -463,23 +463,23 @@ index eb675321436a..4e74af742ed5 100644
handler_path, database_path, metrics_path, url,
GetProcessSimpleAnnotations(), arguments, true, false);
diff --git components/crash/core/app/crashpad_win.cc components/crash/core/app/crashpad_win.cc
index c199b467ffeb..1037a285b74c 100644
index c66a6dfc6f5d..2d80782ab341 100644
--- components/crash/core/app/crashpad_win.cc
+++ components/crash/core/app/crashpad_win.cc
@@ -36,8 +36,8 @@ void GetPlatformCrashpadAnnotations(
base::string16 product_name, version, special_build, channel_name;
std::wstring product_name, version, special_build, channel_name;
crash_reporter_client->GetProductNameAndVersion(
exe_file, &product_name, &version, &special_build, &channel_name);
- (*annotations)["prod"] = base::UTF16ToUTF8(product_name);
- (*annotations)["ver"] = base::UTF16ToUTF8(version);
+ (*annotations)["product"] = base::UTF16ToUTF8(product_name);
+ (*annotations)["version"] = base::UTF16ToUTF8(version);
- (*annotations)["prod"] = base::WideToUTF8(product_name);
- (*annotations)["ver"] = base::WideToUTF8(version);
+ (*annotations)["product"] = base::WideToUTF8(product_name);
+ (*annotations)["version"] = base::WideToUTF8(version);
#if BUILDFLAG(GOOGLE_CHROME_BRANDING)
// Empty means stable.
const bool allow_empty_channel = true;
@@ -49,9 +49,9 @@ void GetPlatformCrashpadAnnotations(
if (!special_build.empty())
(*annotations)["special"] = base::UTF16ToUTF8(special_build);
(*annotations)["special"] = base::WideToUTF8(special_build);
#if defined(ARCH_CPU_X86)
- (*annotations)["plat"] = std::string("Win32");
+ (*annotations)["platform"] = std::string("win32");

View File

@ -0,0 +1,23 @@
diff --git components/embedder_support/user_agent_utils.cc components/embedder_support/user_agent_utils.cc
index cf596ae9aae8..7c1869000cf3 100644
--- components/embedder_support/user_agent_utils.cc
+++ components/embedder_support/user_agent_utils.cc
@@ -7,6 +7,7 @@
#include "base/command_line.h"
#include "base/strings/strcat.h"
#include "build/branding_buildflags.h"
+#include "chrome/common/chrome_switches.h"
#include "components/embedder_support/switches.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/web_contents.h"
@@ -20,6 +21,10 @@
namespace embedder_support {
std::string GetProduct() {
+ base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kProductVersion))
+ return command_line->GetSwitchValueASCII(switches::kProductVersion);
+
return version_info::GetProductNameAndVersionForUserAgent();
}

View File

@ -1,53 +1,52 @@
diff --git chrome/browser/extensions/api/streams_private/streams_private_api.cc chrome/browser/extensions/api/streams_private/streams_private_api.cc
index 3ce42bd3bc3c..e5bda4ae4f1f 100644
index 5c903a13a14e..d385c6c0c95c 100644
--- chrome/browser/extensions/api/streams_private/streams_private_api.cc
+++ chrome/browser/extensions/api/streams_private/streams_private_api.cc
@@ -6,6 +6,7 @@
#include <utility>
+#include "cef/libcef/features/features.h"
+#include "cef/libcef/features/runtime.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/prefetch/no_state_prefetch/chrome_prerender_contents_delegate.h"
#include "components/no_state_prefetch/browser/prerender_contents.h"
#include "chrome/browser/prefetch/no_state_prefetch/chrome_no_state_prefetch_contents_delegate.h"
#include "components/no_state_prefetch/browser/no_state_prefetch_contents.h"
@@ -42,6 +43,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
if (!web_contents)
return;
+#if !BUILDFLAG(ENABLE_CEF)
// If the request was for a prerender, abort the prerender and do not
// continue. This is because plugins cancel prerender, see
+ if (!cef::IsAlloyRuntimeEnabled()) {
// If the request was for NoStatePrefetch, abort the prefetcher and do not
// continue. This is because plugins cancel NoStatePrefetch, see
// http://crbug.com/343590.
@@ -51,6 +53,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
prerender_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD);
@@ -52,6 +54,7 @@ void StreamsPrivateAPI::SendExecuteMimeTypeHandlerEvent(
no_state_prefetch_contents->Destroy(prerender::FINAL_STATUS_DOWNLOAD);
return;
}
+#endif // !BUILDFLAG(ENABLE_CEF)
+ }
auto* browser_context = web_contents->GetBrowserContext();
diff --git extensions/browser/extension_host.cc extensions/browser/extension_host.cc
index 0f588c70627f..a1b9ea21cc72 100644
index b4878f7497df..8a87d04740b7 100644
--- extensions/browser/extension_host.cc
+++ extensions/browser/extension_host.cc
@@ -66,11 +66,12 @@ ExtensionHost::ExtensionHost(const Extension* extension,
@@ -61,11 +61,12 @@ ExtensionHost::ExtensionHost(const Extension* extension,
DCHECK(host_type == VIEW_TYPE_EXTENSION_BACKGROUND_PAGE ||
host_type == VIEW_TYPE_EXTENSION_DIALOG ||
host_type == VIEW_TYPE_EXTENSION_POPUP);
- host_contents_ = WebContents::Create(
- WebContents::CreateParams(browser_context_, site_instance)),
- content::WebContentsObserver::Observe(host_contents_.get());
+ host_contents_owned_ = WebContents::Create(
+ WebContents::CreateParams(browser_context_, site_instance));
WebContents::CreateParams(browser_context_, site_instance)),
- content::WebContentsObserver::Observe(host_contents_.get());
+ host_contents_ = host_contents_owned_.get();
+ content::WebContentsObserver::Observe(host_contents_);
host_contents_->SetDelegate(this);
- SetViewType(host_contents_.get(), host_type);
+ SetViewType(host_contents_, host_type);
main_frame_host_ = host_contents_->GetMainFrame();
render_view_host_ = host_contents_->GetRenderViewHost();
@@ -85,6 +86,48 @@ ExtensionHost::ExtensionHost(const Extension* extension,
// Listen for when an extension is unloaded from the same profile, as it may
@@ -79,6 +80,44 @@ ExtensionHost::ExtensionHost(const Extension* extension,
dispatcher()->set_delegate(this);
}
@ -62,10 +61,6 @@ index 0f588c70627f..a1b9ea21cc72 100644
+ extension_id_(extension->id()),
+ browser_context_(browser_context),
+ host_contents_(host_contents),
+ render_view_host_(nullptr),
+ is_render_view_creation_pending_(false),
+ has_loaded_once_(false),
+ document_element_available_(false),
+ initial_url_(url),
+ extension_host_type_(host_type) {
+ DCHECK(delegate);
@ -80,7 +75,7 @@ index 0f588c70627f..a1b9ea21cc72 100644
+ content::WebContentsObserver::Observe(host_contents_);
+ SetViewType(host_contents_, host_type);
+
+ render_view_host_ = host_contents_->GetRenderViewHost();
+ main_frame_host_ = host_contents_->GetMainFrame();
+
+ // Listen for when an extension is unloaded from the same profile, as it may
+ // be the same extension that this points to.
@ -97,10 +92,10 @@ index 0f588c70627f..a1b9ea21cc72 100644
ExtensionRegistry::Get(browser_context_)->RemoveObserver(this);
diff --git extensions/browser/extension_host.h extensions/browser/extension_host.h
index 11bfec21cc9f..416de61f85fa 100644
index 59798a628937..2018abb8324b 100644
--- extensions/browser/extension_host.h
+++ extensions/browser/extension_host.h
@@ -51,13 +51,19 @@ class ExtensionHost : public DeferredStartRenderHost,
@@ -52,13 +52,19 @@ class ExtensionHost : public DeferredStartRenderHost,
ExtensionHost(const Extension* extension,
content::SiteInstance* site_instance,
const GURL& url, ViewType host_type);
@ -118,10 +113,10 @@ index 11bfec21cc9f..416de61f85fa 100644
const std::string& extension_id() const { return extension_id_; }
- content::WebContents* host_contents() const { return host_contents_.get(); }
+ content::WebContents* host_contents() const { return host_contents_; }
content::RenderViewHost* render_view_host() const;
content::RenderFrameHost* main_frame_host() const { return main_frame_host_; }
content::RenderProcessHost* render_process_host() const;
bool has_loaded_once() const { return has_loaded_once_; }
@@ -178,7 +184,8 @@ class ExtensionHost : public DeferredStartRenderHost,
@@ -180,7 +186,8 @@ class ExtensionHost : public DeferredStartRenderHost,
content::BrowserContext* browser_context_;
// The host for our HTML content.
@ -129,8 +124,8 @@ index 11bfec21cc9f..416de61f85fa 100644
+ std::unique_ptr<content::WebContents> host_contents_owned_;
+ content::WebContents* host_contents_;
// 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
// A pointer to the current or speculative main frame in `host_contents_`. We
// can't access this frame through the `host_contents_` directly as it does
diff --git extensions/browser/extensions_browser_client.h extensions/browser/extensions_browser_client.h
index c2d194ec21be..3a7354f648ed 100644
--- extensions/browser/extensions_browser_client.h
@ -167,10 +162,10 @@ index c2d194ec21be..3a7354f648ed 100644
// once each time the extensions system is loaded per browser_context. The
// implementation may wish to use the BrowserContext to record the current
diff --git extensions/browser/process_manager.cc extensions/browser/process_manager.cc
index 337921842180..c78e1d114a12 100644
index 2bc2248ba920..583419786f28 100644
--- extensions/browser/process_manager.cc
+++ extensions/browser/process_manager.cc
@@ -395,9 +395,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
@@ -389,9 +389,16 @@ bool ProcessManager::CreateBackgroundHost(const Extension* extension,
return true; // TODO(kalman): return false here? It might break things...
DVLOG(1) << "CreateBackgroundHost " << extension->id();
@ -187,6 +182,6 @@ index 337921842180..c78e1d114a12 100644
+ host = new ExtensionHost(extension, GetSiteInstanceForURL(url).get(), url,
+ VIEW_TYPE_EXTENSION_BACKGROUND_PAGE);
+ }
host->CreateRenderViewSoon();
host->CreateRendererSoon();
OnBackgroundHostCreated(host);
return true;

View File

@ -1,8 +1,8 @@
diff --git .gn .gn
index 0c25000917fb..cdaf3a6799c2 100644
index 01b2f70c1378..a14dd637774e 100644
--- .gn
+++ .gn
@@ -275,6 +275,8 @@ exec_script_whitelist =
@@ -190,6 +190,8 @@ exec_script_whitelist =
"//chrome/android/webapk/shell_apk/prepare_upload_dir/BUILD.gn",
@ -12,7 +12,7 @@ index 0c25000917fb..cdaf3a6799c2 100644
# https://crbug.com/474506.
"//clank/java/BUILD.gn",
diff --git BUILD.gn BUILD.gn
index 86c82ac5cf8a..ea0959f631b4 100644
index 6df566bd7df4..d8f539493342 100644
--- BUILD.gn
+++ BUILD.gn
@@ -16,6 +16,7 @@ import("//build/config/sanitizers/sanitizers.gni")
@ -23,8 +23,8 @@ index 86c82ac5cf8a..ea0959f631b4 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/media/router/features.gni")
import("//components/nacl/features.gni")
@@ -244,6 +245,9 @@ group("gn_all") {
"//third_party/angle/src/tests:angle_white_box_tests",
@@ -247,6 +248,9 @@ group("gn_all") {
"//media/cast:cast_unittests",
"//third_party/catapult/telemetry:bitmaptools($host_toolchain)",
]
+ if (enable_cef) {
@ -79,7 +79,7 @@ index 839144aa1e9b..29c8ab32398a 100644
+_OBJC_METACLASS_$_UnderlayOpenGLHostingWindow
+
diff --git chrome/chrome_paks.gni chrome/chrome_paks.gni
index 6ad9c87a3adf..a47694446b9a 100644
index 63e7ca2c10c1..14f777c10cd6 100644
--- chrome/chrome_paks.gni
+++ chrome/chrome_paks.gni
@@ -4,6 +4,7 @@
@ -90,8 +90,8 @@ index 6ad9c87a3adf..a47694446b9a 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/resources/pdf/ink/ink.gni")
import("//chrome/common/features.gni")
@@ -255,6 +256,10 @@ template("chrome_extra_paks") {
"//chrome/browser/resources/welcome:welcome_resources",
@@ -269,6 +270,10 @@ template("chrome_extra_paks") {
"//chrome/browser/resources/welcome:resources",
]
}
+ if (enable_cef) {
@ -125,7 +125,7 @@ index a64a23560460..b08eee1f789a 100644
source_patterns +=
[ "${root_gen_dir}/extensions/strings/extensions_strings_" ]
diff --git chrome/installer/mini_installer/BUILD.gn chrome/installer/mini_installer/BUILD.gn
index 5f5cb1c752f2..ef0a01caf9cd 100644
index ae43217ef207..2f0b95687263 100644
--- chrome/installer/mini_installer/BUILD.gn
+++ chrome/installer/mini_installer/BUILD.gn
@@ -6,6 +6,7 @@ import("//build/config/compiler/compiler.gni")

View File

@ -1,8 +1,8 @@
diff --git tools/gritsettings/resource_ids.spec tools/gritsettings/resource_ids.spec
index 1343d7c03b07..79843c9d7ae7 100644
index c9e9d621c730..edeaa3662ede 100644
--- tools/gritsettings/resource_ids.spec
+++ tools/gritsettings/resource_ids.spec
@@ -703,4 +703,13 @@
@@ -739,4 +739,13 @@
# 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

@ -0,0 +1,160 @@
diff --git cpp/src/phonenumbers/encoding_utils.h cpp/src/phonenumbers/encoding_utils.h
index d4271832..0c65d2bf 100644
--- cpp/src/phonenumbers/encoding_utils.h
+++ cpp/src/phonenumbers/encoding_utils.h
@@ -29,7 +29,7 @@ class EncodingUtils {
// the function stores 0xFFFD in the output variable and returns 1.
static inline int DecodeUTF8Char(const char* in, char32* out) {
Rune r;
- int len = chartorune(&r, in);
+ int len = _chartorune(&r, in);
*out = r;
return len;
}
diff --git cpp/src/phonenumbers/utf/rune.c cpp/src/phonenumbers/utf/rune.c
index b4aa93b5..6f7b0358 100644
--- cpp/src/phonenumbers/utf/rune.c
+++ cpp/src/phonenumbers/utf/rune.c
@@ -64,7 +64,7 @@ enum
* reasons, we return 1 instead of 0.
*/
int
-charntorune(Rune *rune, const char *str, int length)
+_charntorune(Rune *rune, const char *str, int length)
{
int c, c1, c2, c3;
long l;
@@ -167,7 +167,7 @@ badlen:
* null-terminated strings.
*/
int
-chartorune(Rune *rune, const char *str)
+_chartorune(Rune *rune, const char *str)
{
int c, c1, c2, c3;
long l;
@@ -247,12 +247,12 @@ bad:
int
isvalidcharntorune(const char* str, int length, Rune* rune, int* consumed)
{
- *consumed = charntorune(rune, str, length);
+ *consumed = _charntorune(rune, str, length);
return *rune != Runeerror || *consumed == 3;
}
int
-runetochar(char *str, const Rune *rune)
+_runetochar(char *str, const Rune *rune)
{
/* Runes are signed, so convert to unsigned for range check. */
unsigned long c;
@@ -311,15 +311,15 @@ runetochar(char *str, const Rune *rune)
}
int
-runelen(Rune rune)
+_runelen(Rune rune)
{
char str[10];
- return runetochar(str, &rune);
+ return _runetochar(str, &rune);
}
int
-runenlen(const Rune *r, int nrune)
+_runenlen(const Rune *r, int nrune)
{
int nb, c;
@@ -339,7 +339,7 @@ runenlen(const Rune *r, int nrune)
}
int
-fullrune(const char *str, int n)
+_fullrune(const char *str, int n)
{
if (n > 0) {
int c = *(uchar*)str;
diff --git cpp/src/phonenumbers/utf/unicodetext.cc cpp/src/phonenumbers/utf/unicodetext.cc
index 11f68f76..86504a31 100644
--- cpp/src/phonenumbers/utf/unicodetext.cc
+++ cpp/src/phonenumbers/utf/unicodetext.cc
@@ -362,7 +362,7 @@ void UnicodeText::push_back(char32 c) {
if (UniLib::IsValidCodepoint(c)) {
char buf[UTFmax];
Rune rune = c;
- int len = runetochar(buf, &rune);
+ int len = _runetochar(buf, &rune);
if (UniLib::IsInterchangeValid(buf, len)) {
repr_.append(buf, len);
} else {
diff --git cpp/src/phonenumbers/utf/unilib.cc cpp/src/phonenumbers/utf/unilib.cc
index e890f974..ce549363 100644
--- cpp/src/phonenumbers/utf/unilib.cc
+++ cpp/src/phonenumbers/utf/unilib.cc
@@ -50,7 +50,7 @@ int SpanInterchangeValid(const char* begin, int byte_length) {
const char* p = begin;
const char* end = begin + byte_length;
while (p < end) {
- int bytes_consumed = charntorune(&rune, p, end - p);
+ int bytes_consumed = _charntorune(&rune, p, end - p);
// We want to accept Runeerror == U+FFFD as a valid char, but it is used
// by chartorune to indicate error. Luckily, the real codepoint is size 3
// while errors return bytes_consumed <= 1.
diff --git cpp/src/phonenumbers/utf/utf.h cpp/src/phonenumbers/utf/utf.h
index 72d01ed6..35fd0ea9 100644
--- cpp/src/phonenumbers/utf/utf.h
+++ cpp/src/phonenumbers/utf/utf.h
@@ -46,7 +46,7 @@ extern "C" {
// runetochar copies (encodes) one rune, pointed to by r, to at most
// UTFmax bytes starting at s and returns the number of bytes generated.
-int runetochar(char* s, const Rune* r);
+int _runetochar(char* s, const Rune* r);
// chartorune copies (decodes) at most UTFmax bytes starting at s to
@@ -59,7 +59,7 @@ int runetochar(char* s, const Rune* r);
// Unicode value 0 (i.e., ASCII NULL). A byte value of 0 is illegal
// anywhere else in a UTF sequence.
-int chartorune(Rune* r, const char* s);
+int _chartorune(Rune* r, const char* s);
// charntorune is like chartorune, except that it will access at most
@@ -69,7 +69,7 @@ int chartorune(Rune* r, const char* s);
//
// Added 2004-09-24 by Wei-Hwa Huang
-int charntorune(Rune* r, const char* s, int n);
+int _charntorune(Rune* r, const char* s, int n);
// isvalidcharntorune(str, n, r, consumed)
// is a convenience function that calls "*consumed = charntorune(r, str, n)"
@@ -80,13 +80,13 @@ int isvalidcharntorune(const char* str, int n, Rune* r, int* consumed);
// runelen returns the number of bytes required to convert r into UTF.
-int runelen(Rune r);
+int _runelen(Rune r);
// runenlen returns the number of bytes required to convert the n
// runes pointed to by r into UTF.
-int runenlen(const Rune* r, int n);
+int _runenlen(const Rune* r, int n);
// fullrune returns 1 if the string s of length n is long enough to be
@@ -95,7 +95,7 @@ int runenlen(const Rune* r, int n);
// by programs that obtain input one byte at a time and need to know
// when a full rune has arrived.
-int fullrune(const char* s, int n);
+int _fullrune(const char* s, int n);
// The following routines are analogous to the corresponding string
// routines with "utf" substituted for "str", and "rune" substituted

View File

@ -25,7 +25,7 @@ index 0aaed76c1dda..517c3d8b5772 100644
if (base::PathExists(sandbox_candidate))
sandbox_binary = sandbox_candidate;
diff --git ui/gl/init/gl_initializer_linux_x11.cc ui/gl/init/gl_initializer_linux_x11.cc
index fb6aab8f450c..115f88ed649e 100644
index b1f21c4bf0e0..0eea60fa82f7 100644
--- ui/gl/init/gl_initializer_linux_x11.cc
+++ ui/gl/init/gl_initializer_linux_x11.cc
@@ -82,7 +82,7 @@ bool InitializeStaticEGLInternalFromLibrary(GLImplementation implementation) {

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