Update to Chromium version 122.0.6261.0 (#1250580)

Frame identifiers have changed from int64_t to string type. This is due
to https://crbug.com/1502660 which removes access to frame routing IDs
in the renderer process. New cross-process frame identifiers are 160-bit
values (32-bit child process ID + 128-bit local frame token) and most
easily represented as strings. All other frame-related expectations and
behaviors remain the same.
This commit is contained in:
Marshall Greenblatt 2024-01-25 21:12:43 -05:00
parent 2a86a02bdd
commit 2f1e782f62
156 changed files with 1452 additions and 1436 deletions

View File

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

View File

@ -38,7 +38,7 @@
'chrome/common/extensions/api/*_features.json',
'chrome/renderer/chrome_content_renderer_client.*',
'chrome/renderer/extensions/chrome_extensions_renderer_client.*',
'components/content_settings/core/common/content_settings_types.h',
'components/content_settings/core/common/content_settings_types.mojom',
'content/browser/renderer_host/render_widget_host_view_base.*',
'content/public/browser/content_browser_client.*',
'content/public/browser/render_widget_host_view.h',

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=d23df6f606a96b432905c5c80f29ab72915b8e01$
// $hash=e7f9480661f77931890085d6c5bf23d9842212e2$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_CAPI_H_
@ -165,15 +165,16 @@ typedef struct _cef_browser_t {
///
/// Returns the frame with the specified identifier, or NULL if not found.
///
struct _cef_frame_t*(CEF_CALLBACK* get_frame_byident)(
struct _cef_frame_t*(CEF_CALLBACK* get_frame_by_identifier)(
struct _cef_browser_t* self,
int64_t identifier);
const cef_string_t* identifier);
///
/// Returns the frame with the specified name, or NULL if not found.
///
struct _cef_frame_t*(CEF_CALLBACK* get_frame)(struct _cef_browser_t* self,
const cef_string_t* name);
struct _cef_frame_t*(CEF_CALLBACK* get_frame_by_name)(
struct _cef_browser_t* self,
const cef_string_t* name);
///
/// Returns the number of frames that currently exist.
@ -184,8 +185,7 @@ typedef struct _cef_browser_t {
/// Returns the identifiers of all existing frames.
///
void(CEF_CALLBACK* get_frame_identifiers)(struct _cef_browser_t* self,
size_t* identifiersCount,
int64_t* identifiers);
cef_string_list_t identifiers);
///
/// Returns the names of all existing frames.

View File

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

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=7294486141b2377198e994048a768db4a7cb9cd0$
// $hash=8f347a95168778ec0e686cdef93be3bc517e2f68$
//
#ifndef CEF_INCLUDE_CAPI_CEF_FRAME_CAPI_H_
@ -178,10 +178,12 @@ typedef struct _cef_frame_t {
cef_string_userfree_t(CEF_CALLBACK* get_name)(struct _cef_frame_t* self);
///
/// Returns the globally unique identifier for this frame or < 0 if the
/// Returns the globally unique identifier for this frame or NULL if the
/// underlying frame does not yet exist.
///
int64_t(CEF_CALLBACK* get_identifier)(struct _cef_frame_t* self);
// The resulting string must be freed by calling cef_string_userfree_free().
cef_string_userfree_t(CEF_CALLBACK* get_identifier)(
struct _cef_frame_t* self);
///
/// Returns the parent of this frame or NULL if this is the main (top-level)

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=62e7e781f3fef0d332b6a921d48a192fd0115295$
// $hash=8eec1100e8470cbe3ebc54d5962416d2fa4d57fb$
//
#ifndef CEF_INCLUDE_CAPI_CEF_MEDIA_ROUTER_CAPI_H_
@ -114,8 +114,8 @@ typedef struct _cef_media_router_t {
/// Returns the MediaRouter object associated with the global request context.
/// If |callback| is non-NULL it will be executed asnychronously on the UI
/// thread after the manager's storage has been initialized. Equivalent to
/// calling cef_request_context_t::cef_request_context_get_global_context()->get
/// _media_router().
/// calling cef_request_context_t::cef_request_context_get_global_context()-
/// >get_media_router().
///
CEF_EXPORT cef_media_router_t* cef_media_router_get_global(
struct _cef_completion_callback_t* callback);

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=ba8011bd357e466a94acfd86597f44af00f096a3$
// $hash=dd3f6003f9a8f59c2eb4320c382651a441086aee$
//
#ifndef CEF_INCLUDE_CAPI_CEF_SCHEME_CAPI_H_
@ -116,8 +116,8 @@ typedef struct _cef_scheme_handler_factory_t {
/// matches the specified |scheme_name| and optional |domain_name|. Returns
/// false (0) if an error occurs. This function may be called on any thread in
/// the browser process. Using this function is equivalent to calling cef_reques
/// t_context_t::cef_request_context_get_global_context()->register_scheme_handl
/// er_factory().
/// t_context_t::cef_request_context_get_global_context()-
/// >register_scheme_handler_factory().
///
CEF_EXPORT int cef_register_scheme_handler_factory(
const cef_string_t* scheme_name,
@ -128,8 +128,8 @@ CEF_EXPORT int cef_register_scheme_handler_factory(
/// Clear all scheme handler factories registered with the global request
/// context. Returns false (0) on error. This function may be called on any
/// thread in the browser process. Using this function is equivalent to calling
/// cef_request_context_t::cef_request_context_get_global_context()->clear_schem
/// e_handler_factories().
/// cef_request_context_t::cef_request_context_get_global_context()-
/// >clear_scheme_handler_factories().
///
CEF_EXPORT int cef_clear_scheme_handler_factories(void);

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 "d14f0a1044fad3677f4e3541ad4becc55e3e1a21"
#define CEF_API_HASH_UNIVERSAL "26455bea1da0a2592502ac7a3889bbb7c7c41652"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "74ea462bd443de49ae328d73dcbd1e4fde5d6cc5"
#define CEF_API_HASH_PLATFORM "e29ebe81ef26bdbf93ee46ca2f6437ffbb91bb36"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "8716cddadbd9316af1313f3cb8f8a42acdad369c"
#define CEF_API_HASH_PLATFORM "36f2affe168d233f9864b0c2d23144f01a737bac"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "12843112055d55c94bb2ea66f62b4935962d5c7e"
#define CEF_API_HASH_PLATFORM "cb887a91b5128574e18ff99b03798a8aed936561"
#endif
#ifdef __cplusplus

View File

@ -169,14 +169,15 @@ class CefBrowser : public virtual CefBaseRefCounted {
///
/// Returns the frame with the specified identifier, or NULL if not found.
///
/*--cef(capi_name=get_frame_byident)--*/
virtual CefRefPtr<CefFrame> GetFrame(int64_t identifier) = 0;
/*--cef()--*/
virtual CefRefPtr<CefFrame> GetFrameByIdentifier(
const CefString& identifier) = 0;
///
/// Returns the frame with the specified name, or NULL if not found.
///
/*--cef(optional_param=name)--*/
virtual CefRefPtr<CefFrame> GetFrame(const CefString& name) = 0;
virtual CefRefPtr<CefFrame> GetFrameByName(const CefString& name) = 0;
///
/// Returns the number of frames that currently exist.
@ -188,7 +189,7 @@ class CefBrowser : public virtual CefBaseRefCounted {
/// Returns the identifiers of all existing frames.
///
/*--cef(count_func=identifiers:GetFrameCount)--*/
virtual void GetFrameIdentifiers(std::vector<int64_t>& identifiers) = 0;
virtual void GetFrameIdentifiers(std::vector<CefString>& identifiers) = 0;
///
/// Returns the names of all existing frames.

View File

@ -180,11 +180,11 @@ class CefFrame : public virtual CefBaseRefCounted {
virtual CefString GetName() = 0;
///
/// Returns the globally unique identifier for this frame or < 0 if the
/// Returns the globally unique identifier for this frame or empty if the
/// underlying frame does not yet exist.
///
/*--cef()--*/
virtual int64_t GetIdentifier() = 0;
virtual CefString GetIdentifier() = 0;
///
/// Returns the parent of this frame or NULL if this is the main (top-level)

View File

@ -3545,23 +3545,24 @@ typedef enum {
CEF_PERMISSION_TYPE_AR_SESSION = 1 << 1,
CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM = 1 << 2,
CEF_PERMISSION_TYPE_CAMERA_STREAM = 1 << 3,
CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 4,
CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 5,
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 6,
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 7,
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 8,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 9,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 10,
CEF_PERMISSION_TYPE_MIDI = 1 << 11,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 12,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 13,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 14,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 15,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 16,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 17,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 18,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 19,
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 20,
CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL = 1 << 4,
CEF_PERMISSION_TYPE_CLIPBOARD = 1 << 5,
CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS = 1 << 6,
CEF_PERMISSION_TYPE_DISK_QUOTA = 1 << 7,
CEF_PERMISSION_TYPE_LOCAL_FONTS = 1 << 8,
CEF_PERMISSION_TYPE_GEOLOCATION = 1 << 9,
CEF_PERMISSION_TYPE_IDLE_DETECTION = 1 << 10,
CEF_PERMISSION_TYPE_MIC_STREAM = 1 << 11,
CEF_PERMISSION_TYPE_MIDI = 1 << 12,
CEF_PERMISSION_TYPE_MIDI_SYSEX = 1 << 13,
CEF_PERMISSION_TYPE_MULTIPLE_DOWNLOADS = 1 << 14,
CEF_PERMISSION_TYPE_NOTIFICATIONS = 1 << 15,
CEF_PERMISSION_TYPE_PROTECTED_MEDIA_IDENTIFIER = 1 << 16,
CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER = 1 << 17,
CEF_PERMISSION_TYPE_STORAGE_ACCESS = 1 << 18,
CEF_PERMISSION_TYPE_VR_SESSION = 1 << 19,
CEF_PERMISSION_TYPE_WINDOW_MANAGEMENT = 1 << 20,
CEF_PERMISSION_TYPE_FILE_SYSTEM_ACCESS = 1 << 21,
} cef_permission_request_types_t;
///

View File

@ -362,32 +362,51 @@ typedef enum {
/// Stores per origin metadata for cookie controls.
CEF_CONTENT_SETTING_TYPE_COOKIE_CONTROLS_METADATA,
/// Content Setting for 3PC accesses granted via 3PC deprecation trial.
CEF_CONTENT_SETTING_TYPE_TPCD_SUPPORT,
/// Content setting used to indicate whether entering picture-in-picture
/// automatically should be enabled.
CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE,
/// Content Setting for temporary 3PC accesses granted by user behavior
/// heuristics.
CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS,
/// Content Setting for 3PC accesses granted by metadata delivered via the
/// component updater service. This type will only be used when
/// `net::features::kTpcdMetadataGrants` is enabled.
CEF_CONTENT_SETTING_TYPE_TPCD_METADATA_GRANTS,
/// Content Setting for 3PC accesses granted via 3PC deprecation trial.
CEF_CONTENT_SETTING_TYPE_TPCD_TRIAL,
/// Content Setting for 3PC accesses granted via top-level 3PC deprecation
/// trial. Similar to TPCD_TRIAL, but applicable at the page-level for the
/// lifetime of the page that served the token, rather than being specific to
/// a requesting-origin/top-level-site combination and persistent.
CEF_CONTENT_SETTING_TYPE_TOP_LEVEL_TPCD_TRIAL,
/// Content setting used to indicate whether entering picture-in-picture
/// automatically should be enabled.
CEF_CONTENT_SETTING_TYPE_AUTO_PICTURE_IN_PICTURE,
/// Whether user has opted into keeping file/directory permissions persistent
/// between visits for a given origin. When enabled, permission metadata
/// stored under |FILE_SYSTEM_ACCESS_CHOOSER_DATA| can auto-grant incoming
/// permission request.
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_EXTENDED_PERMISSION,
/// Content Setting for temporary 3PC accesses granted by user behavior
/// heuristics.
CEF_CONTENT_SETTING_TYPE_TPCD_HEURISTICS_GRANTS,
/// Whether the FSA Persistent Permissions restore prompt is eligible to be
/// shown to the user, for a given origin.
CEF_CONTENT_SETTING_TYPE_FILE_SYSTEM_ACCESS_RESTORE_PERMISSION,
/// Whether an application capturing another tab, may scroll and zoom
/// the captured tab.
CEF_CONTENT_SETTING_TYPE_CAPTURED_SURFACE_CONTROL,
/// Content setting for access to smart card readers.
/// The "guard" content setting stores whether to allow sites to access the
/// Smart Card API.
CEF_CONTENT_SETTING_TYPE_SMART_CARD_GUARD,
CEF_CONTENT_SETTING_TYPE_SMART_CARD_DATA,
/// Content settings for access to printers for the Web Printing API.
CEF_CONTENT_SETTING_TYPE_WEB_PRINTING,
CEF_CONTENT_SETTING_TYPE_NUM_TYPES,
} cef_content_setting_types_t;

View File

@ -113,12 +113,7 @@ AlloyBrowserContext::AlloyBrowserContext(
const CefRequestContextSettings& settings)
: CefBrowserContext(settings) {}
AlloyBrowserContext::~AlloyBrowserContext() {
if (resource_context_) {
content::BrowserThread::DeleteSoon(content::BrowserThread::IO, FROM_HERE,
resource_context_.release());
}
}
AlloyBrowserContext::~AlloyBrowserContext() = default;
bool AlloyBrowserContext::IsInitialized() const {
CEF_REQUIRE_UIT();
@ -311,13 +306,6 @@ bool AlloyBrowserContext::IsPrintPreviewSupported() const {
return !GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled);
}
content::ResourceContext* AlloyBrowserContext::GetResourceContext() {
if (!resource_context_) {
resource_context_ = std::make_unique<content::ResourceContext>();
}
return resource_context_.get();
}
content::ClientHintsControllerDelegate*
AlloyBrowserContext::GetClientHintsControllerDelegate() {
return nullptr;

View File

@ -59,7 +59,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
bool IsPrintPreviewSupported() const override;
// content::BrowserContext overrides.
content::ResourceContext* GetResourceContext() override;
content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate()
override;
base::FilePath GetPath() override;
@ -142,8 +141,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
std::unique_ptr<ProfileKey> key_;
std::unique_ptr<DownloadPrefs> download_prefs_;
std::unique_ptr<content::ResourceContext> resource_context_;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_

View File

@ -50,8 +50,8 @@
#include "ui/native_theme/native_theme.h"
#if BUILDFLAG(IS_LINUX)
#include "ui/ozone/buildflags.h"
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
#include "ui/base/ozone_buildflags.h"
#if defined(USE_AURA) && BUILDFLAG(IS_OZONE_X11)
#include "ui/events/devices/x11/touch_factory_x11.h"
#endif
#endif
@ -252,7 +252,7 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
#if BUILDFLAG(IS_LINUX)
#if defined(USE_AURA) && BUILDFLAG(OZONE_PLATFORM_X11)
#if defined(USE_AURA) && BUILDFLAG(IS_OZONE_X11)
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
#endif
#endif

View File

@ -70,6 +70,7 @@
#include "chrome/browser/profiles/renderer_updater.h"
#include "chrome/browser/profiles/renderer_updater_factory.h"
#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h"
#include "chrome/browser/spellchecker/spell_check_initialization_host_impl.h"
#include "chrome/browser/ui/chrome_select_file_policy.h"
#include "chrome/browser/ui/pdf/chrome_pdf_document_helper_client.h"
#include "chrome/common/chrome_content_client.h"
@ -541,7 +542,7 @@ bool AlloyContentBrowserClient::IsHandledURL(const GURL& url) {
return CefAppManager::Get()->HasCustomScheme(scheme);
}
void AlloyContentBrowserClient::SiteInstanceGotProcess(
void AlloyContentBrowserClient::SiteInstanceGotProcessAndSite(
content::SiteInstance* site_instance) {
if (!extensions::ExtensionsEnabled()) {
return;
@ -570,9 +571,10 @@ void AlloyContentBrowserClient::SiteInstanceGotProcess(
void AlloyContentBrowserClient::BindHostReceiverForRenderer(
content::RenderProcessHost* render_process_host,
mojo::GenericPendingReceiver receiver) {
if (auto host_receiver = receiver.As<spellcheck::mojom::SpellCheckHost>()) {
SpellCheckHostChromeImpl::Create(render_process_host->GetID(),
std::move(host_receiver));
if (auto host_receiver =
receiver.As<spellcheck::mojom::SpellCheckInitializationHost>()) {
SpellCheckInitializationHostImpl::Create(render_process_host->GetID(),
std::move(host_receiver));
return;
}
@ -1019,7 +1021,8 @@ AlloyContentBrowserClient::CreateURLLoaderThrottles(
content::BrowserContext* browser_context,
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id) {
int frame_tree_node_id,
absl::optional<int64_t> navigation_id) {
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> result;
// Used to substitute View ID for PDF contents when using the PDF plugin.
@ -1108,6 +1111,7 @@ std::unique_ptr<content::LoginDelegate>
AlloyContentBrowserClient::CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
content::BrowserContext* browser_context,
const content::GlobalRequestID& request_id,
bool is_request_for_main_frame,
const GURL& url,
@ -1138,7 +1142,7 @@ void AlloyContentBrowserClient::RegisterNonNetworkNavigationURLLoaderFactories(
void AlloyContentBrowserClient::RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const absl::optional<url::Origin>& request_initiator_origin,
const std::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) {
if (!extensions::ExtensionsEnabled()) {
return;
@ -1346,6 +1350,13 @@ void AlloyContentBrowserClient::RegisterBrowserInterfaceBindersForFrame(
map->Add<network_hints::mojom::NetworkHintsHandler>(
base::BindRepeating(&BindNetworkHintsHandler));
map->Add<spellcheck::mojom::SpellCheckHost>(base::BindRepeating(
[](content::RenderFrameHost* frame_host,
mojo::PendingReceiver<spellcheck::mojom::SpellCheckHost> receiver) {
SpellCheckHostChromeImpl::Create(frame_host->GetProcess()->GetID(),
std::move(receiver));
}));
if (!extensions::ExtensionsEnabled()) {
return;
}

View File

@ -64,7 +64,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::vector<std::string>* additional_allowed_schemes) override;
bool IsWebUIAllowedToMakeNetworkRequests(const url::Origin& origin) override;
bool IsHandledURL(const GURL& url) override;
void SiteInstanceGotProcess(content::SiteInstance* site_instance) override;
void SiteInstanceGotProcessAndSite(
content::SiteInstance* site_instance) override;
void BindHostReceiverForRenderer(
content::RenderProcessHost* render_process_host,
mojo::GenericPendingReceiver receiver) override;
@ -135,7 +136,8 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
content::BrowserContext* browser_context,
const base::RepeatingCallback<content::WebContents*()>& wc_getter,
content::NavigationUIData* navigation_ui_data,
int frame_tree_node_id) override;
int frame_tree_node_id,
absl::optional<int64_t> navigation_id) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>
CreateURLLoaderThrottlesForKeepAlive(
const network::ResourceRequest& request,
@ -162,6 +164,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
content::BrowserContext* browser_context,
const content::GlobalRequestID& request_id,
bool is_request_for_main_frame,
const GURL& url,
@ -174,7 +177,7 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
void RegisterNonNetworkSubresourceURLLoaderFactories(
int render_process_id,
int render_frame_id,
const absl::optional<url::Origin>& request_initiator_origin,
const std::optional<url::Origin>& request_initiator_origin,
NonNetworkURLLoaderFactoryMap* factories) override;
bool WillCreateURLLoaderFactory(
content::BrowserContext* browser_context,

View File

@ -69,10 +69,10 @@ content::WebContents* CefBrowserPlatformDelegateAlloy::CreateWebContents(
// Extension resources will fail to load if we don't use a SiteInstance
// associated with the extension.
// (AlloyContentBrowserClient::SiteInstanceGotProcess won't find the
// extension to register with InfoMap, and AllowExtensionResourceLoad in
// ExtensionProtocolHandler::MaybeCreateJob will return false resulting in
// ERR_BLOCKED_BY_CLIENT).
// (AlloyContentBrowserClient::SiteInstanceGotProcessAndSite won't find
// the extension to register with InfoMap, and AllowExtensionResourceLoad
// in ExtensionProtocolHandler::MaybeCreateJob will return false resulting
// in ERR_BLOCKED_BY_CLIENT).
site_instance = extensions::ProcessManager::Get(browser_context)
->GetSiteInstanceForURL(gurl);
DCHECK(site_instance);

View File

@ -19,6 +19,7 @@
#include "base/command_line.h"
#include "base/path_service.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/permissions/chrome_permissions_client.h"
@ -31,6 +32,7 @@
#include "components/component_updater/component_updater_service.h"
#include "components/component_updater/timer_update_scheduler.h"
#include "components/net_log/chrome_net_log.h"
#include "components/os_crypt/async/browser/os_crypt_async.h"
#include "components/prefs/pref_service.h"
#include "content/browser/startup_helper.h"
#include "content/public/browser/network_service_instance.h"
@ -39,6 +41,10 @@
#include "services/network/public/cpp/network_switches.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#if BUILDFLAG(IS_WIN)
#include "components/os_crypt/async/browser/dpapi_key_provider.h"
#endif
ChromeBrowserProcessAlloy::ChromeBrowserProcessAlloy() : locale_("en-US") {}
ChromeBrowserProcessAlloy::~ChromeBrowserProcessAlloy() {
@ -81,6 +87,30 @@ void ChromeBrowserProcessAlloy::OnContextInitialized() {
DCHECK(!context_initialized_);
DCHECK(!shutdown_);
// OSCryptAsync provider configuration. If empty, this delegates all
// encryption operations to OSCrypt.
std::vector<std::pair<size_t, std::unique_ptr<os_crypt_async::KeyProvider>>>
providers;
#if BUILDFLAG(IS_WIN)
// TODO(crbug.com/1373092): For Windows, continue to add providers behind
// features, as support for them is added.
if (base::FeatureList::IsEnabled(features::kEnableDPAPIEncryptionProvider)) {
// The DPAPI key provider requires OSCrypt::Init to have already been called
// to initialize the key storage. This happens in
// AlloyBrowserMainParts::PreCreateMainMessageLoop.
providers.emplace_back(std::make_pair(
/*precedence=*/10u,
std::make_unique<os_crypt_async::DPAPIKeyProvider>(local_state())));
}
#endif // BUILDFLAG(IS_WIN)
os_crypt_async_ =
std::make_unique<os_crypt_async::OSCryptAsync>(std::move(providers));
// Trigger async initialization of OSCrypt key providers.
std::ignore = os_crypt_async_->GetInstance(base::DoNothing());
// Must be created after the NotificationService.
print_job_manager_ = std::make_unique<printing::PrintJobManager>();
profile_manager_ = std::make_unique<ChromeProfileManagerAlloy>();
@ -270,9 +300,9 @@ printing::PrintJobManager* ChromeBrowserProcessAlloy::print_job_manager() {
printing::PrintPreviewDialogController*
ChromeBrowserProcessAlloy::print_preview_dialog_controller() {
if (!print_preview_dialog_controller_.get()) {
if (!print_preview_dialog_controller_) {
print_preview_dialog_controller_ =
new printing::PrintPreviewDialogController();
std::make_unique<printing::PrintPreviewDialogController>();
}
return print_preview_dialog_controller_.get();
}
@ -405,8 +435,8 @@ ChromeBrowserProcessAlloy::resource_coordinator_parts() {
}
os_crypt_async::OSCryptAsync* ChromeBrowserProcessAlloy::os_crypt_async() {
DCHECK(false);
return nullptr;
DCHECK(os_crypt_async_);
return os_crypt_async_.get();
}
BuildState* ChromeBrowserProcessAlloy::GetBuildState() {

View File

@ -125,7 +125,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
std::unique_ptr<printing::PrintJobManager> print_job_manager_;
std::unique_ptr<ChromeProfileManagerAlloy> profile_manager_;
scoped_refptr<extensions::EventRouterForwarder> event_router_forwarder_;
scoped_refptr<printing::PrintPreviewDialogController>
std::unique_ptr<printing::PrintPreviewDialogController>
print_preview_dialog_controller_;
std::unique_ptr<printing::BackgroundPrintingManager>
background_printing_manager_;
@ -137,6 +137,8 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
std::unique_ptr<base::FieldTrialList> field_trial_list_;
std::unique_ptr<component_updater::ComponentUpdateService> component_updater_;
std::unique_ptr<os_crypt_async::OSCryptAsync> os_crypt_async_;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_CHROME_BROWSER_PROCESS_ALLOY_H_

View File

@ -114,7 +114,9 @@ content::WebContents* CefBrowserContentsDelegate::OpenURLFromTab(
if (auto c = client()) {
if (auto handler = c->GetRequestHandler()) {
// May return nullptr for omnibox navigations.
auto frame = browser()->GetFrame(params.frame_tree_node_id);
auto frame = browser_info_->browser()->GetFrameForHost(
content::RenderFrameHost::FromID(params.source_render_process_id,
params.source_render_frame_id));
if (!frame) {
frame = browser()->GetMainFrame();
}
@ -324,11 +326,9 @@ void CefBrowserContentsDelegate::RenderFrameHostStateChanged(
void CefBrowserContentsDelegate::RenderFrameDeleted(
content::RenderFrameHost* render_frame_host) {
const auto frame_id =
frame_util::MakeFrameId(render_frame_host->GetGlobalId());
browser_info_->RemoveFrame(render_frame_host);
if (focused_frame_ && focused_frame_->GetIdentifier() == frame_id) {
if (focused_frame_ && focused_frame_->IsSameFrame(render_frame_host)) {
focused_frame_ = nullptr;
OnStateChanged(State::kFocusedFrame);
}

View File

@ -148,6 +148,39 @@ CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::GetBrowserForGlobalId(
}
}
// static
CefRefPtr<CefBrowserHostBase> CefBrowserHostBase::GetBrowserForGlobalToken(
const content::GlobalRenderFrameHostToken& global_token) {
if (!frame_util::IsValidGlobalToken(global_token)) {
return nullptr;
}
if (CEF_CURRENTLY_ON_UIT()) {
// Use the non-thread-safe but potentially faster approach.
content::RenderFrameHost* render_frame_host =
content::RenderFrameHost::FromFrameToken(global_token);
if (!render_frame_host) {
return nullptr;
}
return GetBrowserForHost(render_frame_host);
} else {
// Use the thread-safe approach.
bool is_guest_view = false;
auto info = CefBrowserInfoManager::GetInstance()->GetBrowserInfo(
global_token, &is_guest_view);
if (info && !is_guest_view) {
auto browser = info->browser();
if (!browser) {
LOG(WARNING) << "Found browser id " << info->browser_id()
<< " but no browser object matching frame "
<< frame_util::GetFrameDebugString(global_token);
}
return browser;
}
return nullptr;
}
}
// static
CefRefPtr<CefBrowserHostBase>
CefBrowserHostBase::GetBrowserForTopLevelNativeWindow(
@ -905,32 +938,32 @@ bool CefBrowserHostBase::IsPopup() {
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetMainFrame() {
return GetFrame(CefFrameHostImpl::kMainFrameId);
return browser_info_->GetMainFrame();
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFocusedFrame() {
return GetFrame(CefFrameHostImpl::kFocusedFrameId);
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(int64_t identifier) {
if (identifier == CefFrameHostImpl::kInvalidFrameId) {
return nullptr;
} else if (identifier == CefFrameHostImpl::kMainFrameId) {
return browser_info_->GetMainFrame();
} else if (identifier == CefFrameHostImpl::kFocusedFrameId) {
{
base::AutoLock lock_scope(state_lock_);
if (!focused_frame_) {
// The main frame is focused by default.
return browser_info_->GetMainFrame();
if (focused_frame_) {
return focused_frame_;
}
return focused_frame_;
}
return browser_info_->GetFrameForGlobalId(
frame_util::MakeGlobalId(identifier));
// The main frame is focused by default.
return browser_info_->GetMainFrame();
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrame(const CefString& name) {
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameByIdentifier(
const CefString& identifier) {
const auto& global_token = frame_util::ParseFrameIdentifier(identifier);
if (!global_token) {
return nullptr;
}
return browser_info_->GetFrameForGlobalToken(*global_token);
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameByName(const CefString& name) {
for (const auto& frame : browser_info_->GetAllFrames()) {
if (frame->GetName() == name) {
return frame;
@ -944,7 +977,7 @@ size_t CefBrowserHostBase::GetFrameCount() {
}
void CefBrowserHostBase::GetFrameIdentifiers(
std::vector<int64_t>& identifiers) {
std::vector<CefString>& identifiers) {
if (identifiers.size() > 0) {
identifiers.clear();
}
@ -1018,6 +1051,11 @@ CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameForGlobalId(
return browser_info_->GetFrameForGlobalId(global_id, nullptr);
}
CefRefPtr<CefFrame> CefBrowserHostBase::GetFrameForGlobalToken(
const content::GlobalRenderFrameHostToken& global_token) {
return browser_info_->GetFrameForGlobalToken(global_token, nullptr);
}
void CefBrowserHostBase::AddObserver(Observer* observer) {
CEF_REQUIRE_UIT();
observers_.AddObserver(observer);

View File

@ -147,6 +147,9 @@ class CefBrowserHostBase : public CefBrowserHost,
// Returns the browser associated with the specified global ID.
static CefRefPtr<CefBrowserHostBase> GetBrowserForGlobalId(
const content::GlobalRenderFrameHostId& global_id);
// Returns the browser associated with the specified global token.
static CefRefPtr<CefBrowserHostBase> GetBrowserForGlobalToken(
const content::GlobalRenderFrameHostToken& global_token);
// Returns the browser associated with the specified top-level window.
static CefRefPtr<CefBrowserHostBase> GetBrowserForTopLevelNativeWindow(
gfx::NativeWindow owning_window);
@ -253,10 +256,11 @@ class CefBrowserHostBase : public CefBrowserHost,
bool IsPopup() override;
CefRefPtr<CefFrame> GetMainFrame() override;
CefRefPtr<CefFrame> GetFocusedFrame() override;
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
CefRefPtr<CefFrame> GetFrameByIdentifier(
const CefString& identifier) override;
CefRefPtr<CefFrame> GetFrameByName(const CefString& name) override;
size_t GetFrameCount() override;
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
void GetFrameIdentifiers(std::vector<CefString>& identifiers) override;
void GetFrameNames(std::vector<CefString>& names) override;
// CefBrowserContentsDelegate::Observer methods:
@ -266,11 +270,13 @@ class CefBrowserHostBase : public CefBrowserHost,
// Returns the frame associated with the specified RenderFrameHost.
CefRefPtr<CefFrame> GetFrameForHost(const content::RenderFrameHost* host);
// Returns the frame associated with the specified global ID. See
// documentation on RenderFrameHost::GetFrameTreeNodeId() for why the global
// ID is preferred.
// Returns the frame associated with the specified global ID/token. See
// documentation on RenderFrameHost::GetFrameTreeNodeId/Token() for why the
// global ID/token is preferred.
CefRefPtr<CefFrame> GetFrameForGlobalId(
const content::GlobalRenderFrameHostId& global_id);
CefRefPtr<CefFrame> GetFrameForGlobalToken(
const content::GlobalRenderFrameHostToken& global_token);
// Manage observer objects. The observer must either outlive this object or
// be removed before destruction. Must be called on the UI thread.

View File

@ -21,7 +21,7 @@ CefBrowserInfo::FrameInfo::~FrameInfo() {
#if DCHECK_IS_ON()
if (frame_ && !IsCurrentMainFrame()) {
// Should already be Detached.
DCHECK(!frame_->GetRenderFrameHost());
DCHECK(frame_->IsDetached());
}
#endif
}
@ -154,8 +154,7 @@ void CefBrowserInfo::MaybeCreateFrame(content::RenderFrameHost* host,
#if DCHECK_IS_ON()
// Check that the frame info hasn't changed unexpectedly.
DCHECK_EQ(frame_util::MakeFrameId(global_id),
frame_info->frame_->GetIdentifier());
DCHECK(host->GetGlobalFrameToken() == *frame_info->frame_->frame_token());
DCHECK_EQ(frame_info->is_main_frame_, frame_info->frame_->IsMain());
#endif
}
@ -165,6 +164,8 @@ void CefBrowserInfo::MaybeCreateFrame(content::RenderFrameHost* host,
// Populate the lookup maps.
frame_id_map_.insert(std::make_pair(global_id, frame_info));
frame_token_to_id_map_.insert(
std::make_pair(host->GetGlobalFrameToken(), global_id));
// And finally set the ownership.
frame_info_set_.insert(base::WrapUnique(frame_info));
@ -232,6 +233,12 @@ void CefBrowserInfo::RemoveFrame(content::RenderFrameHost* host) {
// Remove from the lookup maps.
frame_id_map_.erase(it);
{
auto it2 = frame_token_to_id_map_.find(host->GetGlobalFrameToken());
DCHECK(it2 != frame_token_to_id_map_.end());
frame_token_to_id_map_.erase(it2);
}
// And finally delete the frame info.
{
auto it2 = frame_info_set_.find(frame_info);
@ -267,7 +274,7 @@ CefRefPtr<CefFrameHostImpl> CefBrowserInfo::CreateTempSubFrame(
parent = GetMainFrame();
}
// Intentionally not notifying for temporary frames.
return new CefFrameHostImpl(this, parent->GetIdentifier());
return new CefFrameHostImpl(this, parent->frame_token());
}
CefRefPtr<CefFrameHostImpl> CefBrowserInfo::GetFrameForHost(
@ -329,6 +336,28 @@ CefRefPtr<CefFrameHostImpl> CefBrowserInfo::GetFrameForGlobalId(
return nullptr;
}
CefRefPtr<CefFrameHostImpl> CefBrowserInfo::GetFrameForGlobalToken(
const content::GlobalRenderFrameHostToken& global_token,
bool* is_guest_view,
bool prefer_speculative) const {
if (!frame_util::IsValidGlobalToken(global_token)) {
return nullptr;
}
content::GlobalRenderFrameHostId global_id;
{
base::AutoLock lock_scope(lock_);
const auto it = frame_token_to_id_map_.find(global_token);
if (it == frame_token_to_id_map_.end()) {
return nullptr;
}
global_id = it->second;
}
return GetFrameForGlobalId(global_id, is_guest_view, prefer_speculative);
}
CefBrowserInfo::FrameHostList CefBrowserInfo::GetAllFrames() const {
base::AutoLock lock_scope(lock_);
FrameHostList frames;
@ -510,6 +539,7 @@ void CefBrowserInfo::RemoveAllFrames(
// Clear the lookup maps.
frame_id_map_.clear();
frame_token_to_id_map_.clear();
// Explicitly Detach everything but the current main frame.
for (auto& info : frame_info_set_) {

View File

@ -109,15 +109,19 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
bool* is_guest_view = nullptr,
bool prefer_speculative = false) const;
// Returns the frame object matching the specified ID or nullptr if no match
// is found. Nullptr will also be returned if a guest view match is found
// because we don't create frame objects for guest views. If |is_guest_view|
// is non-nullptr it will be set to true in this case. Safe to call from any
// thread.
// Returns the frame object matching the specified ID/token or nullptr if no
// match is found. Nullptr will also be returned if a guest view match is
// found because we don't create frame objects for guest views. If
// |is_guest_view| is non-nullptr it will be set to true in this case. Safe to
// call from any thread.
CefRefPtr<CefFrameHostImpl> GetFrameForGlobalId(
const content::GlobalRenderFrameHostId& global_id,
bool* is_guest_view = nullptr,
bool prefer_speculative = false) const;
CefRefPtr<CefFrameHostImpl> GetFrameForGlobalToken(
const content::GlobalRenderFrameHostToken& global_token,
bool* is_guest_view = nullptr,
bool prefer_speculative = false) const;
// Returns all non-speculative frame objects that currently exist. Guest views
// will be excluded because they don't have a frame object. Safe to call from
@ -248,6 +252,11 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
content::GlobalRenderFrameHostIdHasher>;
FrameIDMap frame_id_map_;
// Map of global token to global ID.
using FrameTokenToIdMap = std::map<content::GlobalRenderFrameHostToken,
content::GlobalRenderFrameHostId>;
FrameTokenToIdMap frame_token_to_id_map_;
// The current main frame.
CefRefPtr<CefFrameHostImpl> main_frame_;

View File

@ -89,7 +89,8 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::CreatePopupBrowserInfo(
browser_info_list_.push_back(browser_info);
// Continue any pending NewBrowserInfo request.
auto it = pending_new_browser_info_map_.find(frame_host->GetGlobalId());
auto it =
pending_new_browser_info_map_.find(frame_host->GetGlobalFrameToken());
if (it != pending_new_browser_info_map_.end()) {
SendNewBrowserInfoResponse(browser_info, /*is_guest_view=*/false,
std::move(it->second->callback),
@ -289,9 +290,9 @@ bool CefBrowserInfoManager::AddWebContents(content::WebContents* new_contents) {
}
void CefBrowserInfoManager::OnGetNewBrowserInfo(
const content::GlobalRenderFrameHostId& global_id,
const content::GlobalRenderFrameHostToken& global_token,
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) {
DCHECK(frame_util::IsValidGlobalId(global_id));
DCHECK(frame_util::IsValidGlobalToken(global_token));
DCHECK(callback);
auto callback_runner = base::SequencedTaskRunner::GetCurrentDefault();
@ -301,7 +302,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
bool is_guest_view = false;
scoped_refptr<CefBrowserInfo> browser_info =
GetBrowserInfoInternal(global_id, &is_guest_view);
GetBrowserInfoInternal(global_token, &is_guest_view);
if (browser_info) {
// Send the response immediately.
@ -311,19 +312,19 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
}
// Verify that no request for the same route is currently queued.
DCHECK(pending_new_browser_info_map_.find(global_id) ==
DCHECK(pending_new_browser_info_map_.find(global_token) ==
pending_new_browser_info_map_.end());
const int timeout_id = ++next_timeout_id_;
// Queue the request.
std::unique_ptr<PendingNewBrowserInfo> pending(new PendingNewBrowserInfo());
pending->global_id = global_id;
pending->global_token = global_token;
pending->timeout_id = timeout_id;
pending->callback = std::move(callback);
pending->callback_runner = callback_runner;
pending_new_browser_info_map_.insert(
std::make_pair(global_id, std::move(pending)));
std::make_pair(global_token, std::move(pending)));
// Register a timeout for the pending response so that the renderer process
// doesn't hang forever. With the Chrome runtime, timeouts may occur in cases
@ -334,7 +335,7 @@ void CefBrowserInfoManager::OnGetNewBrowserInfo(
CEF_POST_DELAYED_TASK(
CEF_UIT,
base::BindOnce(&CefBrowserInfoManager::TimeoutNewBrowserInfoResponse,
global_id, timeout_id),
global_token, timeout_id),
kNewBrowserInfoResponseTimeoutMs);
}
}
@ -391,6 +392,13 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfo(
return GetBrowserInfoInternal(global_id, is_guest_view);
}
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfo(
const content::GlobalRenderFrameHostToken& global_token,
bool* is_guest_view) {
base::AutoLock lock_scope(browser_info_lock_);
return GetBrowserInfoInternal(global_token, is_guest_view);
}
bool CefBrowserInfoManager::MaybeAllowNavigation(
content::RenderFrameHost* opener,
const content::OpenURLParams& params,
@ -451,7 +459,7 @@ void CefBrowserInfoManager::RenderProcessHostDestroyed(
pending_new_browser_info_map_.begin();
while (it != pending_new_browser_info_map_.end()) {
const auto& info = it->second;
if (info->global_id.child_id == render_process_id) {
if (info->global_token.child_id == render_process_id) {
CancelNewBrowserInfoResponse(info.get());
it = pending_new_browser_info_map_.erase(it);
} else {
@ -553,6 +561,34 @@ scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfoInternal(
return nullptr;
}
scoped_refptr<CefBrowserInfo> CefBrowserInfoManager::GetBrowserInfoInternal(
const content::GlobalRenderFrameHostToken& global_token,
bool* is_guest_view) {
browser_info_lock_.AssertAcquired();
if (is_guest_view) {
*is_guest_view = false;
}
if (!frame_util::IsValidGlobalToken(global_token)) {
return nullptr;
}
for (const auto& browser_info : browser_info_list_) {
bool is_guest_view_tmp;
auto frame =
browser_info->GetFrameForGlobalToken(global_token, &is_guest_view_tmp);
if (frame || is_guest_view_tmp) {
if (is_guest_view) {
*is_guest_view = is_guest_view_tmp;
}
return browser_info;
}
}
return nullptr;
}
// static
void CefBrowserInfoManager::SendNewBrowserInfoResponse(
scoped_refptr<CefBrowserInfo> browser_info,
@ -601,7 +637,7 @@ void CefBrowserInfoManager::CancelNewBrowserInfoResponse(
// static
void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse(
const content::GlobalRenderFrameHostId& global_id,
const content::GlobalRenderFrameHostToken& global_token,
int timeout_id) {
CEF_REQUIRE_UIT();
if (!g_info_manager) {
@ -611,7 +647,7 @@ void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse(
base::AutoLock lock_scope(g_info_manager->browser_info_lock_);
// Continue the NewBrowserInfo request if it's still pending.
auto it = g_info_manager->pending_new_browser_info_map_.find(global_id);
auto it = g_info_manager->pending_new_browser_info_map_.find(global_token);
if (it != g_info_manager->pending_new_browser_info_map_.end()) {
const auto& pending_info = it->second;
// Don't accidentally timeout a new request for the same frame.
@ -622,12 +658,12 @@ void CefBrowserInfoManager::TimeoutNewBrowserInfoResponse(
#if DCHECK_IS_ON()
// This method should never be called for a PDF renderer.
content::RenderProcessHost* process =
content::RenderProcessHost::FromID(global_id.child_id);
content::RenderProcessHost::FromID(global_token.child_id);
DCHECK(!process || !process->IsPdf());
#endif
LOG(ERROR) << "Timeout of new browser info response for frame "
<< frame_util::GetFrameDebugString(global_id);
<< frame_util::GetFrameDebugString(global_token);
CancelNewBrowserInfoResponse(pending_info.get());
g_info_manager->pending_new_browser_info_map_.erase(it);

View File

@ -112,7 +112,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// already exist for traditional popup browsers depending on timing. See
// comments on PendingPopup for more information.
void OnGetNewBrowserInfo(
const content::GlobalRenderFrameHostId& global_id,
const content::GlobalRenderFrameHostToken& global_token,
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback);
// Called from CefBrowserHostBase::DestroyBrowser() when a browser is
@ -122,15 +122,18 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// Called from CefContext::FinishShutdownOnUIThread() to destroy all browsers.
void DestroyAllBrowsers();
// Returns the CefBrowserInfo matching the specified ID or nullptr if no
// Returns the CefBrowserInfo matching the specified ID/token or nullptr if no
// match is found. It is allowed to add new callers of this method but
// consider using CefBrowserHostBase::GetBrowserForGlobalId() or
// consider using CefBrowserHostBase::GetBrowserForGlobalId/Token() or
// extensions::GetOwnerBrowserForGlobalId() instead. If |is_guest_view| is
// non-nullptr it will be set to true if the ID matches a guest view
// non-nullptr it will be set to true if the ID/token matches a guest view
// associated with the returned browser info instead of the browser itself.
scoped_refptr<CefBrowserInfo> GetBrowserInfo(
const content::GlobalRenderFrameHostId& global_id,
bool* is_guest_view = nullptr);
scoped_refptr<CefBrowserInfo> GetBrowserInfo(
const content::GlobalRenderFrameHostToken& global_token,
bool* is_guest_view = nullptr);
// Returns all existing CefBrowserInfo objects.
using BrowserInfoList = std::list<scoped_refptr<CefBrowserInfo>>;
@ -213,10 +216,13 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
PendingPopup::Step previous_step,
content::WebContents* new_contents);
// Retrieves the BrowserInfo matching the specified ID.
// Retrieves the BrowserInfo matching the specified ID/token.
scoped_refptr<CefBrowserInfo> GetBrowserInfoInternal(
const content::GlobalRenderFrameHostId& global_id,
bool* is_guest_view);
scoped_refptr<CefBrowserInfo> GetBrowserInfoInternal(
const content::GlobalRenderFrameHostToken& global_token,
bool* is_guest_view);
// Send the response for a pending OnGetNewBrowserInfo request.
static void SendNewBrowserInfoResponse(
@ -227,7 +233,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// Pending request for OnGetNewBrowserInfo.
struct PendingNewBrowserInfo {
content::GlobalRenderFrameHostId global_id;
content::GlobalRenderFrameHostToken global_token;
int timeout_id;
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback;
scoped_refptr<base::SequencedTaskRunner> callback_runner;
@ -238,7 +244,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// Time out a response if it's still pending.
static void TimeoutNewBrowserInfoResponse(
const content::GlobalRenderFrameHostId& global_id,
const content::GlobalRenderFrameHostToken& global_token,
int timeout_id);
mutable base::Lock browser_info_lock_;
@ -252,7 +258,7 @@ class CefBrowserInfoManager : public content::RenderProcessHostObserver {
// identify a RFH for its complete lifespan. See documentation on
// RenderFrameHost::GetFrameTreeNodeId() for background.
using PendingNewBrowserInfoMap =
std::map<content::GlobalRenderFrameHostId,
std::map<content::GlobalRenderFrameHostToken,
std::unique_ptr<PendingNewBrowserInfo>>;
PendingNewBrowserInfoMap pending_new_browser_info_map_;

View File

@ -50,9 +50,10 @@ void CefBrowserManager::GetNewRenderThreadInfo(
}
void CefBrowserManager::GetNewBrowserInfo(
int32_t render_frame_routing_id,
const blink::LocalFrameToken& render_frame_token,
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) {
CefBrowserInfoManager::GetInstance()->OnGetNewBrowserInfo(
frame_util::MakeGlobalId(render_process_id_, render_frame_routing_id),
content::GlobalRenderFrameHostToken(render_process_id_,
render_frame_token),
std::move(callback));
}

View File

@ -46,7 +46,7 @@ class CefBrowserManager : public cef::mojom::BrowserManager {
cef::mojom::BrowserManager::GetNewRenderThreadInfoCallback callback)
override;
void GetNewBrowserInfo(
int32_t render_frame_routing_id,
const blink::LocalFrameToken& render_frame_token,
cef::mojom::BrowserManager::GetNewBrowserInfoCallback callback) override;
// The process ID of the renderer.

View File

@ -54,7 +54,7 @@ void HandleExternalProtocolHelper(
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
const network::ResourceRequest& resource_request,
const absl::optional<url::Origin>& initiating_origin,
const std::optional<url::Origin>& initiating_origin,
content::WeakDocumentPtr initiator_document) {
// May return nullptr if frame has been deleted or a cross-document navigation
// has committed in the same RenderFrameHost.
@ -232,7 +232,7 @@ bool ChromeContentBrowserClientCef::WillCreateURLLoaderFactory(
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
absl::optional<int64_t> navigation_id,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
@ -325,7 +325,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol(
network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
const absl::optional<url::Origin>& initiating_origin,
const std::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
// |out_factory| will be non-nullptr when this method is initially called
@ -353,7 +353,7 @@ bool ChromeContentBrowserClientCef::HandleExternalProtocol(
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
const network::ResourceRequest& resource_request,
const absl::optional<url::Origin>& initiating_origin,
const std::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) {
mojo::PendingReceiver<network::mojom::URLLoaderFactory> receiver =
@ -418,6 +418,7 @@ std::unique_ptr<content::LoginDelegate>
ChromeContentBrowserClientCef::CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
content::BrowserContext* browser_context,
const content::GlobalRequestID& request_id,
bool is_request_for_main_frame,
const GURL& url,
@ -434,8 +435,9 @@ ChromeContentBrowserClientCef::CreateLoginDelegate(
}
return ChromeContentBrowserClient::CreateLoginDelegate(
auth_info, web_contents, request_id, is_request_for_main_frame, url,
response_headers, first_auth_attempt, std::move(auth_required_callback));
auth_info, web_contents, browser_context, request_id,
is_request_for_main_frame, url, response_headers, first_auth_attempt,
std::move(auth_required_callback));
}
void ChromeContentBrowserClientCef::BrowserURLHandlerCreated(

View File

@ -61,7 +61,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
int render_process_id,
URLLoaderFactoryType type,
const url::Origin& request_initiator,
absl::optional<int64_t> navigation_id,
std::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory>* factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient>*
@ -81,7 +81,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
network::mojom::WebSandboxFlags sandbox_flags,
ui::PageTransition page_transition,
bool has_user_gesture,
const absl::optional<url::Origin>& initiating_origin,
const std::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
@ -93,7 +93,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
bool is_in_fenced_frame_tree,
network::mojom::WebSandboxFlags sandbox_flags,
const network::ResourceRequest& request,
const absl::optional<url::Origin>& initiating_origin,
const std::optional<url::Origin>& initiating_origin,
content::RenderFrameHost* initiator_document,
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory)
override;
@ -110,6 +110,7 @@ class ChromeContentBrowserClientCef : public ChromeContentBrowserClient {
std::unique_ptr<content::LoginDelegate> CreateLoginDelegate(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
content::BrowserContext* browser_context,
const content::GlobalRequestID& request_id,
bool is_request_for_main_frame,
const GURL& url,

View File

@ -41,13 +41,21 @@ CefRefPtr<CefDownloadHandler> GetDownloadHandler(
return nullptr;
}
void RunDownloadTargetCallback(download::DownloadTargetCallback callback,
const base::FilePath& path) {
download::DownloadTargetInfo target_info;
target_info.target_path = path;
target_info.intermediate_path = path;
std::move(callback).Run(std::move(target_info));
}
// CefBeforeDownloadCallback implementation.
class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
public:
CefBeforeDownloadCallbackImpl(const base::WeakPtr<DownloadManager>& manager,
uint32_t download_id,
const base::FilePath& suggested_name,
content::DownloadTargetCallback callback)
download::DownloadTargetCallback callback)
: manager_(manager),
download_id_(download_id),
suggested_name_(suggested_name),
@ -85,7 +93,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
const base::FilePath& suggested_name,
const base::FilePath& download_path,
bool show_dialog,
content::DownloadTargetCallback callback) {
download::DownloadTargetCallback callback) {
CEF_REQUIRE_BLOCKING();
base::FilePath suggested_path = download_path;
@ -120,7 +128,7 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
uint32_t download_id,
const base::FilePath& suggested_path,
bool show_dialog,
content::DownloadTargetCallback callback) {
download::DownloadTargetCallback callback) {
if (!manager) {
return;
}
@ -159,17 +167,12 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
}
if (!handled) {
std::move(callback).Run(
suggested_path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::InsecureDownloadStatus::UNKNOWN,
suggested_path, base::FilePath(), std::string() /*mime_type*/,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
RunDownloadTargetCallback(std::move(callback), suggested_path);
}
}
static void ChooseDownloadPathCallback(
content::DownloadTargetCallback callback,
download::DownloadTargetCallback callback,
const std::vector<base::FilePath>& file_paths) {
DCHECK_LE(file_paths.size(), (size_t)1);
@ -179,18 +182,13 @@ class CefBeforeDownloadCallbackImpl : public CefBeforeDownloadCallback {
}
// The download will be cancelled if |path| is empty.
std::move(callback).Run(
path, DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::InsecureDownloadStatus::UNKNOWN, path,
base::FilePath(), std::string() /*mime_type*/,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
RunDownloadTargetCallback(std::move(callback), path);
}
base::WeakPtr<DownloadManager> manager_;
uint32_t download_id_;
base::FilePath suggested_name_;
content::DownloadTargetCallback callback_;
download::DownloadTargetCallback callback_;
IMPLEMENT_REFCOUNTING(CefBeforeDownloadCallbackImpl);
};
@ -375,14 +373,10 @@ void CefDownloadManagerDelegate::ManagerGoingDown(DownloadManager* manager) {
bool CefDownloadManagerDelegate::DetermineDownloadTarget(
DownloadItem* item,
content::DownloadTargetCallback* callback) {
if (!item->GetForcedFilePath().empty()) {
std::move(*callback).Run(
item->GetForcedFilePath(), DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::InsecureDownloadStatus::UNKNOWN,
item->GetForcedFilePath(), base::FilePath(),
std::string() /*mime_type*/, download::DOWNLOAD_INTERRUPT_REASON_NONE);
download::DownloadTargetCallback* callback) {
const auto& forced_path = item->GetForcedFilePath();
if (!forced_path.empty()) {
RunDownloadTargetCallback(std::move(*callback), forced_path);
return true;
}

View File

@ -12,6 +12,7 @@
#include "base/memory/weak_ptr.h"
#include "components/download/public/common/download_item.h"
#include "components/download/public/common/download_target_info.h"
#include "content/public/browser/download_manager.h"
#include "content/public/browser/download_manager_delegate.h"
@ -43,7 +44,7 @@ class CefDownloadManagerDelegate : public download::DownloadItem::Observer,
// DownloadManagerDelegate methods.
bool DetermineDownloadTarget(
download::DownloadItem* item,
content::DownloadTargetCallback* callback) override;
download::DownloadTargetCallback* callback) override;
void GetNextId(content::DownloadIdCallback callback) override;
std::string ApplicationClientIdForFileScanning() override;

View File

@ -409,8 +409,7 @@ std::unique_ptr<api::tabs::Tab> CefExtensionFunctionDetails::OpenTab(
auto web_contents = new_browser->web_contents();
auto result = CreateTabObject(new_browser, opener_browser_id, active, index);
auto scrub_tab_behavior = ExtensionTabUtil::GetScrubTabBehavior(
extension, extensions::Feature::Context::UNSPECIFIED_CONTEXT,
web_contents);
extension, extensions::mojom::ContextType::kUnspecified, web_contents);
ExtensionTabUtil::ScrubTabForExtension(extension, web_contents, &result,
scrub_tab_behavior);
return base::WrapUnique(new api::tabs::Tab(std::move(result)));

View File

@ -246,6 +246,13 @@ ProcessManagerDelegate* CefExtensionsBrowserClient::GetProcessManagerDelegate()
return nullptr;
}
mojo::PendingRemote<network::mojom::URLLoaderFactory>
CefExtensionsBrowserClient::GetControlledFrameEmbedderURLLoader(
int frame_tree_node_id,
content::BrowserContext* browser_context) {
return mojo::PendingRemote<network::mojom::URLLoaderFactory>();
}
std::unique_ptr<ExtensionHostDelegate>
CefExtensionsBrowserClient::CreateExtensionHostDelegate() {
// CEF does not use the ExtensionHost constructor that calls this method.

View File

@ -83,6 +83,10 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
content::BrowserContext* context,
std::vector<EarlyExtensionPrefsObserver*>* observers) const override;
ProcessManagerDelegate* GetProcessManagerDelegate() const override;
mojo::PendingRemote<network::mojom::URLLoaderFactory>
GetControlledFrameEmbedderURLLoader(
int frame_tree_node_id,
content::BrowserContext* browser_context) override;
std::unique_ptr<ExtensionHostDelegate> CreateExtensionHostDelegate() override;
bool CreateBackgroundExtensionHost(const Extension* extension,
content::BrowserContext* browser_context,

View File

@ -17,6 +17,7 @@
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/render_frame_host.h"
#include "ui/shell_dialogs/select_file_policy.h"
#include "ui/shell_dialogs/selected_file_info.h"
using blink::mojom::FileChooserParams;
@ -224,25 +225,16 @@ class CefSelectFileDialogListener : public ui::SelectFileDialog::Listener {
private:
~CefSelectFileDialogListener() override = default;
void FileSelected(const base::FilePath& path,
void FileSelected(const ui::SelectedFileInfo& file,
int index,
void* params) override {
DCHECK_EQ(params, params_);
executing_ = true;
listener_->FileSelected(path, index, params);
listener_->FileSelected(file, index, params);
Destroy();
}
void FileSelectedWithExtraInfo(const ui::SelectedFileInfo& file,
int index,
void* params) override {
DCHECK_EQ(params, params_);
executing_ = true;
listener_->FileSelectedWithExtraInfo(file, index, params);
Destroy();
}
void MultiFilesSelected(const std::vector<base::FilePath>& files,
void MultiFilesSelected(const std::vector<ui::SelectedFileInfo>& files,
void* params) override {
DCHECK_EQ(params, params_);
executing_ = true;
@ -250,15 +242,6 @@ class CefSelectFileDialogListener : public ui::SelectFileDialog::Listener {
Destroy();
}
void MultiFilesSelectedWithExtraInfo(
const std::vector<ui::SelectedFileInfo>& files,
void* params) override {
DCHECK_EQ(params, params_);
executing_ = true;
listener_->MultiFilesSelectedWithExtraInfo(files, params);
Destroy();
}
void FileSelectionCanceled(void* params) override {
DCHECK_EQ(params, params_);
executing_ = true;
@ -535,9 +518,10 @@ void CefFileDialogManager::SelectFileDoneByDelegateCallback(
if (paths.empty()) {
listener->FileSelectionCanceled(params);
} else if (paths.size() == 1) {
listener->FileSelected(paths[0], /*index=*/0, params);
listener->FileSelected(ui::SelectedFileInfo(paths[0]), /*index=*/0, params);
} else {
listener->MultiFilesSelected(paths, params);
listener->MultiFilesSelected(ui::FilePathListToSelectedFileInfoList(paths),
params);
}
// |listener| is likely deleted at this point.
}

View File

@ -75,35 +75,31 @@ void ExecWebContentsCommand(CefFrameHostImpl* fh,
} // namespace
CefFrameHostImpl::CefFrameHostImpl(scoped_refptr<CefBrowserInfo> browser_info,
int64_t parent_frame_id)
CefFrameHostImpl::CefFrameHostImpl(
scoped_refptr<CefBrowserInfo> browser_info,
std::optional<content::GlobalRenderFrameHostToken> parent_frame_token)
: is_main_frame_(false),
frame_id_(kInvalidFrameId),
browser_info_(browser_info),
is_focused_(is_main_frame_), // The main frame always starts focused.
parent_frame_id_(parent_frame_id) {
parent_frame_token_(std::move(parent_frame_token)) {
#if DCHECK_IS_ON()
DCHECK(browser_info_);
if (is_main_frame_) {
DCHECK_EQ(parent_frame_id_, kInvalidFrameId);
} else {
DCHECK_GT(parent_frame_id_, 0);
}
DCHECK_EQ(is_main_frame_, !parent_frame_token_.has_value());
#endif
}
CefFrameHostImpl::CefFrameHostImpl(scoped_refptr<CefBrowserInfo> browser_info,
content::RenderFrameHost* render_frame_host)
: is_main_frame_(render_frame_host->GetParent() == nullptr),
frame_id_(frame_util::MakeFrameId(render_frame_host->GetGlobalId())),
frame_token_(render_frame_host->GetGlobalFrameToken()),
browser_info_(browser_info),
is_focused_(is_main_frame_), // The main frame always starts focused.
url_(render_frame_host->GetLastCommittedURL().spec()),
name_(render_frame_host->GetFrameName()),
parent_frame_id_(
is_main_frame_ ? kInvalidFrameId
: frame_util::MakeFrameId(
render_frame_host->GetParent()->GetGlobalId())),
parent_frame_token_(
is_main_frame_
? std::optional<content::GlobalRenderFrameHostToken>()
: render_frame_host->GetParent()->GetGlobalFrameToken()),
render_frame_host_(render_frame_host) {
DCHECK(browser_info_);
}
@ -193,25 +189,30 @@ CefString CefFrameHostImpl::GetName() {
return name_;
}
int64_t CefFrameHostImpl::GetIdentifier() {
base::AutoLock lock_scope(state_lock_);
return frame_id_;
CefString CefFrameHostImpl::GetIdentifier() {
if (!frame_token_) {
return CefString();
}
return frame_util::MakeFrameIdentifier(*frame_token_);
}
CefRefPtr<CefFrame> CefFrameHostImpl::GetParent() {
int64_t parent_frame_id;
if (is_main_frame_) {
return nullptr;
}
content::GlobalRenderFrameHostToken parent_frame_token;
{
base::AutoLock lock_scope(state_lock_);
if (is_main_frame_ || parent_frame_id_ == kInvalidFrameId) {
if (!parent_frame_token_) {
return nullptr;
}
parent_frame_id = parent_frame_id_;
parent_frame_token = *parent_frame_token_;
}
auto browser = GetBrowserHostBase();
if (browser) {
return browser->GetFrame(parent_frame_id);
if (auto browser = GetBrowserHostBase()) {
return browser->GetFrameForGlobalToken(parent_frame_token);
}
return nullptr;
@ -298,6 +299,7 @@ void CefFrameHostImpl::SendProcessMessage(
}
void CefFrameHostImpl::SetFocused(bool focused) {
CEF_REQUIRE_UIT();
base::AutoLock lock_scope(state_lock_);
is_focused_ = focused;
}
@ -324,8 +326,8 @@ void CefFrameHostImpl::RefreshAttributes() {
}
if (!is_main_frame_) {
parent_frame_id_ =
frame_util::MakeFrameId(render_frame_host_->GetParent()->GetGlobalId());
parent_frame_token_ =
render_frame_host_->GetParent()->GetGlobalFrameToken();
}
}
@ -359,16 +361,10 @@ void CefFrameHostImpl::LoadURLWithExtras(const std::string& url,
const content::Referrer& referrer,
ui::PageTransition transition,
const std::string& extra_headers) {
// Only known frame ids or kMainFrameId are supported.
const auto frame_id = GetFrameId();
if (frame_id < CefFrameHostImpl::kMainFrameId) {
return;
}
// Any necessary fixup will occur in LoadRequest.
GURL gurl = url_util::MakeGURL(url, /*fixup=*/false);
if (frame_id == CefFrameHostImpl::kMainFrameId) {
if (is_main_frame_) {
// Load via the browser using NavigationController.
auto browser = GetBrowserHostBase();
if (browser) {
@ -484,6 +480,22 @@ content::RenderFrameHost* CefFrameHostImpl::GetRenderFrameHost() const {
return render_frame_host_;
}
bool CefFrameHostImpl::IsSameFrame(content::RenderFrameHost* frame_host) const {
CEF_REQUIRE_UIT();
// Shortcut in case the RFH objects match.
if (render_frame_host_ == frame_host) {
return true;
}
// Frame tokens should match even if we're currently detached or the RFH
// object has changed.
return frame_token_ && *frame_token_ == frame_host->GetGlobalFrameToken();
}
bool CefFrameHostImpl::IsDetached() const {
return !GetRenderFrameHost();
}
bool CefFrameHostImpl::Detach(DetachReason reason) {
CEF_REQUIRE_UIT();
@ -549,9 +561,8 @@ void CefFrameHostImpl::MaybeReAttach(
CHECK(!render_frame_.is_bound());
CHECK(!render_frame_host_);
// The RFH may change but the GlobalId should remain the same.
CHECK_EQ(frame_id_,
frame_util::MakeFrameId(render_frame_host->GetGlobalId()));
// The RFH may change but the frame token should remain the same.
CHECK(*frame_token_ == render_frame_host->GetGlobalFrameToken());
{
base::AutoLock lock_scope(state_lock_);
@ -564,22 +575,11 @@ void CefFrameHostImpl::MaybeReAttach(
// We expect a reconnect to be triggered via FrameAttached().
}
// kMainFrameId must be -1 to align with renderer expectations.
const int64_t CefFrameHostImpl::kMainFrameId = -1;
const int64_t CefFrameHostImpl::kFocusedFrameId = -2;
const int64_t CefFrameHostImpl::kUnspecifiedFrameId = -3;
const int64_t CefFrameHostImpl::kInvalidFrameId = -4;
// This equates to (TT_EXPLICIT | TT_DIRECT_LOAD_FLAG).
const ui::PageTransition CefFrameHostImpl::kPageTransitionExplicit =
static_cast<ui::PageTransition>(ui::PAGE_TRANSITION_TYPED |
ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
int64_t CefFrameHostImpl::GetFrameId() const {
base::AutoLock lock_scope(state_lock_);
return is_main_frame_ ? kMainFrameId : frame_id_;
}
scoped_refptr<CefBrowserInfo> CefFrameHostImpl::GetBrowserInfo() const {
base::AutoLock lock_scope(state_lock_);
return browser_info_;
@ -711,12 +711,14 @@ void CefFrameHostImpl::UpdateDraggableRegions(
// Delegate to BrowserInfo so that current state is maintained with
// cross-origin navigation.
browser_info_->MaybeNotifyDraggableRegionsChanged(
browser->browser_info()->MaybeNotifyDraggableRegionsChanged(
browser, this, std::move(draggable_regions));
}
std::string CefFrameHostImpl::GetDebugString() const {
return "frame " + frame_util::GetFrameDebugString(frame_id_) +
return "frame " +
(frame_token_ ? frame_util::GetFrameDebugString(*frame_token_)
: "(null)") +
(is_main_frame_ ? " (main)" : " (sub)");
}

View File

@ -7,6 +7,7 @@
#pragma once
#include <memory>
#include <optional>
#include <queue>
#include <string>
@ -14,6 +15,7 @@
#include "base/synchronization/lock.h"
#include "cef/libcef/common/mojom/cef.mojom.h"
#include "content/public/browser/global_routing_id.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "ui/base/page_transition_types.h"
@ -33,8 +35,9 @@ class CefBrowserHostBase;
class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
public:
// Create a temporary sub-frame.
CefFrameHostImpl(scoped_refptr<CefBrowserInfo> browser_info,
int64_t parent_frame_id);
CefFrameHostImpl(
scoped_refptr<CefBrowserInfo> browser_info,
std::optional<content::GlobalRenderFrameHostToken> parent_frame_token);
// Create a frame backed by a RFH and owned by CefBrowserInfo.
CefFrameHostImpl(scoped_refptr<CefBrowserInfo> browser_info,
@ -65,7 +68,7 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
bool IsMain() override;
bool IsFocused() override;
CefString GetName() override;
int64_t GetIdentifier() override;
CefString GetIdentifier() override;
CefRefPtr<CefFrame> GetParent() override;
CefString GetURL() override;
CefRefPtr<CefBrowser> GetBrowser() override;
@ -77,8 +80,6 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
void SendProcessMessage(CefProcessId target_process,
CefRefPtr<CefProcessMessage> message) override;
bool is_temporary() const { return frame_id_ == kInvalidFrameId; }
void SetFocused(bool focused);
void RefreshAttributes();
@ -112,10 +113,21 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
void ExecuteJavaScriptWithUserGestureForTests(const CefString& javascript);
// Returns the RFH associated with this frame. Must be called on the UI
// thread.
// Returns the RFH currently associated with this frame. May return nullptr if
// this frame is currenly detached. Do not directly compare RFH pointers; use
// IsSameFrame() instead. Must be called on the UI thread.
content::RenderFrameHost* GetRenderFrameHost() const;
// Returns true if this frame and |frame_host| represent the same frame.
// Frames are considered the same if they share the same frame token value,
// so this method is safe to call even for detached frames. Must be called on
// the UI thread.
bool IsSameFrame(content::RenderFrameHost* frame_host) const;
// Returns true if this frame is currently detached (e.g. no associated RFH).
// Must be called on the UI thread.
bool IsDetached() const;
enum class DetachReason {
RENDER_FRAME_DELETED,
NEW_MAIN_FRAME,
@ -145,10 +157,10 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
absl::optional<std::vector<cef::mojom::DraggableRegionEntryPtr>> regions)
override;
static const int64_t kMainFrameId;
static const int64_t kFocusedFrameId;
static const int64_t kUnspecifiedFrameId;
static const int64_t kInvalidFrameId;
bool is_temporary() const { return !frame_token_.has_value(); }
std::optional<content::GlobalRenderFrameHostToken> frame_token() const {
return frame_token_;
}
// PageTransition type for explicit navigations. This must pass the check in
// ContentBrowserClient::IsExplicitNavigation for debug URLs (HandleDebugURL)
@ -156,7 +168,6 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
static const ui::PageTransition kPageTransitionExplicit;
private:
int64_t GetFrameId() const;
scoped_refptr<CefBrowserInfo> GetBrowserInfo() const;
CefRefPtr<CefBrowserHostBase> GetBrowserHostBase() const;
@ -172,16 +183,17 @@ class CefFrameHostImpl : public CefFrame, public cef::mojom::BrowserFrame {
std::string GetDebugString() const;
const bool is_main_frame_;
const std::optional<content::GlobalRenderFrameHostToken> frame_token_;
// The following members may be read/modified from any thread. All access must
// be protected by |state_lock_|.
// The following members are only modified on the UI thread but may be read
// from any thread. Any modification on the UI thread, or any access from
// non-UI threads, must be protected by |state_lock_|.
mutable base::Lock state_lock_;
int64_t frame_id_;
scoped_refptr<CefBrowserInfo> browser_info_;
bool is_focused_;
CefString url_;
CefString name_;
int64_t parent_frame_id_;
std::optional<content::GlobalRenderFrameHostToken> parent_frame_token_;
// The following members are only accessed on the UI thread.
content::RenderFrameHost* render_frame_host_ = nullptr;

View File

@ -20,7 +20,7 @@
#include "ui/gfx/font_render_params.h"
#include "ui/views/widget/widget.h"
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
#include "libcef/browser/native/window_x11.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/events/keycodes/keyboard_code_conversion_xkb.h"
@ -55,7 +55,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
gfx::Rect rect(window_info_.bounds.x, window_info_.bounds.y,
window_info_.bounds.width, window_info_.bounds.height);
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
DCHECK(!window_x11_);
x11::Window parent_window = x11::Window::None;
@ -87,7 +87,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
window_widget_->Show();
window_x11_->Show();
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_OZONE_X11)
// As an additional requirement on Linux, we must set the colors for the
// render widgets in webkit.
@ -115,7 +115,7 @@ bool CefBrowserPlatformDelegateNativeLinux::CreateHostWindow() {
}
void CefBrowserPlatformDelegateNativeLinux::CloseHostWindow() {
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
if (window_x11_) {
window_x11_->Close();
}
@ -145,14 +145,14 @@ void CefBrowserPlatformDelegateNativeLinux::SetFocus(bool setFocus) {
web_contents_->Focus();
}
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
if (window_x11_) {
// Give native focus to the DesktopNativeWidgetAura for the root window.
// Needs to be done via the ::Window so that keyboard focus is assigned
// correctly.
window_x11_->Focus();
}
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_OZONE_X11)
}
void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
@ -163,7 +163,7 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
return;
}
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
if (!window_x11_) {
return;
}
@ -183,16 +183,16 @@ void CefBrowserPlatformDelegateNativeLinux::NotifyMoveOrResizeStarted() {
content::RenderWidgetHostImpl::From(
web_contents_->GetRenderViewHost()->GetWidget())
->SendScreenRects();
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_OZONE_X11)
}
void CefBrowserPlatformDelegateNativeLinux::SizeTo(int width, int height) {
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
if (window_x11_) {
window_x11_->SetBounds(
gfx::Rect(window_x11_->bounds().origin(), gfx::Size(width, height)));
}
#endif // BUILDFLAG(OZONE_PLATFORM_X11)
#endif // BUILDFLAG(IS_OZONE_X11)
}
void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) {
@ -249,7 +249,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent(
ui::DomCode dom_code =
ui::KeycodeConverter::NativeKeycodeToDomCode(key_event.native_key_code);
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
int keysym = ui::XKeysymForWindowsKeyCode(
key_code, !!(key_event.modifiers & EVENTFLAG_SHIFT_DOWN));
char16_t character = ui::GetUnicodeCharacterFromXKeySym(keysym);
@ -277,7 +277,7 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent(
DCHECK(false);
}
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
ui::DomKey dom_key = ui::XKeySymToDomKey(keysym, character);
#else
ui::DomKey dom_key = ui::DomKey::NONE;

View File

@ -7,9 +7,9 @@
#include "libcef/browser/native/browser_platform_delegate_native_aura.h"
#include "ui/ozone/buildflags.h"
#include "ui/base/ozone_buildflags.h"
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
class CefWindowX11;
#endif
@ -44,7 +44,7 @@ class CefBrowserPlatformDelegateNativeLinux
// True if the host window has been created.
bool host_window_created_ = false;
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
CefWindowX11* window_x11_ = nullptr;
#endif
};

View File

@ -16,8 +16,8 @@
#include "ui/wm/core/cursor_loader.h"
#if BUILDFLAG(IS_LINUX)
#include "ui/ozone/buildflags.h"
#if BUILDFLAG(OZONE_PLATFORM_X11)
#include "ui/base/ozone_buildflags.h"
#if BUILDFLAG(IS_OZONE_X11)
#include "ui/base/x/x11_cursor.h"
#elif BUILDFLAG(IS_OZONE)
#include "ui/ozone/common/bitmap_cursor.h"
@ -107,7 +107,7 @@ using CursorType = ui::WinCursor;
inline cef_cursor_handle_t GetCursorHandleImpl(CursorType* cursor) {
return cursor->hcursor();
}
#elif BUILDFLAG(OZONE_PLATFORM_X11)
#elif BUILDFLAG(IS_OZONE_X11)
// See https://crbug.com/1029142 for background.
using CursorType = ui::X11Cursor;
inline cef_cursor_handle_t GetCursorHandleImpl(CursorType* cursor) {

View File

@ -232,7 +232,8 @@ class CefBrowserURLRequest::Context
url_loader_network_observer =
static_cast<content::StoragePartitionImpl*>(
browser_context->GetDefaultStoragePartition())
->CreateAuthCertObserverForServiceWorker();
->CreateAuthCertObserverForServiceWorker(
content::ChildProcessHost::kInvalidUniqueID);
}
task_runner->PostTask(

View File

@ -457,7 +457,8 @@ class InterceptedRequestHandlerWrapper : public InterceptedRequestHandler {
url_loader_network_observer =
static_cast<content::StoragePartitionImpl*>(
browser_context->GetDefaultStoragePartition())
->CreateAuthCertObserverForServiceWorker();
->CreateAuthCertObserverForServiceWorker(
content::ChildProcessHost::kInvalidUniqueID);
}
}

View File

@ -10,7 +10,7 @@
#include "include/cef_base.h"
#include "third_party/blink/public/common/input/web_touch_event.h"
#include "ui/events/gesture_detection/motion_event_generic.h"
#include "ui/events/velocity_tracker/motion_event_generic.h"
// Implementation of MotionEvent which takes a stream of CefTouchEvents.
// This class is based on ui::MotionEventAura.

View File

@ -49,7 +49,7 @@
#include "ui/compositor/compositor.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/gesture_detection/gesture_provider_config_helper.h"
#include "ui/events/gesture_detection/motion_event.h"
#include "ui/events/velocity_tracker/motion_event.h"
#include "ui/gfx/geometry/dip_util.h"
#include "ui/gfx/geometry/size_conversions.h"
#include "ui/touch_selection/touch_selection_controller.h"
@ -446,7 +446,7 @@ bool CefRenderWidgetHostViewOSR::IsShowing() {
void CefRenderWidgetHostViewOSR::EnsureSurfaceSynchronizedForWebTest() {
++latest_capture_sequence_number_;
SynchronizeVisualProperties(cc::DeadlinePolicy::UseInfiniteDeadline(),
absl::nullopt);
std::nullopt);
}
content::TouchSelectionControllerClientManager*
@ -472,15 +472,15 @@ void CefRenderWidgetHostViewOSR::SetBackgroundColor(SkColor color) {
content::RenderWidgetHostViewBase::SetBackgroundColor(color);
}
absl::optional<SkColor> CefRenderWidgetHostViewOSR::GetBackgroundColor() {
std::optional<SkColor> CefRenderWidgetHostViewOSR::GetBackgroundColor() {
return background_color_;
}
void CefRenderWidgetHostViewOSR::UpdateBackgroundColor() {}
absl::optional<content::DisplayFeature>
std::optional<content::DisplayFeature>
CefRenderWidgetHostViewOSR::GetDisplayFeature() {
return absl::nullopt;
return std::nullopt;
}
void CefRenderWidgetHostViewOSR::SetDisplayFeatureForTesting(
@ -543,7 +543,7 @@ CefRenderWidgetHostViewOSR::GetCurrentLocalSurfaceId() const {
}
void CefRenderWidgetHostViewOSR::UpdateLocalSurfaceIdFromEmbeddedClient(
const absl::optional<viz::LocalSurfaceId>&
const std::optional<viz::LocalSurfaceId>&
embedded_client_local_surface_id) {
if (embedded_client_local_surface_id) {
parent_local_surface_id_allocator_->UpdateFromChild(
@ -969,7 +969,7 @@ void CefRenderWidgetHostViewOSR::DidNavigate() {
GetLocalSurfaceId());
} else {
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
absl::nullopt);
std::nullopt);
}
}
if (delegated_frame_host_) {
@ -1053,12 +1053,12 @@ void CefRenderWidgetHostViewOSR::WasResized() {
}
SynchronizeVisualProperties(cc::DeadlinePolicy::UseExistingDeadline(),
absl::nullopt);
std::nullopt);
}
void CefRenderWidgetHostViewOSR::SynchronizeVisualProperties(
const cc::DeadlinePolicy& deadline_policy,
const absl::optional<viz::LocalSurfaceId>& child_local_surface_id) {
const std::optional<viz::LocalSurfaceId>& child_local_surface_id) {
SetFrameRate();
const bool resized = ResizeRootLayer();
@ -1099,7 +1099,7 @@ void CefRenderWidgetHostViewOSR::OnScreenInfoChanged() {
}
SynchronizeVisualProperties(cc::DeadlinePolicy::UseDefaultDeadline(),
absl::nullopt);
std::nullopt);
if (render_widget_host_->delegate()) {
render_widget_host_->delegate()->SendScreenRects();
@ -1810,8 +1810,8 @@ void CefRenderWidgetHostViewOSR::RequestImeCompositionUpdate(
void CefRenderWidgetHostViewOSR::ImeCompositionRangeChanged(
const gfx::Range& range,
const absl::optional<std::vector<gfx::Rect>>& character_bounds,
const absl::optional<std::vector<gfx::Rect>>& line_bounds) {
const std::optional<std::vector<gfx::Rect>>& character_bounds,
const std::optional<std::vector<gfx::Rect>>& line_bounds) {
if (browser_impl_.get()) {
CefRange cef_range(range.start(), range.end());
CefRenderHandler::RectList rcList;

View File

@ -37,7 +37,7 @@
#include "ui/events/base_event_utils.h"
#include "ui/events/gesture_detection/filtered_gesture_provider.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/gesture_detection/motion_event_generic.h"
#include "ui/events/velocity_tracker/motion_event_generic.h"
#include "ui/gfx/geometry/rect.h"
#if BUILDFLAG(IS_MAC)
@ -128,9 +128,9 @@ class CefRenderWidgetHostViewOSR
GetTouchSelectionControllerClientManager() override;
gfx::Rect GetViewBounds() override;
void SetBackgroundColor(SkColor color) override;
absl::optional<SkColor> GetBackgroundColor() override;
std::optional<SkColor> GetBackgroundColor() override;
void UpdateBackgroundColor() override;
absl::optional<content::DisplayFeature> GetDisplayFeature() override;
std::optional<content::DisplayFeature> GetDisplayFeature() override;
void SetDisplayFeatureForTesting(
const content::DisplayFeature* display_feature) override;
blink::mojom::PointerLockResult LockMouse(
@ -183,8 +183,8 @@ class CefRenderWidgetHostViewOSR
viz::SurfaceId GetCurrentSurfaceId() const override;
void ImeCompositionRangeChanged(
const gfx::Range& range,
const absl::optional<std::vector<gfx::Rect>>& character_bounds,
const absl::optional<std::vector<gfx::Rect>>& line_bounds) override;
const std::optional<std::vector<gfx::Rect>>& character_bounds,
const std::optional<std::vector<gfx::Rect>>& line_bounds) override;
std::unique_ptr<content::SyntheticGestureTarget>
CreateSyntheticGestureTarget() override;
bool TransformPointToCoordSpaceForView(
@ -238,7 +238,7 @@ class CefRenderWidgetHostViewOSR
void WasResized();
void SynchronizeVisualProperties(
const cc::DeadlinePolicy& deadline_policy,
const absl::optional<viz::LocalSurfaceId>& child_local_surface_id);
const std::optional<viz::LocalSurfaceId>& child_local_surface_id);
void OnScreenInfoChanged();
void Invalidate(CefBrowserHost::PaintElementType type);
void SendExternalBeginFrame();
@ -359,7 +359,7 @@ class CefRenderWidgetHostViewOSR
// has allocated one. Also sets child sequence number component of the
// viz::LocalSurfaceId allocator.
void UpdateLocalSurfaceIdFromEmbeddedClient(
const absl::optional<viz::LocalSurfaceId>& local_surface_id);
const std::optional<viz::LocalSurfaceId>& local_surface_id);
// Returns the current viz::LocalSurfaceIdAllocation.
const viz::LocalSurfaceId& GetOrCreateLocalSurfaceId();

View File

@ -191,6 +191,8 @@ cef_permission_request_types_t GetCefRequestType(
return CEF_PERMISSION_TYPE_CAMERA_PAN_TILT_ZOOM;
case permissions::RequestType::kCameraStream:
return CEF_PERMISSION_TYPE_CAMERA_STREAM;
case permissions::RequestType::kCapturedSurfaceControl:
return CEF_PERMISSION_TYPE_CAPTURED_SURFACE_CONTROL;
case permissions::RequestType::kClipboard:
return CEF_PERMISSION_TYPE_CLIPBOARD;
case permissions::RequestType::kDiskQuota:
@ -236,7 +238,7 @@ cef_permission_request_types_t GetCefRequestType(
uint32_t GetRequestedPermissions(
permissions::PermissionPrompt::Delegate* delegate) {
uint32_t permissions = CEF_PERMISSION_TYPE_NONE;
for (const auto* request : delegate->Requests()) {
for (const auto& request : delegate->Requests()) {
permissions |= GetCefRequestType(request->request_type());
}
return permissions;

View File

@ -7,8 +7,8 @@
#include <memory>
#if BUILDFLAG(IS_LINUX)
#include "ui/ozone/buildflags.h"
#if BUILDFLAG(OZONE_PLATFORM_X11)
#include "ui/base/ozone_buildflags.h"
#if BUILDFLAG(IS_OZONE_X11)
// Include first due to redefinition of x11::EventMask.
#include "ui/base/x/x11_util.h"
#endif
@ -26,7 +26,7 @@
#include "ui/views/window/native_frame_view.h"
#if BUILDFLAG(IS_LINUX)
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
#include "ui/gfx/x/atom_cache.h"
#include "ui/linux/linux_ui_delegate.h"
#endif
@ -536,7 +536,7 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
}
#if BUILDFLAG(IS_LINUX)
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
auto x11window = static_cast<x11::Window>(view_util::GetWindowHandle(widget));
CHECK(x11window != x11::Window::None);
@ -642,7 +642,7 @@ ui::ImageModel CefWindowView::GetWindowAppIcon() {
void CefWindowView::WindowClosing() {
#if BUILDFLAG(IS_LINUX)
#if BUILDFLAG(OZONE_PLATFORM_X11)
#if BUILDFLAG(IS_OZONE_X11)
if (host_widget()) {
auto parent = static_cast<gfx::AcceleratedWidget>(
view_util::GetWindowHandle(host_widget()));

View File

@ -124,10 +124,10 @@ std::u16string AlloyContentClient::GetLocalizedString(
return value;
}
base::StringPiece AlloyContentClient::GetDataResource(
std::string_view AlloyContentClient::GetDataResource(
int resource_id,
ui::ResourceScaleFactor scale_factor) {
base::StringPiece value =
auto value =
ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(
resource_id, scale_factor);
if (value.empty()) {

View File

@ -23,7 +23,7 @@ class AlloyContentClient : public content::ContentClient {
std::u16string GetLocalizedString(int message_id) override;
std::u16string GetLocalizedString(int message_id,
const std::u16string& replacement) override;
base::StringPiece GetDataResource(
std::string_view GetDataResource(
int resource_id,
ui::ResourceScaleFactor scale_factor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;

View File

@ -428,23 +428,23 @@ std::optional<int> AlloyMainDelegate::BasicStartupComplete() {
log_settings.lock_log = logging::DONT_LOCK_LOG_FILE;
log_settings.delete_old = logging::APPEND_TO_OLD_LOG_FILE;
logging::LogSeverity log_severity = logging::LOG_INFO;
logging::LogSeverity log_severity = logging::LOGGING_INFO;
std::string log_severity_str =
command_line->GetSwitchValueASCII(switches::kLogSeverity);
if (!log_severity_str.empty()) {
if (base::EqualsCaseInsensitiveASCII(log_severity_str,
switches::kLogSeverity_Verbose)) {
log_severity = logging::LOG_VERBOSE;
log_severity = logging::LOGGING_VERBOSE;
} else if (base::EqualsCaseInsensitiveASCII(
log_severity_str, switches::kLogSeverity_Warning)) {
log_severity = logging::LOG_WARNING;
log_severity = logging::LOGGING_WARNING;
} else if (base::EqualsCaseInsensitiveASCII(log_severity_str,
switches::kLogSeverity_Error)) {
log_severity = logging::LOG_ERROR;
log_severity = logging::LOGGING_ERROR;
} else if (base::EqualsCaseInsensitiveASCII(log_severity_str,
switches::kLogSeverity_Fatal)) {
log_severity = logging::LOG_FATAL;
log_severity = logging::LOGGING_FATAL;
} else if (base::EqualsCaseInsensitiveASCII(
log_severity_str, switches::kLogSeverity_Disable)) {
log_severity = LOGSEVERITY_DISABLE;
@ -456,7 +456,7 @@ std::optional<int> AlloyMainDelegate::BasicStartupComplete() {
// By default, ERROR and FATAL messages will always be output to stderr due
// to the kAlwaysPrintErrorLevel value in base/logging.cc. We change the log
// level here so that only FATAL messages are output.
logging::SetMinLogLevel(logging::LOG_FATAL);
logging::SetMinLogLevel(logging::LOGGING_FATAL);
} else {
log_settings.logging_dest = logging::LOG_TO_ALL;
logging::SetMinLogLevel(log_severity);

View File

@ -59,7 +59,7 @@ bool CefExtensionsAPIProvider::IsAPISchemaGenerated(const std::string& name) {
return false;
}
base::StringPiece CefExtensionsAPIProvider::GetAPISchema(
std::string_view CefExtensionsAPIProvider::GetAPISchema(
const std::string& name) {
// Schema for CEF-only APIs.
// TODO(cef): Enable if/when CEF exposes its own Mojo APIs. See
@ -72,7 +72,7 @@ base::StringPiece CefExtensionsAPIProvider::GetAPISchema(
return api::cef::ChromeGeneratedSchemas::Get(name);
}
return base::StringPiece();
return std::string_view();
}
void CefExtensionsAPIProvider::RegisterPermissions(

View File

@ -23,7 +23,7 @@ class CefExtensionsAPIProvider : public ExtensionsAPIProvider {
void AddBehaviorFeatures(FeatureProvider* provider) override;
void AddAPIJSONSources(JSONFeatureProviderSource* json_source) override;
bool IsAPISchemaGenerated(const std::string& name) override;
base::StringPiece GetAPISchema(const std::string& name) override;
std::string_view GetAPISchema(const std::string& name) override;
void RegisterPermissions(PermissionsInfo* permissions_info) override;
void RegisterManifestHandlers() override;
};

View File

@ -6,9 +6,8 @@
#include "libcef/browser/thread_util.h"
#include <limits>
#include <sstream>
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_frame_host.h"
@ -22,18 +21,59 @@ content::GlobalRenderFrameHostId GetGlobalId(
: navigation_handle->GetPreviousRenderFrameHostId();
}
std::string GetFrameDebugString(int64_t frame_id) {
uint32_t process_id = frame_id >> 32;
uint32_t routing_id = std::numeric_limits<uint32_t>::max() & frame_id;
std::optional<content::GlobalRenderFrameHostToken> ParseFrameIdentifier(
const std::string& identifier) {
if (identifier.size() < 3) {
return std::nullopt;
}
std::stringstream ss;
ss << frame_id << " [" << process_id << "," << routing_id << "]";
return ss.str();
const size_t pos = identifier.find('-');
if (pos == std::string::npos || pos == 0 || pos == identifier.size() - 1) {
return std::nullopt;
}
std::string_view process_id_str(identifier.c_str(), pos);
int process_id;
if (!base::HexStringToInt(process_id_str, &process_id) ||
!IsValidChildId(process_id)) {
return std::nullopt;
}
std::string_view frame_token_str(identifier.c_str() + pos + 1,
identifier.size() - pos - 1);
auto token = base::Token::FromString(frame_token_str);
if (token) {
auto unguessable_token =
base::UnguessableToken::Deserialize(token->high(), token->low());
if (unguessable_token) {
return content::GlobalRenderFrameHostToken(
process_id, blink::LocalFrameToken(unguessable_token.value()));
}
}
return std::nullopt;
}
std::string MakeFrameIdentifier(
const content::GlobalRenderFrameHostToken& global_token) {
if (!IsValidGlobalToken(global_token)) {
return std::string();
}
// All upper-case hex values.
return base::StringPrintf("%X-%s", global_token.child_id,
global_token.frame_token.ToString().c_str());
}
std::string GetFrameDebugString(
const content::GlobalRenderFrameHostId& global_id) {
return GetFrameDebugString(MakeFrameId(global_id));
return base::StringPrintf("[%d,%d]", global_id.child_id,
global_id.frame_routing_id);
}
std::string GetFrameDebugString(
const content::GlobalRenderFrameHostToken& global_token) {
return MakeFrameIdentifier(global_token);
}
} // namespace frame_util

View File

@ -6,6 +6,7 @@
#define CEF_LIBCEF_COMMON_FRAME_UTIL_H_
#include <stdint.h>
#include <optional>
#include <string>
#include "base/logging.h"
@ -18,17 +19,6 @@ class NavigationHandle;
namespace frame_util {
// Create a frame ID in the format exposed by the CEF API.
inline int64_t MakeFrameId(int child_id, int frame_routing_id) {
return (static_cast<uint64_t>(child_id) << 32) |
static_cast<uint64_t>(frame_routing_id);
}
// Create a frame ID in the format exposed by the CEF API.
inline int64_t MakeFrameId(const content::GlobalRenderFrameHostId& global_id) {
return MakeFrameId(global_id.child_id, global_id.frame_routing_id);
}
// Returns true if |child_id| is valid.
inline bool IsValidChildId(int child_id) {
// See comments in ChildProcessHostImpl::GenerateChildProcessUniqueId().
@ -57,13 +47,6 @@ inline content::GlobalRenderFrameHostId MakeGlobalId(
return content::GlobalRenderFrameHostId(child_id, frame_routing_id);
}
// Create a global ID from a frame ID.
inline content::GlobalRenderFrameHostId MakeGlobalId(int64_t frame_id) {
uint32_t child_id = frame_id >> 32;
uint32_t frame_routing_id = std::numeric_limits<uint32_t>::max() & frame_id;
return MakeGlobalId(child_id, frame_routing_id);
}
// Returns an invalid global ID value.
inline content::GlobalRenderFrameHostId InvalidGlobalId() {
return content::GlobalRenderFrameHostId();
@ -74,10 +57,33 @@ inline content::GlobalRenderFrameHostId InvalidGlobalId() {
content::GlobalRenderFrameHostId GetGlobalId(
content::NavigationHandle* navigation_handle);
// Returns a human-readable version of the ID.
std::string GetFrameDebugString(int64_t frame_id);
// Returns true if |frame_token| is valid.
inline bool IsValidFrameToken(const blink::LocalFrameToken& frame_token) {
return !frame_token->is_empty();
}
// Returns true if |global_token| is valid.
inline bool IsValidGlobalToken(
const content::GlobalRenderFrameHostToken& global_token) {
return IsValidChildId(global_token.child_id) &&
IsValidFrameToken(global_token.frame_token);
}
// Create a global token from a frame identifier. Returns std::nullopt if
// |identifier| is invalid.
std::optional<content::GlobalRenderFrameHostToken> ParseFrameIdentifier(
const std::string& identifier);
// Return the frame identifier for a global token. Returns empty if
// |global_token| is invalid.
std::string MakeFrameIdentifier(
const content::GlobalRenderFrameHostToken& global_token);
// Returns a human-readable version of the ID/token.
std::string GetFrameDebugString(
const content::GlobalRenderFrameHostId& global_id);
std::string GetFrameDebugString(
const content::GlobalRenderFrameHostToken& global_token);
} // namespace frame_util

View File

@ -10,6 +10,7 @@ import "mojo/public/mojom/base/values.mojom";
import "services/network/public/mojom/site_for_cookies.mojom";
import "services/network/public/mojom/url_request.mojom";
import "third_party/blink/public/mojom/loader/referrer.mojom";
import "third_party/blink/public/mojom/tokens/tokens.mojom";
import "ui/gfx/geometry/mojom/geometry.mojom";
import "url/mojom/url.mojom";
@ -128,7 +129,8 @@ interface BrowserManager {
// Retrieve info for a new CefBrowser.
[Sync]
GetNewBrowserInfo(int32 render_frame_routing_id) => (NewBrowserInfo info);
GetNewBrowserInfo(blink.mojom.LocalFrameToken render_frame_token) =>
(NewBrowserInfo info);
};
// Interface for communicating with browser management to the render process.

View File

@ -290,7 +290,7 @@ void AlloyContentRendererClient::RenderFrameCreated(
const base::CommandLine* command_line =
base::CommandLine::ForCurrentProcess();
if (!command_line->HasSwitch(switches::kDisableSpellChecking)) {
new SpellCheckProvider(render_frame, spellcheck_.get(), this);
new SpellCheckProvider(render_frame, spellcheck_.get());
}
bool browser_created;
@ -412,9 +412,9 @@ void AlloyContentRendererClient::WillSendRequest(
}
}
uint64_t AlloyContentRendererClient::VisitedLinkHash(const char* canonical_url,
size_t length) {
return visited_link_slave_->ComputeURLFingerprint(canonical_url, length);
uint64_t AlloyContentRendererClient::VisitedLinkHash(
std::string_view canonical_url) {
return visited_link_slave_->ComputeURLFingerprint(canonical_url);
}
bool AlloyContentRendererClient::IsLinkVisited(uint64_t link_hash) {

View File

@ -97,7 +97,7 @@ class AlloyContentRendererClient
const net::SiteForCookies& site_for_cookies,
const url::Origin* initiator_origin,
GURL* new_url) override;
uint64_t VisitedLinkHash(const char* canonical_url, size_t length) override;
uint64_t VisitedLinkHash(std::string_view canonical_url) override;
bool IsLinkVisited(uint64_t link_hash) override;
bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override;
void GetSupportedKeySystems(media::GetSupportedKeySystemsCB cb) override;

View File

@ -47,18 +47,15 @@ CefURLLoaderThrottleProviderImpl::Clone() {
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>>
CefURLLoaderThrottleProviderImpl::CreateThrottles(
base::optional_ref<const blink::LocalFrameToken> local_frame_token,
const blink::WebURLRequest& request) {
const network::ResourceRequest& request) {
DCHECK_CALLED_ON_VALID_THREAD(thread_checker_);
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> throttles;
const network::mojom::RequestDestination request_destination =
request.GetRequestDestination();
// Some throttles have already been added in the browser for frame resources.
// Don't add them for frame requests.
bool is_frame_resource =
blink::IsRequestDestinationFrame(request_destination);
blink::IsRequestDestinationFrame(request.destination);
DCHECK(!is_frame_resource ||
type_ == blink::URLLoaderThrottleProviderType::kFrame);

View File

@ -31,7 +31,7 @@ class CefURLLoaderThrottleProviderImpl
std::unique_ptr<blink::URLLoaderThrottleProvider> Clone() override;
blink::WebVector<std::unique_ptr<blink::URLLoaderThrottle>> CreateThrottles(
base::optional_ref<const blink::LocalFrameToken> local_frame_token,
const blink::WebURLRequest& request) override;
const network::ResourceRequest& request) override;
void SetOnline(bool is_online) override;
private:

View File

@ -56,8 +56,6 @@ blink::ExecutionContext* GetExecutionContext(v8::Local<v8::Context> context) {
} // namespace
const int64_t kInvalidFrameId = -1;
bool CanGoBack(blink::WebView* view) {
if (!view) {
return false;

View File

@ -29,8 +29,6 @@ class WebView;
namespace blink_glue {
BLINK_EXPORT extern const int64_t kInvalidFrameId;
BLINK_EXPORT bool CanGoBack(blink::WebView* view);
BLINK_EXPORT bool CanGoForward(blink::WebView* view);
BLINK_EXPORT void GoBack(blink::WebView* view);

View File

@ -181,13 +181,14 @@ CefRefPtr<CefFrame> CefBrowserImpl::GetFocusedFrame() {
return nullptr;
}
CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(int64_t identifier) {
CefRefPtr<CefFrame> CefBrowserImpl::GetFrameByIdentifier(
const CefString& identifier) {
CEF_REQUIRE_RT_RETURN(nullptr);
return GetWebFrameImpl(identifier).get();
}
CefRefPtr<CefFrame> CefBrowserImpl::GetFrame(const CefString& name) {
CefRefPtr<CefFrame> CefBrowserImpl::GetFrameByName(const CefString& name) {
CEF_REQUIRE_RT_RETURN(nullptr);
blink::WebView* web_view = GetWebView();
@ -235,7 +236,7 @@ size_t CefBrowserImpl::GetFrameCount() {
return count;
}
void CefBrowserImpl::GetFrameIdentifiers(std::vector<int64_t>& identifiers) {
void CefBrowserImpl::GetFrameIdentifiers(std::vector<CefString>& identifiers) {
CEF_REQUIRE_RT_RETURN_VOID();
if (identifiers.size() > 0) {
@ -287,71 +288,45 @@ CefBrowserImpl::~CefBrowserImpl() = default;
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
blink::WebLocalFrame* frame) {
DCHECK(frame);
int64_t frame_id = render_frame_util::GetIdentifier(frame);
const auto& frame_token = frame->GetLocalFrameToken();
// Frames are re-used between page loads. Only add the frame to the map once.
FrameMap::const_iterator it = frames_.find(frame_id);
FrameMap::const_iterator it = frames_.find(frame_token);
if (it != frames_.end()) {
return it->second;
}
CefRefPtr<CefFrameImpl> framePtr(new CefFrameImpl(this, frame, frame_id));
frames_.insert(std::make_pair(frame_id, framePtr));
CefRefPtr<CefFrameImpl> framePtr(new CefFrameImpl(this, frame));
frames_.insert(std::make_pair(frame_token, framePtr));
return framePtr;
}
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(int64_t frame_id) {
if (frame_id == blink_glue::kInvalidFrameId) {
if (GetWebView()) {
blink::WebFrame* main_frame = GetWebView()->MainFrame();
if (main_frame && main_frame->IsWebLocalFrame()) {
return GetWebFrameImpl(main_frame->ToWebLocalFrame());
}
}
CefRefPtr<CefFrameImpl> CefBrowserImpl::GetWebFrameImpl(
const std::string& identifier) {
const auto& frame_token =
render_frame_util::ParseFrameTokenFromIdentifier(identifier);
if (!frame_token) {
return nullptr;
}
// Check if we already know about the frame.
FrameMap::const_iterator it = frames_.find(frame_id);
FrameMap::const_iterator it = frames_.find(*frame_token);
if (it != frames_.end()) {
return it->second;
}
if (GetWebView()) {
// Check if the frame exists but we don't know about it yet.
for (blink::WebFrame* frame = GetWebView()->MainFrame(); frame;
frame = frame->TraverseNext()) {
if (frame->IsWebLocalFrame() &&
render_frame_util::GetIdentifier(frame->ToWebLocalFrame()) ==
frame_id) {
return GetWebFrameImpl(frame->ToWebLocalFrame());
}
if (auto* local_frame =
blink::WebLocalFrame::FromFrameToken(*frame_token)) {
return GetWebFrameImpl(local_frame);
}
}
return nullptr;
}
void CefBrowserImpl::AddFrameObject(int64_t frame_id,
CefTrackNode* tracked_object) {
CefRefPtr<CefTrackManager> manager;
if (!frame_objects_.empty()) {
FrameObjectMap::const_iterator it = frame_objects_.find(frame_id);
if (it != frame_objects_.end()) {
manager = it->second;
}
}
if (!manager.get()) {
manager = new CefTrackManager();
frame_objects_.insert(std::make_pair(frame_id, manager));
}
manager->Add(tracked_object);
}
// RenderViewObserver methods.
// -----------------------------------------------------------------------------
@ -368,22 +343,8 @@ void CefBrowserImpl::OnDestruct() {
CefRenderManager::Get()->OnBrowserDestroyed(this);
}
void CefBrowserImpl::FrameDetached(int64_t frame_id) {
if (!frames_.empty()) {
// Remove the frame from the map.
FrameMap::iterator it = frames_.find(frame_id);
if (it != frames_.end()) {
frames_.erase(it);
}
}
if (!frame_objects_.empty()) {
// Remove any tracked objects associated with the frame.
FrameObjectMap::iterator it = frame_objects_.find(frame_id);
if (it != frame_objects_.end()) {
frame_objects_.erase(it);
}
}
void CefBrowserImpl::FrameDetached(blink::WebLocalFrame* frame) {
frames_.erase(frame->GetLocalFrameToken());
}
void CefBrowserImpl::OnLoadingStateChange(bool isLoading) {

View File

@ -16,9 +16,9 @@
#include "include/cef_browser.h"
#include "include/cef_client.h"
#include "libcef/common/tracker.h"
#include "libcef/renderer/frame_impl.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/web/web_view_observer.h"
namespace blink {
@ -57,10 +57,11 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
bool HasDocument() override;
CefRefPtr<CefFrame> GetMainFrame() override;
CefRefPtr<CefFrame> GetFocusedFrame() override;
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
CefRefPtr<CefFrame> GetFrameByIdentifier(
const CefString& identifier) override;
CefRefPtr<CefFrame> GetFrameByName(const CefString& name) override;
size_t GetFrameCount() override;
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
void GetFrameIdentifiers(std::vector<CefString>& identifiers) override;
void GetFrameNames(std::vector<CefString>& names) override;
CefBrowserImpl(blink::WebView* web_view,
@ -75,10 +76,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
// Returns the matching CefFrameImpl reference or creates a new one.
CefRefPtr<CefFrameImpl> GetWebFrameImpl(blink::WebLocalFrame* frame);
CefRefPtr<CefFrameImpl> GetWebFrameImpl(int64_t frame_id);
// Frame objects will be deleted immediately before the frame is closed.
void AddFrameObject(int64_t frame_id, CefTrackNode* tracked_object);
CefRefPtr<CefFrameImpl> GetWebFrameImpl(const std::string& identifier);
int browser_id() const { return browser_id_; }
bool is_popup() const { return is_popup_; }
@ -86,7 +84,7 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
// blink::WebViewObserver methods.
void OnDestruct() override;
void FrameDetached(int64_t frame_id);
void FrameDetached(blink::WebLocalFrame* frame);
void OnLoadingStateChange(bool isLoading);
void OnEnterBFCache();
@ -99,18 +97,13 @@ class CefBrowserImpl : public CefBrowser, public blink::WebViewObserver {
bool is_popup_;
bool is_windowless_;
// Map of unique frame ids to CefFrameImpl references.
using FrameMap = std::map<int64_t, CefRefPtr<CefFrameImpl>>;
// Map of unique frame tokens to CefFrameImpl references.
using FrameMap = std::map<blink::LocalFrameToken, CefRefPtr<CefFrameImpl>>;
FrameMap frames_;
// True if the browser was in the BFCache.
bool was_in_bfcache_ = false;
// Map of unique frame ids to CefTrackManager objects that need to be cleaned
// up when the frame is deleted.
using FrameObjectMap = std::map<int64_t, CefRefPtr<CefTrackManager>>;
FrameObjectMap frame_objects_;
struct LoadingState {
LoadingState(bool is_loading, bool can_go_back, bool can_go_forward)
: is_loading_(is_loading),

View File

@ -19,6 +19,7 @@
#include "extensions/renderer/dispatcher.h"
#include "extensions/renderer/extension_frame_helper.h"
#include "extensions/renderer/extensions_render_frame_observer.h"
#include "extensions/renderer/extensions_renderer_api_provider.h"
#include "extensions/renderer/renderer_extension_registry.h"
#include "extensions/renderer/script_context.h"
#include "third_party/blink/public/web/web_document.h"
@ -82,7 +83,9 @@ void CefExtensionsRendererClient::RenderThreadStarted() {
content::RenderThread* thread = content::RenderThread::Get();
extension_dispatcher_ = std::make_unique<extensions::Dispatcher>(
std::make_unique<extensions::CefExtensionsDispatcherDelegate>());
std::make_unique<extensions::CefExtensionsDispatcherDelegate>(),
std::vector<
std::unique_ptr<extensions::ExtensionsRendererAPIProvider>>());
extension_dispatcher_->OnRenderThreadStarted(thread);
resource_request_policy_ =
std::make_unique<extensions::ResourceRequestPolicy>(

View File

@ -61,12 +61,16 @@ constexpr auto kConnectionRetryDelay = base::Seconds(1);
// Length of time to wait for the browser connection ACK before timing out.
constexpr auto kConnectionTimeout = base::Seconds(10);
std::string GetDebugString(blink::WebLocalFrame* frame) {
return "frame " + render_frame_util::GetIdentifier(frame);
}
} // namespace
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser,
blink::WebLocalFrame* frame,
int64_t frame_id)
: browser_(browser), frame_(frame), frame_id_(frame_id) {}
CefFrameImpl::CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame)
: browser_(browser),
frame_(frame),
frame_debug_str_(GetDebugString(frame)) {}
CefFrameImpl::~CefFrameImpl() = default;
@ -185,10 +189,14 @@ CefString CefFrameImpl::GetName() {
return name;
}
int64_t CefFrameImpl::GetIdentifier() {
CEF_REQUIRE_RT_RETURN(0);
CefString CefFrameImpl::GetIdentifier() {
CefString identifier;
CEF_REQUIRE_RT_RETURN(identifier);
return frame_id_;
if (frame_) {
identifier = render_frame_util::GetIdentifier(frame_);
}
return identifier;
}
CefRefPtr<CefFrame> CefFrameImpl::GetParent() {
@ -406,10 +414,9 @@ void CefFrameImpl::OnDetached() {
// keep |this| alive until after this method returns.
CefRefPtr<CefFrameImpl> self = this;
browser_->FrameDetached(frame_);
frame_ = nullptr;
browser_->FrameDetached(frame_id_);
OnDisconnect(DisconnectReason::DETACHED);
browser_ = nullptr;
@ -417,7 +424,7 @@ void CefFrameImpl::OnDetached() {
// In case we never attached.
while (!queued_browser_actions_.empty()) {
auto& action = queued_browser_actions_.front();
LOG(WARNING) << action.first << " sent to detached " << GetDebugString()
LOG(WARNING) << action.first << " sent to detached " << frame_debug_str_
<< " will be ignored";
queued_browser_actions_.pop();
}
@ -425,7 +432,7 @@ void CefFrameImpl::OnDetached() {
// In case we're destroyed without the context being created.
while (!queued_context_actions_.empty()) {
auto& action = queued_context_actions_.front();
LOG(WARNING) << action.first << " sent to detached " << GetDebugString()
LOG(WARNING) << action.first << " sent to detached " << frame_debug_str_
<< " will be ignored";
queued_context_actions_.pop();
}
@ -444,7 +451,7 @@ void CefFrameImpl::ExecuteOnLocalFrame(const std::string& function_name,
if (frame_) {
std::move(action).Run(frame_);
} else {
LOG(WARNING) << function_name << " sent to detached " << GetDebugString()
LOG(WARNING) << function_name << " sent to detached " << frame_debug_str_
<< " will be ignored";
}
}
@ -467,7 +474,7 @@ void CefFrameImpl::ConnectBrowserFrame(ConnectReason reason) {
"RETRY %zu/%zu", browser_connect_retry_ct_, kConnectionRetryMaxCt);
break;
}
VLOG(1) << GetDebugString() << " connection request (reason=" << reason_str
VLOG(1) << frame_debug_str_ << " connection request (reason=" << reason_str
<< ")";
}
@ -477,7 +484,7 @@ void CefFrameImpl::ConnectBrowserFrame(ConnectReason reason) {
if (!frame_ || blink_glue::IsInBackForwardCache(frame_)) {
browser_connection_state_ = ConnectionState::DISCONNECTED;
browser_connect_timer_.Stop();
VLOG(1) << GetDebugString() << " connection retry canceled (reason="
VLOG(1) << frame_debug_str_ << " connection retry canceled (reason="
<< (frame_ ? "BFCACHED" : "INVALID") << ")";
return;
}
@ -524,7 +531,7 @@ const mojo::Remote<cef::mojom::BrowserFrame>& CefFrameImpl::GetBrowserFrame(
}
void CefFrameImpl::OnBrowserFrameTimeout() {
LOG(ERROR) << GetDebugString() << " connection timeout";
LOG(ERROR) << frame_debug_str_ << " connection timeout";
OnDisconnect(DisconnectReason::CONNECT_TIMEOUT);
}
@ -577,7 +584,7 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason) {
state_str += ", FRAME_INVALID";
}
VLOG(1) << GetDebugString() << " disconnected (reason=" << reason_str
VLOG(1) << frame_debug_str_ << " disconnected (reason=" << reason_str
<< ", current_state=" << state_str << ")";
}
@ -590,7 +597,7 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason) {
// intentionally detached.
if (frame_ && reason != DisconnectReason::BROWSER_FRAME_DETACHED) {
if (browser_connect_retry_ct_++ < kConnectionRetryMaxCt) {
VLOG(1) << GetDebugString() << " connection retry scheduled";
VLOG(1) << frame_debug_str_ << " connection retry scheduled";
// Retry after a delay in case the frame is currently navigating, being
// destroyed, or entering the bfcache. In the navigation case the retry
@ -605,7 +612,7 @@ void CefFrameImpl::OnDisconnect(DisconnectReason reason) {
ConnectReason::RETRY));
} else {
// Trigger a crash in official builds.
LOG(FATAL) << GetDebugString() << " connection retry failed";
LOG(FATAL) << frame_debug_str_ << " connection retry failed";
}
}
}
@ -614,7 +621,7 @@ void CefFrameImpl::SendToBrowserFrame(const std::string& function_name,
BrowserFrameAction action) {
if (!frame_) {
// We've been detached.
LOG(WARNING) << function_name << " sent to detached " << GetDebugString()
LOG(WARNING) << function_name << " sent to detached " << frame_debug_str_
<< " will be ignored";
return;
}
@ -798,10 +805,6 @@ void CefFrameImpl::ContextLifecycleStateChanged(
}
}
std::string CefFrameImpl::GetDebugString() const {
return "frame " + frame_util::GetFrameDebugString(frame_id_);
}
// Enable deprecation warnings on Windows. See http://crbug.com/585142.
#if BUILDFLAG(IS_WIN)
#if defined(__clang__)

View File

@ -41,9 +41,7 @@ class CefFrameImpl
public cef::mojom::RenderFrame,
public blink_glue::CefExecutionContextLifecycleStateObserver {
public:
CefFrameImpl(CefBrowserImpl* browser,
blink::WebLocalFrame* frame,
int64_t frame_id);
CefFrameImpl(CefBrowserImpl* browser, blink::WebLocalFrame* frame);
CefFrameImpl(const CefFrameImpl&) = delete;
CefFrameImpl& operator=(const CefFrameImpl&) = delete;
@ -70,7 +68,7 @@ class CefFrameImpl
bool IsMain() override;
bool IsFocused() override;
CefString GetName() override;
int64_t GetIdentifier() override;
CefString GetIdentifier() override;
CefRefPtr<CefFrame> GetParent() override;
CefString GetURL() override;
CefRefPtr<CefBrowser> GetBrowser() override;
@ -162,11 +160,9 @@ class CefFrameImpl
void ContextLifecycleStateChanged(
blink::mojom::blink::FrameLifecycleState state) override;
std::string GetDebugString() const;
CefBrowserImpl* browser_;
blink::WebLocalFrame* frame_;
const int64_t frame_id_;
const std::string frame_debug_str_;
bool did_commit_provisional_load_ = false;
bool did_initialize_script_context_ = false;

View File

@ -15,13 +15,12 @@
namespace render_frame_util {
int64_t GetIdentifier(blink::WebLocalFrame* frame) {
std::string GetIdentifier(blink::WebLocalFrame* frame) {
// Each WebFrame will have an associated RenderFrame. The RenderFrame
// routing IDs are unique within a given renderer process.
content::RenderFrame* render_frame =
content::RenderFrame::FromWebFrame(frame);
return frame_util::MakeFrameId(content::RenderThread::Get()->GetClientId(),
render_frame->GetRoutingID());
return frame_util::MakeFrameIdentifier(content::GlobalRenderFrameHostToken(
content::RenderThread::Get()->GetClientId(),
frame->GetLocalFrameToken()));
}
std::string GetName(blink::WebLocalFrame* frame) {
@ -42,4 +41,14 @@ std::string GetName(blink::WebLocalFrame* frame) {
return std::string();
}
std::optional<blink::LocalFrameToken> ParseFrameTokenFromIdentifier(
const std::string& identifier) {
const auto& global_token = frame_util::ParseFrameIdentifier(identifier);
if (!global_token ||
global_token->child_id != content::RenderThread::Get()->GetClientId()) {
return std::nullopt;
}
return global_token->frame_token;
}
} // namespace render_frame_util

View File

@ -6,19 +6,25 @@
#ifndef CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_
#define CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_
#include <stdint.h>
#include <optional>
#include <string>
#include "third_party/blink/public/common/tokens/tokens.h"
namespace blink {
class WebLocalFrame;
}
} // namespace blink
namespace render_frame_util {
int64_t GetIdentifier(blink::WebLocalFrame* frame);
std::string GetIdentifier(blink::WebLocalFrame* frame);
std::string GetName(blink::WebLocalFrame* frame);
// Parses |identifier| and returns a frame token appropriate to this renderer
// process, or std::nullopt.
std::optional<blink::LocalFrameToken> ParseFrameTokenFromIdentifier(
const std::string& identifier);
} // namespace render_frame_util
#endif // CEF_LIBCEF_RENDERER_RENDER_FRAME_UTIL_H_

View File

@ -41,6 +41,7 @@
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
#include "third_party/blink/public/web/web_frame.h"
#include "third_party/blink/public/web/web_local_frame.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"
@ -112,6 +113,11 @@ void CefRenderManager::RenderFrameCreated(
render_frame_observer->AttachFrame(
browser->GetWebFrameImpl(render_frame->GetWebFrame()).get());
}
// Enable support for draggable regions.
// TODO: This has performance consequences so consider making it configurable
// (e.g. only enabled for frameless windows). See issue #3636.
render_frame->GetWebView()->SetSupportsAppRegion(true);
}
void CefRenderManager::WebViewCreated(blink::WebView* web_view,
@ -317,8 +323,8 @@ CefRefPtr<CefBrowserImpl> CefRenderManager::MaybeCreateBrowser(
auto params = cef::mojom::NewBrowserInfo::New();
if (!is_pdf) {
// Retrieve browser information synchronously.
GetBrowserManager()->GetNewBrowserInfo(render_frame->GetRoutingID(),
&params);
GetBrowserManager()->GetNewBrowserInfo(
render_frame->GetWebFrame()->GetLocalFrameToken(), &params);
if (params->browser_id == 0) {
// The popup may have been canceled during creation.
return nullptr;

View File

@ -985,7 +985,7 @@ CefRefPtr<CefFrame> CefV8ContextImpl::GetFrame() {
CefRefPtr<CefBrowserImpl> browser =
CefBrowserImpl::GetBrowserForMainFrame(webframe->Top());
if (browser) {
frame = browser->GetFrame(render_frame_util::GetIdentifier(webframe));
frame = browser->GetWebFrameImpl(webframe).get();
}
}

View File

@ -9,11 +9,10 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=67e150f09374ecec24e0f326e9a1705446da9e44$
// $hash=470bf9226f66658509ba704953b84f443ed77642$
//
#include "libcef_dll/cpptoc/browser_cpptoc.h"
#include <algorithm>
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
#include "libcef_dll/cpptoc/frame_cpptoc.h"
#include "libcef_dll/shutdown_checker.h"
@ -291,7 +290,8 @@ browser_get_focused_frame(struct _cef_browser_t* self) {
}
struct _cef_frame_t* CEF_CALLBACK
browser_get_frame_byident(struct _cef_browser_t* self, int64_t identifier) {
browser_get_frame_by_identifier(struct _cef_browser_t* self,
const cef_string_t* identifier) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -300,17 +300,23 @@ browser_get_frame_byident(struct _cef_browser_t* self, int64_t identifier) {
if (!self) {
return NULL;
}
// Verify param: identifier; type: string_byref_const
DCHECK(identifier);
if (!identifier) {
return NULL;
}
// Execute
CefRefPtr<CefFrame> _retval =
CefBrowserCppToC::Get(self)->GetFrame(identifier);
CefBrowserCppToC::Get(self)->GetFrameByIdentifier(CefString(identifier));
// Return type: refptr_same
return CefFrameCppToC::Wrap(_retval);
}
struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self,
const cef_string_t* name) {
struct _cef_frame_t* CEF_CALLBACK
browser_get_frame_by_name(struct _cef_browser_t* self,
const cef_string_t* name) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -323,7 +329,7 @@ struct _cef_frame_t* CEF_CALLBACK browser_get_frame(struct _cef_browser_t* self,
// Execute
CefRefPtr<CefFrame> _retval =
CefBrowserCppToC::Get(self)->GetFrame(CefString(name));
CefBrowserCppToC::Get(self)->GetFrameByName(CefString(name));
// Return type: refptr_same
return CefFrameCppToC::Wrap(_retval);
@ -347,8 +353,7 @@ size_t CEF_CALLBACK browser_get_frame_count(struct _cef_browser_t* self) {
}
void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self,
size_t* identifiersCount,
int64_t* identifiers) {
cef_string_list_t identifiers) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
@ -357,32 +362,22 @@ void CEF_CALLBACK browser_get_frame_identifiers(struct _cef_browser_t* self,
if (!self) {
return;
}
// Verify param: identifiers; type: simple_vec_byref
DCHECK(identifiersCount && (*identifiersCount == 0 || identifiers));
if (!identifiersCount || (*identifiersCount > 0 && !identifiers)) {
// Verify param: identifiers; type: string_vec_byref
DCHECK(identifiers);
if (!identifiers) {
return;
}
// Translate param: identifiers; type: simple_vec_byref
std::vector<int64_t> identifiersList;
if (identifiersCount && *identifiersCount > 0 && identifiers) {
for (size_t i = 0; i < *identifiersCount; ++i) {
identifiersList.push_back(identifiers[i]);
}
}
// Translate param: identifiers; type: string_vec_byref
std::vector<CefString> identifiersList;
transfer_string_list_contents(identifiers, identifiersList);
// Execute
CefBrowserCppToC::Get(self)->GetFrameIdentifiers(identifiersList);
// Restore param: identifiers; type: simple_vec_byref
if (identifiersCount && identifiers) {
*identifiersCount = std::min(identifiersList.size(), *identifiersCount);
if (*identifiersCount > 0) {
for (size_t i = 0; i < *identifiersCount; ++i) {
identifiers[i] = identifiersList[i];
}
}
}
// Restore param: identifiers; type: string_vec_byref
cef_string_list_clear(identifiers);
transfer_string_list_contents(identifiersList, identifiers);
}
void CEF_CALLBACK browser_get_frame_names(struct _cef_browser_t* self,
@ -434,8 +429,8 @@ CefBrowserCppToC::CefBrowserCppToC() {
GetStruct()->has_document = browser_has_document;
GetStruct()->get_main_frame = browser_get_main_frame;
GetStruct()->get_focused_frame = browser_get_focused_frame;
GetStruct()->get_frame_byident = browser_get_frame_byident;
GetStruct()->get_frame = browser_get_frame;
GetStruct()->get_frame_by_identifier = browser_get_frame_by_identifier;
GetStruct()->get_frame_by_name = browser_get_frame_by_name;
GetStruct()->get_frame_count = browser_get_frame_count;
GetStruct()->get_frame_identifiers = browser_get_frame_identifiers;
GetStruct()->get_frame_names = browser_get_frame_names;

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=2ae26d9398bc7ed5b997aa5dae4811c74395808e$
// $hash=1edf2a7d9f2dc18f4422c9651554577735b83b66$
//
#include "libcef_dll/cpptoc/frame_cpptoc.h"
@ -311,21 +311,22 @@ cef_string_userfree_t CEF_CALLBACK frame_get_name(struct _cef_frame_t* self) {
return _retval.DetachToUserFree();
}
int64_t CEF_CALLBACK frame_get_identifier(struct _cef_frame_t* self) {
cef_string_userfree_t CEF_CALLBACK
frame_get_identifier(struct _cef_frame_t* self) {
shutdown_checker::AssertNotShutdown();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self) {
return 0;
return NULL;
}
// Execute
int64_t _retval = CefFrameCppToC::Get(self)->GetIdentifier();
CefString _retval = CefFrameCppToC::Get(self)->GetIdentifier();
// Return type: simple
return _retval;
// Return type: string
return _retval.DetachToUserFree();
}
struct _cef_frame_t* CEF_CALLBACK frame_get_parent(struct _cef_frame_t* self) {

View File

@ -9,11 +9,10 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=cb5630935d8f587b6942f6fba59faecaddd05fd9$
// $hash=e70f513f9c68725d789b0343d9484802217e60ba$
//
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include <algorithm>
#include "libcef_dll/ctocpp/browser_host_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
#include "libcef_dll/shutdown_checker.h"
@ -287,29 +286,37 @@ CefRefPtr<CefFrame> CefBrowserCToCpp::GetFocusedFrame() {
}
NO_SANITIZE("cfi-icall")
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrame(int64_t identifier) {
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrameByIdentifier(
const CefString& identifier) {
shutdown_checker::AssertNotShutdown();
cef_browser_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_frame_byident)) {
if (CEF_MEMBER_MISSING(_struct, get_frame_by_identifier)) {
return nullptr;
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: identifier; type: string_byref_const
DCHECK(!identifier.empty());
if (identifier.empty()) {
return nullptr;
}
// Execute
cef_frame_t* _retval = _struct->get_frame_byident(_struct, identifier);
cef_frame_t* _retval =
_struct->get_frame_by_identifier(_struct, identifier.GetStruct());
// Return type: refptr_same
return CefFrameCToCpp::Wrap(_retval);
}
NO_SANITIZE("cfi-icall")
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrame(const CefString& name) {
CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrameByName(const CefString& name) {
shutdown_checker::AssertNotShutdown();
cef_browser_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_frame)) {
if (CEF_MEMBER_MISSING(_struct, get_frame_by_name)) {
return nullptr;
}
@ -318,7 +325,7 @@ CefRefPtr<CefFrame> CefBrowserCToCpp::GetFrame(const CefString& name) {
// Unverified params: name
// Execute
cef_frame_t* _retval = _struct->get_frame(_struct, name.GetStruct());
cef_frame_t* _retval = _struct->get_frame_by_name(_struct, name.GetStruct());
// Return type: refptr_same
return CefFrameCToCpp::Wrap(_retval);
@ -342,7 +349,8 @@ NO_SANITIZE("cfi-icall") size_t CefBrowserCToCpp::GetFrameCount() {
}
NO_SANITIZE("cfi-icall")
void CefBrowserCToCpp::GetFrameIdentifiers(std::vector<int64_t>& identifiers) {
void CefBrowserCToCpp::GetFrameIdentifiers(
std::vector<CefString>& identifiers) {
shutdown_checker::AssertNotShutdown();
cef_browser_t* _struct = GetStruct();
@ -352,33 +360,21 @@ void CefBrowserCToCpp::GetFrameIdentifiers(std::vector<int64_t>& identifiers) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Translate param: identifiers; type: simple_vec_byref
size_t identifiersSize = identifiers.size();
size_t identifiersCount = std::max(GetFrameCount(), identifiersSize);
int64_t* identifiersList = NULL;
if (identifiersCount > 0) {
identifiersList = new int64_t[identifiersCount];
DCHECK(identifiersList);
if (identifiersList) {
memset(identifiersList, 0, sizeof(int64_t) * identifiersCount);
}
if (identifiersList && identifiersSize > 0) {
for (size_t i = 0; i < identifiersSize; ++i) {
identifiersList[i] = identifiers[i];
}
}
// Translate param: identifiers; type: string_vec_byref
cef_string_list_t identifiersList = cef_string_list_alloc();
DCHECK(identifiersList);
if (identifiersList) {
transfer_string_list_contents(identifiers, identifiersList);
}
// Execute
_struct->get_frame_identifiers(_struct, &identifiersCount, identifiersList);
_struct->get_frame_identifiers(_struct, identifiersList);
// Restore param:identifiers; type: simple_vec_byref
identifiers.clear();
if (identifiersCount > 0 && identifiersList) {
for (size_t i = 0; i < identifiersCount; ++i) {
identifiers.push_back(identifiersList[i]);
}
delete[] identifiersList;
// Restore param:identifiers; type: string_vec_byref
if (identifiersList) {
identifiers.clear();
transfer_string_list_contents(identifiersList, identifiers);
cef_string_list_free(identifiersList);
}
}

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=b8ff91ffe36573571248eadc6ab8d4761f186625$
// $hash=0c9aa4c628bb305301c74720a07145c4d2ef7cde$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_CTOCPP_H_
@ -52,10 +52,11 @@ class CefBrowserCToCpp
bool HasDocument() override;
CefRefPtr<CefFrame> GetMainFrame() override;
CefRefPtr<CefFrame> GetFocusedFrame() override;
CefRefPtr<CefFrame> GetFrame(int64_t identifier) override;
CefRefPtr<CefFrame> GetFrame(const CefString& name) override;
CefRefPtr<CefFrame> GetFrameByIdentifier(
const CefString& identifier) override;
CefRefPtr<CefFrame> GetFrameByName(const CefString& name) override;
size_t GetFrameCount() override;
void GetFrameIdentifiers(std::vector<int64_t>& identifiers) override;
void GetFrameIdentifiers(std::vector<CefString>& identifiers) override;
void GetFrameNames(std::vector<CefString>& names) override;
};

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=602eca1cab570fe366f37038f73cef59ec5412bc$
// $hash=2422c489d40f44ad21b8f80d284ec6375ae93689$
//
#include "libcef_dll/ctocpp/frame_ctocpp.h"
@ -315,21 +315,23 @@ NO_SANITIZE("cfi-icall") CefString CefFrameCToCpp::GetName() {
return _retvalStr;
}
NO_SANITIZE("cfi-icall") int64_t CefFrameCToCpp::GetIdentifier() {
NO_SANITIZE("cfi-icall") CefString CefFrameCToCpp::GetIdentifier() {
shutdown_checker::AssertNotShutdown();
cef_frame_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_identifier)) {
return 0;
return CefString();
}
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int64_t _retval = _struct->get_identifier(_struct);
cef_string_userfree_t _retval = _struct->get_identifier(_struct);
// Return type: simple
return _retval;
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
NO_SANITIZE("cfi-icall") CefRefPtr<CefFrame> CefFrameCToCpp::GetParent() {

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=29692748ec447062f17a3cc634179fe3d3ebb4e0$
// $hash=c70637482d64cbe5fd1bea33bf18950594a50dac$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_FRAME_CTOCPP_H_
@ -58,7 +58,7 @@ class CefFrameCToCpp
bool IsMain() override;
bool IsFocused() override;
CefString GetName() override;
int64_t GetIdentifier() override;
CefString GetIdentifier() override;
CefRefPtr<CefFrame> GetParent() override;
CefString GetURL() override;
CefRefPtr<CefBrowser> GetBrowser() override;

View File

@ -696,27 +696,6 @@ patches = [
# https://github.com/chromiumembedded/cef/issues/3606
'name': 'win_app_icon_3606'
},
{
# linux: Disable compiler TLS in libxml2.
# https://github.com/chromiumembedded/cef/issues/3616
'name': 'linux_libxml_tls_3616'
},
{
# linux: Fix crash after x11::Connection destruction with
# multi-threaded-message-loop.
# https://chromium-review.googlesource.com/c/chromium/src/+/5115482
'name': 'linux_connection_5115482'
},
{
# windows: Fix implicit conversion error when building cef_sandbox.
# https://chromium-review.googlesource.com/c/chromium/src/+/5120035
'name': 'base_allocator_5120035'
},
{
# Fix mojom_ts_generator.py error with Python 3.11.
# https://bugs.chromium.org/p/chromium/issues/detail?id=1422178
'name': 'mojo_generator_1422178'
},
{
# chrome: mac: Support locale configuration.
# https://github.com/chromiumembedded/cef/issues/3623

View File

@ -1,13 +0,0 @@
diff --git base/allocator/partition_allocator/src/partition_alloc/thread_cache.h base/allocator/partition_allocator/src/partition_alloc/thread_cache.h
index 381245c374382..c98aed1663517 100644
--- base/allocator/partition_allocator/src/partition_alloc/thread_cache.h
+++ base/allocator/partition_allocator/src/partition_alloc/thread_cache.h
@@ -184,7 +184,7 @@ class PA_COMPONENT_EXPORT(PARTITION_ALLOC) ThreadCacheRegistry {
internal::base::TimeDelta periodic_purge_next_interval_;
bool is_purging_configured_ = false;
- uint8_t largest_active_bucket_index_ = internal::BucketIndexLookup::GetIndex(
+ uint16_t largest_active_bucket_index_ = internal::BucketIndexLookup::GetIndex(
ThreadCacheLimits::kDefaultSizeThreshold);
};

View File

@ -1,8 +1,8 @@
diff --git base/command_line.cc base/command_line.cc
index d762b168a9ccf..f58b4f783df16 100644
index 69e4303165259..682e8d2bfa6ce 100644
--- base/command_line.cc
+++ base/command_line.cc
@@ -346,11 +346,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string,
@@ -355,11 +355,10 @@ void CommandLine::AppendSwitchNative(StringPiece switch_string,
#if BUILDFLAG(ENABLE_COMMANDLINE_SEQUENCE_CHECKS)
sequence_checker_.Check();
#endif

View File

@ -1,16 +1,16 @@
diff --git base/BUILD.gn base/BUILD.gn
index 3d538b3370caa..5a4ba79e0af64 100644
index c00c41bc2c7fd..166b3e74fd3bd 100644
--- base/BUILD.gn
+++ base/BUILD.gn
@@ -40,6 +40,7 @@ import("//build/config/ui.gni")
import("//build/nocompile.gni")
@@ -41,6 +41,7 @@ import("//build/nocompile.gni")
import("//build/timestamp.gni")
import("//build/util/process_version.gni")
import("//build_overrides/build.gni")
+import("//cef/libcef/features/features.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
@@ -1483,7 +1484,11 @@ component("base") {
@@ -1494,7 +1495,11 @@ component("base") {
"hash/md5_constexpr_internal.h",
"hash/sha1.h",
]
@ -23,7 +23,7 @@ index 3d538b3370caa..5a4ba79e0af64 100644
sources += [
"hash/md5_nacl.cc",
"hash/md5_nacl.h",
@@ -1907,6 +1912,12 @@ component("base") {
@@ -1918,6 +1923,12 @@ component("base") {
defines += [ "COM_INIT_CHECK_HOOK_DISABLED" ]
}
@ -88,11 +88,11 @@ index 29626e5853c6e..2fb1c61504c5d 100644
#else
#include "base/hash/sha1_boringssl.h"
diff --git base/rand_util.h base/rand_util.h
index 8387bc9596ad7..c3dafe80e33b7 100644
index 00e901a3262ca..88ce372eb0a1a 100644
--- base/rand_util.h
+++ base/rand_util.h
@@ -16,8 +16,9 @@
#include "base/compiler_specific.h"
@@ -17,8 +17,9 @@
#include "base/containers/span.h"
#include "base/gtest_prod_util.h"
#include "build/build_config.h"
+#include "cef/libcef/features/features.h"
@ -102,7 +102,7 @@ index 8387bc9596ad7..c3dafe80e33b7 100644
#include "third_party/boringssl/src/include/openssl/rand.h"
#endif
@@ -122,7 +123,7 @@ class RandomBitGenerator {
@@ -125,7 +126,7 @@ class RandomBitGenerator {
~RandomBitGenerator() = default;
};
@ -112,7 +112,7 @@ index 8387bc9596ad7..c3dafe80e33b7 100644
public:
using result_type = uint64_t;
diff --git base/rand_util_win.cc base/rand_util_win.cc
index 549f4362af8b6..f08b1b2e7f061 100644
index 6aae763d98715..7f55cb70e94d2 100644
--- base/rand_util_win.cc
+++ base/rand_util_win.cc
@@ -15,8 +15,12 @@
@ -150,21 +150,21 @@ index 549f4362af8b6..f08b1b2e7f061 100644
@@ -66,6 +75,7 @@ decltype(&ProcessPrng) GetProcessPrng() {
}
void RandBytes(void* output, size_t output_length, bool avoid_allocation) {
void RandBytes(span<uint8_t> output, bool avoid_allocation) {
+#if !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
if (!avoid_allocation && internal::UseBoringSSLForRandBytes()) {
// Ensure BoringSSL is initialized so it can use things like RDRAND.
CRYPTO_library_init();
@@ -73,6 +83,7 @@ void RandBytes(void* output, size_t output_length, bool avoid_allocation) {
(void)RAND_bytes(static_cast<uint8_t*>(output), output_length);
@@ -73,6 +83,7 @@ void RandBytes(span<uint8_t> output, bool avoid_allocation) {
(void)RAND_bytes(output.data(), output.size());
return;
}
+#endif // !BUILDFLAG(IS_CEF_SANDBOX_BUILD)
static decltype(&ProcessPrng) process_prng_fn = GetProcessPrng();
BOOL success = process_prng_fn(static_cast<BYTE*>(output), output_length);
BOOL success =
diff --git base/unguessable_token.cc base/unguessable_token.cc
index 44bfc3e2624d5..cccb306a383ce 100644
index da65502f75c3a..8b9d6eec4a1e2 100644
--- base/unguessable_token.cc
+++ base/unguessable_token.cc
@@ -10,8 +10,9 @@
@ -178,7 +178,7 @@ index 44bfc3e2624d5..cccb306a383ce 100644
#include "third_party/boringssl/src/include/openssl/mem.h"
#endif
@@ -46,7 +47,7 @@ absl::optional<UnguessableToken> UnguessableToken::Deserialize(uint64_t high,
@@ -57,7 +58,7 @@ absl::optional<UnguessableToken> UnguessableToken::DeserializeFromString(
}
bool operator==(const UnguessableToken& lhs, const UnguessableToken& rhs) {

View File

@ -1,5 +1,5 @@
diff --git base/ranges/ranges.h base/ranges/ranges.h
index 641bbaf2c7576..afdd641e38452 100644
index 27eac4f3a4c39..2cb63bec79e63 100644
--- base/ranges/ranges.h
+++ base/ranges/ranges.h
@@ -30,12 +30,14 @@ constexpr T* begin(std::array<T, N>& array, priority_tag<2> tag) {

View File

@ -1,5 +1,5 @@
diff --git base/test/BUILD.gn base/test/BUILD.gn
index f2026e17e6638..aec8bd2743f3a 100644
index bffe24a080a34..9191487142995 100644
--- base/test/BUILD.gn
+++ base/test/BUILD.gn
@@ -189,11 +189,6 @@ static_library("test_support") {
@ -14,7 +14,7 @@ index f2026e17e6638..aec8bd2743f3a 100644
deps += [
":amalgamated_perfetto_sql_stdlib",
":gen_cc_chrome_track_event_descriptor",
@@ -559,7 +554,7 @@ if (enable_base_tracing) {
@@ -560,7 +555,7 @@ if (enable_base_tracing) {
# processor depends on dev_sqlite. The two share the same symbols but have
# different implementations, so we need to hide dev_sqlite in this shared
# library even in non-component builds to prevent duplicate symbols.
@ -23,7 +23,7 @@ index f2026e17e6638..aec8bd2743f3a 100644
if (is_ios) {
_target_type = "ios_framework_bundle"
}
@@ -568,6 +563,8 @@ if (enable_base_tracing) {
@@ -569,6 +564,8 @@ if (enable_base_tracing) {
defines = [ "TEST_TRACE_PROCESSOR_IMPL" ]
testonly = true
sources = [
@ -32,7 +32,7 @@ index f2026e17e6638..aec8bd2743f3a 100644
"test_trace_processor_export.h",
"test_trace_processor_impl.cc",
"test_trace_processor_impl.h",
@@ -585,33 +582,6 @@ if (enable_base_tracing) {
@@ -586,33 +583,6 @@ if (enable_base_tracing) {
output_name = "TestTraceProcessor"
bundle_deps_filter = [ "//third_party/icu:icudata" ]
}

View File

@ -1,10 +1,10 @@
diff --git third_party/blink/public/web/web_element.h third_party/blink/public/web/web_element.h
index 02fa305524694..29e77bafa710c 100644
index 9cd08e8b26410..d2dca33bdc62e 100644
--- third_party/blink/public/web/web_element.h
+++ third_party/blink/public/web/web_element.h
@@ -81,6 +81,9 @@ class BLINK_EXPORT WebElement : public WebNode {
void SetAttribute(const WebString& name, const WebString& value);
@@ -82,6 +82,9 @@ class BLINK_EXPORT WebElement : public WebNode {
WebString TextContent() const;
WebString TextContentAbridged(unsigned int max_length) const;
WebString InnerHTML() const;
+ WebString AttributeLocalName(unsigned index) const;
+ WebString AttributeValue(unsigned index) const;
@ -13,7 +13,7 @@ index 02fa305524694..29e77bafa710c 100644
// Returns true if the element's contenteditable attribute is in the true
// state or in the plaintext-only state:
diff --git third_party/blink/renderer/core/exported/web_element.cc third_party/blink/renderer/core/exported/web_element.cc
index e8c7cb3cdb29f..1cf10e52779e1 100644
index 0c2400696ecbc..3dd6e5574eb39 100644
--- third_party/blink/renderer/core/exported/web_element.cc
+++ third_party/blink/renderer/core/exported/web_element.cc
@@ -116,6 +116,24 @@ void WebElement::SetAttribute(const WebString& attr_name,

View File

@ -1,5 +1,5 @@
diff --git content/browser/scheduler/browser_task_executor.cc content/browser/scheduler/browser_task_executor.cc
index 307d5b7ffca63..9a8f0a4d3d7bd 100644
index 24f9538d6fd0d..0d57d47d70d38 100644
--- content/browser/scheduler/browser_task_executor.cc
+++ content/browser/scheduler/browser_task_executor.cc
@@ -209,7 +209,7 @@ BrowserTaskExecutor::OnUserInputStart() {

View File

@ -1,5 +1,5 @@
diff --git content/browser/child_process_security_policy_impl.cc content/browser/child_process_security_policy_impl.cc
index 0f781fe1c2b2e..6456de7ad1c39 100644
index 72b1e46a91e78..2aea3ca80157e 100644
--- content/browser/child_process_security_policy_impl.cc
+++ content/browser/child_process_security_policy_impl.cc
@@ -1878,6 +1878,16 @@ bool ChildProcessSecurityPolicyImpl::CanAccessDataForMaybeOpaqueOrigin(
@ -20,10 +20,10 @@ index 0f781fe1c2b2e..6456de7ad1c39 100644
// Make an exception to allow most visited tiles to commit in
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
index 64248db4bfc64..ea5037256498f 100644
index dead84566f239..9fffaa0c20c97 100644
--- content/browser/renderer_host/navigation_request.cc
+++ content/browser/renderer_host/navigation_request.cc
@@ -7610,10 +7610,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
@@ -7772,10 +7772,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
bool use_opaque_origin =
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
network::mojom::WebSandboxFlags::kOrigin;
@ -47,7 +47,7 @@ index 64248db4bfc64..ea5037256498f 100644
}
return origin_and_debug_info;
@@ -7721,6 +7733,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
@@ -7883,6 +7895,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
DetermineInitiatorRelationship(initiator_rfh,
frame_tree_node_->current_frame_host()));

View File

@ -1,8 +1,8 @@
diff --git build/config/compiler/BUILD.gn build/config/compiler/BUILD.gn
index de1cd6efc67b4..956d45892f31c 100644
index 89b4755ac8b39..453a1758fa253 100644
--- build/config/compiler/BUILD.gn
+++ build/config/compiler/BUILD.gn
@@ -2160,8 +2160,6 @@ config("thin_archive") {
@@ -2162,8 +2162,6 @@ config("thin_archive") {
# confuses lldb.
if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) {
arflags = [ "-T" ]

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
index 6572022524828..f39800b4a7da2 100644
index 81dceec0b449c..ca76a507bb657 100644
--- chrome/browser/BUILD.gn
+++ chrome/browser/BUILD.gn
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
@ -10,7 +10,7 @@ index 6572022524828..f39800b4a7da2 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/downgrade/buildflags.gni")
import("//chrome/common/features.gni")
@@ -2043,6 +2044,7 @@ static_library("browser") {
@@ -2025,6 +2026,7 @@ static_library("browser") {
"//build/config/chromebox_for_meetings:buildflags",
"//build/config/compiler:compiler_buildflags",
"//cc",
@ -18,7 +18,7 @@ index 6572022524828..f39800b4a7da2 100644
"//chrome:extra_resources",
"//chrome:resources",
"//chrome:strings",
@@ -2700,6 +2702,10 @@ static_library("browser") {
@@ -2679,6 +2681,10 @@ static_library("browser") {
]
}

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/browser_process.h chrome/browser/browser_process.h
index e50822a2c8d5f..b44dd9191ed08 100644
index 3e7de43022a41..21354d14d11c3 100644
--- chrome/browser/browser_process.h
+++ chrome/browser/browser_process.h
@@ -207,9 +207,9 @@ class BrowserProcess {
@ -14,10 +14,10 @@ index e50822a2c8d5f..b44dd9191ed08 100644
std::unique_ptr<BackgroundModeManager> manager) = 0;
#endif
diff --git chrome/browser/browser_process_impl.cc chrome/browser/browser_process_impl.cc
index 15e4fdcda89d2..66d26abb33af5 100644
index 57cb42c63eb6a..b8df2da97a7a1 100644
--- chrome/browser/browser_process_impl.cc
+++ chrome/browser/browser_process_impl.cc
@@ -1063,18 +1063,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
@@ -1072,18 +1072,14 @@ DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() {
return download_request_limiter_.get();
}
@ -38,10 +38,10 @@ index 15e4fdcda89d2..66d26abb33af5 100644
std::unique_ptr<BackgroundModeManager> manager) {
background_mode_manager_ = std::move(manager);
diff --git chrome/browser/browser_process_impl.h chrome/browser/browser_process_impl.h
index af96779d25b87..4ef9f7945136c 100644
index e569e2d1a0dd0..fc5703af98b58 100644
--- chrome/browser/browser_process_impl.h
+++ chrome/browser/browser_process_impl.h
@@ -191,8 +191,8 @@ class BrowserProcessImpl : public BrowserProcess,
@@ -190,8 +190,8 @@ class BrowserProcessImpl : public BrowserProcess,
void SetApplicationLocale(const std::string& actual_locale) override;
DownloadStatusUpdater* download_status_updater() override;
DownloadRequestLimiter* download_request_limiter() override;
@ -52,10 +52,10 @@ index af96779d25b87..4ef9f7945136c 100644
std::unique_ptr<BackgroundModeManager> manager) override;
#endif
diff --git chrome/browser/lifetime/browser_close_manager.cc chrome/browser/lifetime/browser_close_manager.cc
index 1fbc225de7b84..55847e48ed0c2 100644
index bfffa272e6458..460a35e0c708f 100644
--- chrome/browser/lifetime/browser_close_manager.cc
+++ chrome/browser/lifetime/browser_close_manager.cc
@@ -157,12 +157,14 @@ void BrowserCloseManager::CloseBrowsers() {
@@ -158,12 +158,14 @@ void BrowserCloseManager::CloseBrowsers() {
// exit can restore all browsers open before exiting.
ProfileManager::ShutdownSessionServices();
#endif

View File

@ -13,7 +13,7 @@ index 2480282a19d12..dbd1fbf8a15b5 100644
return false;
}
diff --git chrome/browser/devtools/devtools_window.cc chrome/browser/devtools/devtools_window.cc
index d64ccdc765368..5e8f892ff793d 100644
index ec31f050c1abb..ec30fd71f536d 100644
--- chrome/browser/devtools/devtools_window.cc
+++ chrome/browser/devtools/devtools_window.cc
@@ -31,6 +31,7 @@
@ -24,7 +24,7 @@ index d64ccdc765368..5e8f892ff793d 100644
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "chrome/browser/ui/browser_window.h"
@@ -1189,6 +1190,13 @@ DevToolsWindow* DevToolsWindow::Create(
@@ -1193,6 +1194,13 @@ DevToolsWindow* DevToolsWindow::Create(
!browser->is_type_normal()) {
can_dock = false;
}
@ -38,7 +38,7 @@ index d64ccdc765368..5e8f892ff793d 100644
}
// Create WebContents with devtools.
@@ -1760,12 +1768,29 @@ void DevToolsWindow::CreateDevToolsBrowser() {
@@ -1800,12 +1808,29 @@ void DevToolsWindow::CreateDevToolsBrowser() {
Browser::CreationStatus::kOk) {
return;
}
@ -75,10 +75,10 @@ index d64ccdc765368..5e8f892ff793d 100644
}
diff --git chrome/browser/ui/BUILD.gn chrome/browser/ui/BUILD.gn
index fc880e0dd1eb8..d8b3e4e21d092 100644
index b0146268b3384..742d5b50d054f 100644
--- chrome/browser/ui/BUILD.gn
+++ chrome/browser/ui/BUILD.gn
@@ -9,6 +9,7 @@ import("//build/config/compiler/compiler.gni")
@@ -8,6 +8,7 @@ import("//build/config/compiler/compiler.gni")
import("//build/config/features.gni")
import("//build/config/ozone.gni")
import("//build/config/ui.gni")
@ -86,7 +86,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644
import("//chrome/browser/buildflags.gni")
import("//chrome/common/features.gni")
import("//chromeos/ash/components/assistant/assistant.gni")
@@ -382,6 +383,10 @@ static_library("ui") {
@@ -395,6 +396,10 @@ static_library("ui") {
"//build/config/compiler:wexit_time_destructors",
]
@ -97,7 +97,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 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
@@ -407,6 +412,7 @@ static_library("ui") {
@@ -420,6 +425,7 @@ static_library("ui") {
"//build:chromeos_buildflags",
"//build/config/chromebox_for_meetings:buildflags",
"//cc/paint",
@ -105,7 +105,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644
"//chrome:resources",
"//chrome:strings",
"//chrome/app:chrome_dll_resources",
@@ -2863,6 +2869,8 @@ static_library("ui") {
@@ -2918,6 +2924,8 @@ static_library("ui") {
"views/apps/app_dialog/app_block_dialog_view.h",
"views/apps/app_dialog/app_pause_dialog_view.cc",
"views/apps/app_dialog/app_pause_dialog_view.h",
@ -114,7 +114,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644
"views/apps/app_info_dialog/arc_app_info_links_panel.cc",
"views/apps/app_info_dialog/arc_app_info_links_panel.h",
"views/apps/chrome_app_window_client_views_chromeos.cc",
@@ -4874,8 +4882,6 @@ static_library("ui") {
@@ -4956,8 +4964,6 @@ static_library("ui") {
"views/accessibility/theme_tracking_non_accessible_image_view.h",
"views/apps/app_dialog/app_dialog_view.cc",
"views/apps/app_dialog/app_dialog_view.h",
@ -123,7 +123,7 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644
"views/apps/app_info_dialog/app_info_dialog_container.cc",
"views/apps/app_info_dialog/app_info_dialog_container.h",
"views/apps/app_info_dialog/app_info_dialog_views.cc",
@@ -6605,6 +6611,7 @@ static_library("ui") {
@@ -6725,6 +6731,7 @@ static_library("ui") {
if (enable_printing) {
deps += [
"//components/printing/browser",
@ -132,10 +132,10 @@ index fc880e0dd1eb8..d8b3e4e21d092 100644
]
}
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
index aa28c2ec1efb2..7ad06de961e9d 100644
index a001626c9f470..52d803a867172 100644
--- chrome/browser/ui/browser.cc
+++ chrome/browser/ui/browser.cc
@@ -262,6 +262,25 @@
@@ -263,6 +263,25 @@
#include "components/captive_portal/content/captive_portal_tab_helper.h"
#endif
@ -161,7 +161,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_browser_window_helper.h"
#endif
@@ -458,6 +477,10 @@ Browser::Browser(const CreateParams& params)
@@ -459,6 +478,10 @@ Browser::Browser(const CreateParams& params)
type_(params.type),
profile_(params.profile),
window_(nullptr),
@ -185,7 +185,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
///////////////////////////////////////////////////////////////////////////////
@@ -1061,6 +1090,8 @@ void Browser::WindowFullscreenStateChanged() {
@@ -1076,6 +1105,8 @@ void Browser::WindowFullscreenStateChanged() {
->WindowFullscreenStateChanged();
command_controller_->FullscreenStateChanged();
UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN);
@ -194,7 +194,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
void Browser::FullscreenTopUIStateChanged() {
@@ -1400,6 +1431,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
@@ -1415,6 +1446,14 @@ content::KeyboardEventProcessingResult Browser::PreHandleKeyboardEvent(
if (exclusive_access_manager_->HandleUserKeyEvent(event))
return content::KeyboardEventProcessingResult::HANDLED;
@ -209,7 +209,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
return window()->PreHandleKeyboardEvent(event);
}
@@ -1407,8 +1446,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
@@ -1422,8 +1461,18 @@ bool Browser::HandleKeyboardEvent(content::WebContents* source,
const NativeWebKeyboardEvent& event) {
DevToolsWindow* devtools_window =
DevToolsWindow::GetInstanceForInspectedWebContents(source);
@ -229,8 +229,8 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
+ return window()->HandleKeyboardEvent(event);
}
bool Browser::TabsNeedBeforeUnloadFired() {
@@ -1610,6 +1659,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
bool Browser::TabsNeedBeforeUnloadFired() const {
@@ -1625,6 +1674,14 @@ WebContents* Browser::OpenURLFromTab(WebContents* source,
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
@ -245,7 +245,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
NavigateParams nav_params(this, params.url, params.transition);
nav_params.FillNavigateParamsFromOpenURLParams(params);
nav_params.source_contents = source;
@@ -1767,6 +1824,8 @@ void Browser::LoadingStateChanged(WebContents* source,
@@ -1782,6 +1839,8 @@ void Browser::LoadingStateChanged(WebContents* source,
bool should_show_loading_ui) {
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
@ -254,7 +254,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
void Browser::CloseContents(WebContents* source) {
@@ -1795,6 +1854,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
@@ -1810,6 +1869,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
}
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@ -263,7 +263,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
if (!GetStatusBubble())
return;
@@ -1802,6 +1863,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
@@ -1817,6 +1878,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
GetStatusBubble()->SetURL(url);
}
@ -281,7 +281,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
void Browser::ContentsMouseEvent(WebContents* source,
bool motion,
bool exited) {
@@ -1826,6 +1898,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
@@ -1841,6 +1913,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
return false;
}
@ -301,7 +301,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
void Browser::BeforeUnloadFired(WebContents* web_contents,
bool proceed,
bool* proceed_to_fire_unload) {
@@ -1925,6 +2010,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
@@ -1940,6 +2025,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
// Make the tab show up in the task manager.
task_manager::WebContentsTags::CreateForTabContents(new_contents);
@ -312,7 +312,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
void Browser::RendererUnresponsive(
@@ -2069,11 +2158,15 @@ void Browser::EnterFullscreenModeForTab(
@@ -2084,11 +2173,15 @@ void Browser::EnterFullscreenModeForTab(
const blink::mojom::FullscreenOptions& options) {
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
requesting_frame, options.display_id);
@ -328,7 +328,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
@@ -2266,6 +2359,15 @@ void Browser::RequestMediaAccessPermission(
@@ -2281,6 +2374,15 @@ void Browser::RequestMediaAccessPermission(
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
content::MediaResponseCallback callback) {
@ -344,7 +344,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
const extensions::Extension* extension =
GetExtensionForOrigin(profile_, request.security_origin);
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
@@ -2808,9 +2910,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
@@ -2817,9 +2919,11 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
// Browser, Getters for UI (private):
StatusBubble* Browser::GetStatusBubble() {
@ -357,7 +357,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
// We hide the status bar for web apps windows as this matches native
@@ -2818,6 +2922,12 @@ StatusBubble* Browser::GetStatusBubble() {
@@ -2827,6 +2931,12 @@ StatusBubble* Browser::GetStatusBubble() {
// mode, as the minimal browser UI includes the status bar.
if (web_app::AppBrowserController::IsWebApp(this) &&
!app_controller()->HasMinimalUiButtons()) {
@ -370,7 +370,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
return nullptr;
}
@@ -2954,6 +3064,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
@@ -2963,6 +3073,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
web_contents_collection_.StopObserving(web_contents);
}
@ -379,7 +379,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
}
void Browser::TabDetachedAtImpl(content::WebContents* contents,
@@ -3108,6 +3220,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
@@ -3117,6 +3229,14 @@ bool Browser::PictureInPictureBrowserSupportsWindowFeature(
bool Browser::SupportsWindowFeatureImpl(WindowFeature feature,
bool check_can_support) const {
@ -395,7 +395,7 @@ index aa28c2ec1efb2..7ad06de961e9d 100644
case TYPE_NORMAL:
return NormalBrowserSupportsWindowFeature(feature, check_can_support);
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
index 91ff945f74fd3..bdf661d7fdfc9 100644
index f1f279121056f..5758d8543d69e 100644
--- chrome/browser/ui/browser.h
+++ chrome/browser/ui/browser.h
@@ -22,6 +22,7 @@
@ -417,9 +417,9 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
#if BUILDFLAG(IS_ANDROID)
#error This file should only be included on desktop.
#endif
@@ -331,6 +336,15 @@ class Browser : public TabStripModelObserver,
@@ -347,6 +352,15 @@ class Browser : public TabStripModelObserver,
// Document Picture in Picture options, specific to TYPE_PICTURE_IN_PICTURE.
absl::optional<blink::mojom::PictureInPictureWindowOptions> pip_options;
std::optional<blink::mojom::PictureInPictureWindowOptions> pip_options;
+#if BUILDFLAG(ENABLE_CEF)
+ // Opaque CEF-specific configuration. Will be propagated to new Browsers.
@ -433,7 +433,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
private:
friend class Browser;
friend class WindowSizerChromeOSTest;
@@ -412,6 +426,13 @@ class Browser : public TabStripModelObserver,
@@ -428,6 +442,13 @@ class Browser : public TabStripModelObserver,
update_ui_immediately_for_testing_ = true;
}
@ -447,7 +447,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
// Accessors ////////////////////////////////////////////////////////////////
const CreateParams& create_params() const { return create_params_; }
@@ -486,6 +507,12 @@ class Browser : public TabStripModelObserver,
@@ -502,6 +523,12 @@ class Browser : public TabStripModelObserver,
base::WeakPtr<Browser> AsWeakPtr();
base::WeakPtr<const Browser> AsWeakPtr() const;
@ -460,7 +460,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
// Get the FindBarController for this browser, creating it if it does not
// yet exist.
FindBarController* GetFindBarController();
@@ -875,11 +902,19 @@ class Browser : public TabStripModelObserver,
@@ -906,11 +933,19 @@ class Browser : public TabStripModelObserver,
void SetContentsBounds(content::WebContents* source,
const gfx::Rect& bounds) override;
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
@ -480,7 +480,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
void BeforeUnloadFired(content::WebContents* source,
bool proceed,
bool* proceed_to_fire_unload) override;
@@ -1220,6 +1255,10 @@ class Browser : public TabStripModelObserver,
@@ -1248,6 +1283,10 @@ class Browser : public TabStripModelObserver,
// This Browser's window.
raw_ptr<BrowserWindow, DanglingUntriaged> window_;
@ -491,7 +491,7 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
std::unique_ptr<TabStripModelDelegate> const tab_strip_model_delegate_;
std::unique_ptr<TabStripModel> const tab_strip_model_;
@@ -1289,6 +1328,8 @@ class Browser : public TabStripModelObserver,
@@ -1314,6 +1353,8 @@ class Browser : public TabStripModelObserver,
const std::string initial_workspace_;
bool initial_visible_on_all_workspaces_state_;
@ -501,10 +501,10 @@ index 91ff945f74fd3..bdf661d7fdfc9 100644
UnloadController unload_controller_;
diff --git chrome/browser/ui/browser_navigator.cc chrome/browser/ui/browser_navigator.cc
index 3e4f480c35ea3..7dd7609b36367 100644
index e805d59f87b45..21e7d5fb70a7d 100644
--- chrome/browser/ui/browser_navigator.cc
+++ chrome/browser/ui/browser_navigator.cc
@@ -296,6 +296,10 @@ std::pair<Browser*, int> GetBrowserAndTabForDisposition(
@@ -293,6 +293,10 @@ std::pair<Browser*, int> GetBrowserAndTabForDisposition(
: 1.0;
browser_params.pip_options = pip_options;
@ -515,7 +515,7 @@ index 3e4f480c35ea3..7dd7609b36367 100644
const BrowserWindow* const browser_window = params.browser->window();
const gfx::NativeWindow native_window =
browser_window ? browser_window->GetNativeWindow()
@@ -581,6 +585,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
@@ -578,6 +582,13 @@ std::unique_ptr<content::WebContents> CreateTargetContents(
std::unique_ptr<WebContents> target_contents =
WebContents::Create(create_params);
@ -530,7 +530,7 @@ index 3e4f480c35ea3..7dd7609b36367 100644
// tab helpers, so the entire set of tab helpers needs to be set up
// immediately.
diff --git chrome/browser/ui/browser_tabstrip.cc chrome/browser/ui/browser_tabstrip.cc
index 8154aaa9c2aff..1e88bfed111ee 100644
index 435851d0f6f11..43a70f915a22c 100644
--- chrome/browser/ui/browser_tabstrip.cc
+++ chrome/browser/ui/browser_tabstrip.cc
@@ -33,9 +33,13 @@ content::WebContents* AddAndReturnTabAt(

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 6f842a7535a56..faaee032e82bd 100644
index 36335ba63ee83..e14005d6a4e86 100644
--- chrome/browser/content_settings/host_content_settings_map_factory.cc
+++ chrome/browser/content_settings/host_content_settings_map_factory.cc
@@ -9,6 +9,7 @@
@ -10,7 +10,7 @@ index 6f842a7535a56..faaee032e82bd 100644
#include "chrome/browser/content_settings/one_time_permission_provider.h"
#include "chrome/browser/permissions/one_time_permissions_tracker_factory.h"
#include "chrome/browser/profiles/off_the_record_profile_impl.h"
@@ -23,6 +24,10 @@
@@ -24,6 +25,10 @@
#include "extensions/buildflags/buildflags.h"
#include "ui/webui/webui_allowlist_provider.h"
@ -21,9 +21,9 @@ index 6f842a7535a56..faaee032e82bd 100644
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/trace_event/trace_event.h"
#include "extensions/browser/api/content_settings/content_settings_custom_extension_provider.h"
@@ -68,7 +73,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
DependsOn(OneTimePermissionsTrackerFactory::GetInstance());
@@ -64,7 +69,13 @@ HostContentSettingsMapFactory::HostContentSettingsMapFactory()
#endif
DependsOn(OneTimePermissionsTrackerFactory::GetInstance());
#if BUILDFLAG(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_CEF)
+ if (!cef::IsAlloyRuntimeEnabled() || extensions::ExtensionsEnabled()) {
@ -35,7 +35,7 @@ index 6f842a7535a56..faaee032e82bd 100644
#endif
// Used by way of ShouldRestoreOldSessionCookies().
#if BUILDFLAG(ENABLE_SESSION_SERVICE)
@@ -132,6 +143,9 @@ scoped_refptr<RefcountedKeyedService>
@@ -118,6 +129,9 @@ scoped_refptr<RefcountedKeyedService>
std::move(allowlist_provider));
#if BUILDFLAG(ENABLE_EXTENSIONS)
@ -45,7 +45,7 @@ index 6f842a7535a56..faaee032e82bd 100644
// These must be registered before before the HostSettings are passed over to
// the IOThread. Simplest to do this on construction.
settings_map->RegisterProvider(
@@ -144,6 +158,9 @@ scoped_refptr<RefcountedKeyedService>
@@ -130,6 +144,9 @@ scoped_refptr<RefcountedKeyedService>
// the case where profile->IsOffTheRecord() is true? And what is the
// interaction with profile->IsGuestSession()?
false));
@ -56,10 +56,10 @@ index 6f842a7535a56..faaee032e82bd 100644
#if BUILDFLAG(ENABLE_SUPERVISED_USERS)
supervised_user::SupervisedUserSettingsService* supervised_service =
diff --git components/content_settings/renderer/content_settings_agent_impl.cc components/content_settings/renderer/content_settings_agent_impl.cc
index c62382c00a48b..a560eafc3ec80 100644
index 54c18d58aea64..66d3721a392ec 100644
--- components/content_settings/renderer/content_settings_agent_impl.cc
+++ components/content_settings/renderer/content_settings_agent_impl.cc
@@ -145,7 +145,7 @@ ContentSetting GetContentSettingFromRules(
@@ -143,7 +143,7 @@ ContentSetting GetContentSettingFromRules(
return rule.GetContentSetting();
}
}

View File

@ -1,8 +1,8 @@
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 331f5dc64de39..803b471e9764a 100644
index 5ebec17f77393..f94c18f8de78e 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -355,6 +355,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
@@ -360,6 +360,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
return callback.get();
}
@ -16,7 +16,7 @@ index 331f5dc64de39..803b471e9764a 100644
enum class UmaEnumIdLookupType {
GeneralEnumId,
ContextSpecificEnumId,
@@ -609,6 +616,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
@@ -616,6 +623,10 @@ int FindUMAEnumValueForCommand(int id, UmaEnumIdLookupType type) {
if (ContextMenuMatcher::IsExtensionsCustomCommandId(id))
return 1;
@ -27,7 +27,7 @@ index 331f5dc64de39..803b471e9764a 100644
id = CollapseCommandsForUMA(id);
const auto& map = GetIdcToUmaMap(type);
auto it = map.find(id);
@@ -833,6 +844,14 @@ RenderViewContextMenu::RenderViewContextMenu(
@@ -857,6 +868,14 @@ RenderViewContextMenu::RenderViewContextMenu(
pdf_ocr_submenu_model_ = std::make_unique<ui::SimpleMenuModel>(this);
#endif // BUILDFLAG(ENABLE_SCREEN_AI_SERVICE)
@ -42,7 +42,7 @@ index 331f5dc64de39..803b471e9764a 100644
observers_.AddObserver(&autofill_context_menu_manager_);
}
@@ -1300,6 +1319,12 @@ void RenderViewContextMenu::InitMenu() {
@@ -1331,6 +1350,12 @@ void RenderViewContextMenu::InitMenu() {
autofill::PopupHidingReason::kContextMenuOpened);
}
}
@ -55,7 +55,7 @@ index 331f5dc64de39..803b471e9764a 100644
}
Profile* RenderViewContextMenu::GetProfile() const {
@@ -3452,6 +3477,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
@@ -3515,6 +3540,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
execute_plugin_action_callback_ = std::move(cb);
}
@ -69,10 +69,10 @@ index 331f5dc64de39..803b471e9764a 100644
RenderViewContextMenu::GetHandlersForLinkUrl() {
custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers =
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
index efd9049faacfd..8a75cdb0dfcfa 100644
index d8f1b10c18771..00702b672353d 100644
--- chrome/browser/renderer_context_menu/render_view_context_menu.h
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h
@@ -157,6 +157,12 @@ class RenderViewContextMenu
@@ -159,6 +159,12 @@ class RenderViewContextMenu
}
#endif
@ -85,7 +85,7 @@ index efd9049faacfd..8a75cdb0dfcfa 100644
protected:
Profile* GetProfile() const;
@@ -465,6 +471,9 @@ class RenderViewContextMenu
@@ -471,6 +477,9 @@ class RenderViewContextMenu
// built.
bool is_protocol_submenu_valid_ = false;
@ -96,7 +96,7 @@ index efd9049faacfd..8a75cdb0dfcfa 100644
// "Use enhanced spell check" items.
std::unique_ptr<SpellingMenuObserver> spelling_suggestions_menu_observer_;
diff --git chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
index 18283c801689e..9838c25d6e584 100644
index c88a77a0b49e2..785ded198741e 100644
--- chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
+++ chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.cc
@@ -149,6 +149,9 @@ void RenderViewContextMenuViews::RunMenuAt(views::Widget* parent,
@ -110,10 +110,10 @@ index 18283c801689e..9838c25d6e584 100644
// that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do.
switch (command_id) {
diff --git components/renderer_context_menu/render_view_context_menu_base.cc components/renderer_context_menu/render_view_context_menu_base.cc
index ffe4002bc8ca3..b179f39ebdd59 100644
index ad4f00959e98b..54368373a6a99 100644
--- components/renderer_context_menu/render_view_context_menu_base.cc
+++ components/renderer_context_menu/render_view_context_menu_base.cc
@@ -382,6 +382,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const {
@@ -374,6 +374,17 @@ bool RenderViewContextMenuBase::IsCommandIdChecked(int id) const {
return false;
}
@ -132,7 +132,7 @@ index ffe4002bc8ca3..b179f39ebdd59 100644
command_executed_ = true;
RecordUsedItem(id);
diff --git components/renderer_context_menu/render_view_context_menu_base.h components/renderer_context_menu/render_view_context_menu_base.h
index ce17ade37f154..89bbd8609e815 100644
index 6249528399f44..9c4dd0d8f0100 100644
--- components/renderer_context_menu/render_view_context_menu_base.h
+++ components/renderer_context_menu/render_view_context_menu_base.h
@@ -87,6 +87,9 @@ class RenderViewContextMenuBase : public ui::SimpleMenuModel::Delegate,

View File

@ -1,5 +1,5 @@
diff --git chrome/browser/file_select_helper.cc chrome/browser/file_select_helper.cc
index 391482bbfa815..0dbd682dd35a3 100644
index 25ccc6c633df5..7d439c4d9cc3c 100644
--- chrome/browser/file_select_helper.cc
+++ chrome/browser/file_select_helper.cc
@@ -20,6 +20,7 @@
@ -10,7 +10,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
#include "chrome/browser/browser_process.h"
#include "chrome/browser/enterprise/connectors/common.h"
#include "chrome/browser/platform_util.h"
@@ -258,6 +259,13 @@ void FileSelectHelper::OnListFile(
@@ -242,6 +243,13 @@ void FileSelectHelper::OnListFile(
void FileSelectHelper::LaunchConfirmationDialog(
const base::FilePath& path,
std::vector<ui::SelectedFileInfo> selected_files) {
@ -24,7 +24,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
ShowFolderUploadConfirmationDialog(
path,
base::BindOnce(&FileSelectHelper::ConvertToFileChooserFileInfoList, this),
@@ -342,6 +350,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
@@ -326,6 +334,12 @@ void FileSelectHelper::PerformContentAnalysisIfNeeded(
if (AbortIfWebContentsDestroyed())
return;
@ -37,7 +37,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
#if BUILDFLAG(ENTERPRISE_CLOUD_CONTENT_ANALYSIS)
enterprise_connectors::ContentAnalysisDelegate::Data data;
if (enterprise_connectors::ContentAnalysisDelegate::IsEnabled(
@@ -472,7 +486,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() {
@@ -456,7 +470,8 @@ void FileSelectHelper::DontAbortOnMissingWebContentsForTesting() {
std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
FileSelectHelper::GetFileTypesFromAcceptType(
@ -47,7 +47,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
auto base_file_type = std::make_unique<ui::SelectFileDialog::FileTypeInfo>();
if (accept_types.empty())
return base_file_type;
@@ -485,17 +500,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -469,17 +484,24 @@ FileSelectHelper::GetFileTypesFromAcceptType(
std::vector<base::FilePath::StringType>* extensions =
&file_type->extensions.back();
@ -73,7 +73,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
} else {
if (!base::IsStringASCII(accept_type))
continue;
@@ -506,10 +528,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -490,10 +512,18 @@ FileSelectHelper::GetFileTypesFromAcceptType(
description_id = IDS_AUDIO_FILES;
else if (ascii_type == "video/*")
description_id = IDS_VIDEO_FILES;
@ -94,7 +94,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
if (extensions->size() > old_extension_size)
valid_type_count++;
}
@@ -534,6 +564,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -518,6 +548,15 @@ FileSelectHelper::GetFileTypesFromAcceptType(
l10n_util::GetStringUTF16(description_id));
}
@ -110,7 +110,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
return file_type;
}
@@ -541,7 +580,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
@@ -525,7 +564,8 @@ FileSelectHelper::GetFileTypesFromAcceptType(
void FileSelectHelper::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
@ -120,7 +120,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
Profile* profile = Profile::FromBrowserContext(
render_frame_host->GetProcess()->GetBrowserContext());
@@ -560,6 +600,7 @@ void FileSelectHelper::RunFileChooser(
@@ -544,6 +584,7 @@ void FileSelectHelper::RunFileChooser(
// message.
scoped_refptr<FileSelectHelper> file_select_helper(
new FileSelectHelper(profile));
@ -128,7 +128,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
file_select_helper->RunFileChooser(render_frame_host, std::move(listener),
params.Clone());
}
@@ -611,7 +652,8 @@ void FileSelectHelper::RunFileChooser(
@@ -595,7 +636,8 @@ void FileSelectHelper::RunFileChooser(
}
void FileSelectHelper::GetFileTypesInThreadPool(FileChooserParamsPtr params) {
@ -139,7 +139,7 @@ index 391482bbfa815..0dbd682dd35a3 100644
params->need_local_path ? ui::SelectFileDialog::FileTypeInfo::NATIVE_PATH
: ui::SelectFileDialog::FileTypeInfo::ANY_PATH;
diff --git chrome/browser/file_select_helper.h chrome/browser/file_select_helper.h
index 57dae0b3670ae..85eeda4cbaa5b 100644
index bd975f96585b8..abf0a24222ded 100644
--- chrome/browser/file_select_helper.h
+++ chrome/browser/file_select_helper.h
@@ -62,7 +62,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@ -152,7 +152,7 @@ index 57dae0b3670ae..85eeda4cbaa5b 100644
// Enumerates all the files in directory.
static void EnumerateDirectory(
@@ -268,7 +269,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@@ -262,7 +263,8 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// |accept_types| contains only valid lowercased MIME types or file extensions
// beginning with a period (.).
static std::unique_ptr<ui::SelectFileDialog::FileTypeInfo>
@ -162,7 +162,7 @@ index 57dae0b3670ae..85eeda4cbaa5b 100644
// Check the accept type is valid. It is expected to be all lower case with
// no whitespace.
@@ -329,6 +331,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
@@ -323,6 +325,9 @@ class FileSelectHelper : public base::RefCountedThreadSafe<
// Set to false in unit tests since there is no WebContents.
bool abort_on_missing_web_contents_in_tests_ = true;
@ -238,10 +238,10 @@ index 9361287ac3411..59567b485bf99 100644
paths.push_back(std::move(path));
}
diff --git ui/shell_dialogs/select_file_dialog.cc ui/shell_dialogs/select_file_dialog.cc
index e2c00b2ec1532..a2e8753766597 100644
index 68dd62159b686..e94831cd44a2d 100644
--- ui/shell_dialogs/select_file_dialog.cc
+++ ui/shell_dialogs/select_file_dialog.cc
@@ -88,8 +88,10 @@ void SelectFileDialog::SetFactory(
@@ -73,8 +73,10 @@ void SelectFileDialog::SetFactory(
// static
scoped_refptr<SelectFileDialog> SelectFileDialog::Create(
Listener* listener,
@ -255,10 +255,10 @@ index e2c00b2ec1532..a2e8753766597 100644
return CreateSelectFileDialog(listener, std::move(policy));
}
diff --git ui/shell_dialogs/select_file_dialog.h ui/shell_dialogs/select_file_dialog.h
index 65f0342389117..c4b79bc0dab91 100644
index 9b12fae59c3cc..dfb534a6f06e6 100644
--- ui/shell_dialogs/select_file_dialog.h
+++ ui/shell_dialogs/select_file_dialog.h
@@ -116,7 +116,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
@@ -102,7 +102,8 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
// is refcounted and uses a background thread.
static scoped_refptr<SelectFileDialog> Create(
Listener* listener,
@ -268,7 +268,7 @@ index 65f0342389117..c4b79bc0dab91 100644
SelectFileDialog(const SelectFileDialog&) = delete;
SelectFileDialog& operator=(const SelectFileDialog&) = delete;
@@ -213,6 +214,19 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
@@ -199,6 +200,19 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
const GURL* caller = nullptr);
bool HasMultipleFileTypeChoices();
@ -288,7 +288,7 @@ index 65f0342389117..c4b79bc0dab91 100644
protected:
friend class base::RefCountedThreadSafe<SelectFileDialog>;
@@ -238,6 +252,11 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
@@ -224,6 +238,11 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
// The listener to be notified of selection completion.
raw_ptr<Listener> listener_;
@ -300,7 +300,7 @@ index 65f0342389117..c4b79bc0dab91 100644
private:
// Tests if the file selection dialog can be displayed by
// testing if the AllowFileSelectionDialogs-Policy is
@@ -250,8 +269,6 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
@@ -236,8 +255,6 @@ class SHELL_DIALOGS_EXPORT SelectFileDialog
// Returns true if the dialog has multiple file type choices.
virtual bool HasMultipleFileTypeChoicesImpl() = 0;
@ -323,10 +323,10 @@ index c7acd9b05fbb8..3e95e4125fa24 100644
} // namespace ui
diff --git ui/shell_dialogs/select_file_dialog_mac.mm ui/shell_dialogs/select_file_dialog_mac.mm
index 0b8aaa3c0e4f0..fe01d3db2eabe 100644
index bf99047fa53cf..0efdb76233331 100644
--- ui/shell_dialogs/select_file_dialog_mac.mm
+++ ui/shell_dialogs/select_file_dialog_mac.mm
@@ -102,6 +102,10 @@ void SelectFileDialogImpl::SelectFileImpl(
@@ -107,6 +107,10 @@ void SelectFileDialogImpl::SelectFileImpl(
mojo_window->CreateSelectFileDialog(std::move(receiver));
} else {
NSWindow* ns_window = gfx_window.GetNativeNSWindow();
@ -338,10 +338,10 @@ index 0b8aaa3c0e4f0..fe01d3db2eabe 100644
std::make_unique<remote_cocoa::SelectFileDialogBridge>(ns_window),
std::move(receiver));
diff --git ui/shell_dialogs/select_file_dialog_win.cc ui/shell_dialogs/select_file_dialog_win.cc
index 04aa920d91675..93ea4988839cf 100644
index cb1a0d203b448..307158e8117fe 100644
--- ui/shell_dialogs/select_file_dialog_win.cc
+++ ui/shell_dialogs/select_file_dialog_win.cc
@@ -252,6 +252,8 @@ void SelectFileDialogImpl::SelectFileImpl(
@@ -253,6 +253,8 @@ void SelectFileDialogImpl::SelectFileImpl(
HWND owner = owning_window && owning_window->GetRootWindow()
? owning_window->GetHost()->GetAcceleratedWidget()
: nullptr;

View File

@ -12,7 +12,7 @@ index b169371e4d42f..509e4bda85b47 100644
// on the screen, we can't actually attach to it.
parent_window = nullptr;
diff --git components/constrained_window/constrained_window_views.cc components/constrained_window/constrained_window_views.cc
index 9e07412327ce9..3ac78725eba18 100644
index 3daf40d463e32..dc3712bf6dc89 100644
--- components/constrained_window/constrained_window_views.cc
+++ components/constrained_window/constrained_window_views.cc
@@ -105,15 +105,24 @@ void UpdateModalDialogPosition(views::Widget* widget,
@ -91,7 +91,7 @@ index 9e07412327ce9..3ac78725eba18 100644
}
} // namespace
@@ -224,7 +219,8 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
@@ -234,7 +229,8 @@ views::Widget* CreateWebModalDialogViews(views::WidgetDelegate* dialog,
views::Widget* widget = views::DialogDelegate::CreateDialogWidget(
dialog, nullptr,
@ -101,7 +101,7 @@ index 9e07412327ce9..3ac78725eba18 100644
widget->SetNativeWindowProperty(
views::kWidgetIdentifierKey,
const_cast<void*>(kConstrainedWindowWidgetIdentifier));
@@ -246,8 +242,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -256,8 +252,13 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
gfx::NativeView parent_view =
parent ? CurrentClient()->GetDialogHostView(parent) : nullptr;
@ -116,7 +116,7 @@ index 9e07412327ce9..3ac78725eba18 100644
widget->SetNativeWindowProperty(
views::kWidgetIdentifierKey,
const_cast<void*>(kConstrainedWindowWidgetIdentifier));
@@ -263,8 +264,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
@@ -273,8 +274,7 @@ views::Widget* CreateBrowserModalDialogViews(views::DialogDelegate* dialog,
if (!requires_positioning)
return widget;
@ -170,7 +170,7 @@ index 51ed6bcf6b540..c6e1161140655 100644
virtual gfx::Point GetDialogPosition(const gfx::Size& size) = 0;
// Returns whether a dialog currently about to be shown should be activated.
diff --git ui/views/window/dialog_delegate.cc ui/views/window/dialog_delegate.cc
index 89942cb82dee4..ce30f3bb93fc0 100644
index ed132b017f10e..590ab9760c36a 100644
--- ui/views/window/dialog_delegate.cc
+++ ui/views/window/dialog_delegate.cc
@@ -60,10 +60,12 @@ DialogDelegate::DialogDelegate() {
@ -239,7 +239,7 @@ index 89942cb82dee4..ce30f3bb93fc0 100644
// Web-modal (ui::MODAL_TYPE_CHILD) dialogs with parents are marked as child
// widgets to prevent top-level window behavior (independent movement, etc).
diff --git ui/views/window/dialog_delegate.h ui/views/window/dialog_delegate.h
index 083874eb3f0bc..2ccacfca7d413 100644
index d0bd746875ed9..1643e6d841108 100644
--- ui/views/window/dialog_delegate.h
+++ ui/views/window/dialog_delegate.h
@@ -96,13 +96,18 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {

View File

@ -33,7 +33,7 @@ index a5ee05ae5f5e9..97fd2e8da450e 100644
~BrowserFrameMac() override;
diff --git chrome/browser/ui/views/frame/browser_frame_mac.mm chrome/browser/ui/views/frame/browser_frame_mac.mm
index 1473ed154f906..bf861087fe292 100644
index 24b68406431ce..5d58296a7a7f4 100644
--- chrome/browser/ui/views/frame/browser_frame_mac.mm
+++ chrome/browser/ui/views/frame/browser_frame_mac.mm
@@ -182,7 +182,14 @@ void BrowserFrameMac::OnWindowFullscreenTransitionComplete() {

View File

@ -44,7 +44,7 @@ index ea1467d09700d..5537a99500e7f 100644
base::FeatureList::IsEnabled(
features::kPeriodicSyncPermissionForDefaultSearchEngine) &&
diff --git chrome/browser/permissions/chrome_permissions_client.cc chrome/browser/permissions/chrome_permissions_client.cc
index c26bff9382b26..8c93b7b8351c7 100644
index 58b162e099e70..2dcfe0cda550a 100644
--- chrome/browser/permissions/chrome_permissions_client.cc
+++ chrome/browser/permissions/chrome_permissions_client.cc
@@ -14,6 +14,7 @@
@ -55,7 +55,7 @@ index c26bff9382b26..8c93b7b8351c7 100644
#include "chrome/browser/bluetooth/bluetooth_chooser_context_factory.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -186,6 +187,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker(
@@ -187,6 +188,9 @@ ChromePermissionsClient::GetPermissionDecisionAutoBlocker(
double ChromePermissionsClient::GetSiteEngagementScore(
content::BrowserContext* browser_context,
const GURL& origin) {
@ -65,7 +65,7 @@ index c26bff9382b26..8c93b7b8351c7 100644
return site_engagement::SiteEngagementService::Get(
Profile::FromBrowserContext(browser_context))
->GetScore(origin);
@@ -350,8 +354,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors(
@@ -358,8 +362,10 @@ ChromePermissionsClient::CreatePermissionUiSelectors(
std::make_unique<ContextualNotificationPermissionUiSelector>());
selectors.emplace_back(std::make_unique<PrefBasedQuietPermissionUiSelector>(
Profile::FromBrowserContext(browser_context)));
@ -77,7 +77,7 @@ index c26bff9382b26..8c93b7b8351c7 100644
}
diff --git chrome/browser/permissions/permission_manager_factory.cc chrome/browser/permissions/permission_manager_factory.cc
index b0374f3adafea..faf9e7102f571 100644
index f020355c1969d..ff3c3e26b14bf 100644
--- chrome/browser/permissions/permission_manager_factory.cc
+++ chrome/browser/permissions/permission_manager_factory.cc
@@ -6,6 +6,7 @@
@ -88,7 +88,7 @@ index b0374f3adafea..faf9e7102f571 100644
#include "chrome/browser/background_fetch/background_fetch_permission_context.h"
#include "chrome/browser/background_sync/periodic_background_sync_permission_context.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
@@ -56,8 +57,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
@@ -61,8 +62,10 @@ permissions::PermissionManager::PermissionContextMap CreatePermissionContexts(
std::make_unique<GeolocationPermissionContextDelegate>(profile);
#endif // BUILDFLAG(IS_ANDROID)
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
@ -142,10 +142,10 @@ index fbce13c16ad10..0512b2f09937e 100644
std::unique_ptr<permissions::PermissionPrompt> CreatePermissionPrompt(
content::WebContents* web_contents,
diff --git chrome/browser/ui/views/permissions/permission_prompt_factory.cc chrome/browser/ui/views/permissions/permission_prompt_factory.cc
index 3a4d21b89411f..75673d62f5738 100644
index 3a1224da26b6c..24735fe79498d 100644
--- chrome/browser/ui/views/permissions/permission_prompt_factory.cc
+++ chrome/browser/ui/views/permissions/permission_prompt_factory.cc
@@ -173,11 +173,28 @@ std::unique_ptr<permissions::PermissionPrompt> CreateQuietPrompt(
@@ -181,11 +181,28 @@ std::unique_ptr<permissions::PermissionPrompt> CreateQuietPrompt(
}
}
@ -175,7 +175,7 @@ index 3a4d21b89411f..75673d62f5738 100644
if (!browser) {
DLOG(WARNING) << "Permission prompt suppressed because the WebContents is "
diff --git components/embedder_support/permission_context_utils.cc components/embedder_support/permission_context_utils.cc
index 07f3c7c86b22d..110e48d59a75a 100644
index 402fe1588c459..091625f54b340 100644
--- components/embedder_support/permission_context_utils.cc
+++ components/embedder_support/permission_context_utils.cc
@@ -5,6 +5,7 @@
@ -186,7 +186,7 @@ index 07f3c7c86b22d..110e48d59a75a 100644
#include "components/background_sync/background_sync_permission_context.h"
#include "components/permissions/contexts/accessibility_permission_context.h"
#include "components/permissions/contexts/camera_pan_tilt_zoom_permission_context.h"
@@ -77,12 +78,19 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context,
@@ -77,10 +78,17 @@ CreateDefaultPermissionContexts(content::BrowserContext* browser_context,
std::move(delegates.geolocation_permission_context_delegate),
is_regular_profile);
#elif BUILDFLAG(IS_MAC) || BUILDFLAG(IS_CHROMEOS)
@ -196,12 +196,10 @@ index 07f3c7c86b22d..110e48d59a75a 100644
+ browser_context,
+ std::move(delegates.geolocation_permission_context_delegate));
+ } else {
DCHECK(delegates.geolocation_manager);
permission_contexts[ContentSettingsType::GEOLOCATION] =
std::make_unique<permissions::GeolocationPermissionContextSystem>(
browser_context,
std::move(delegates.geolocation_permission_context_delegate),
delegates.geolocation_manager);
std::move(delegates.geolocation_permission_context_delegate));
+ }
#else
permission_contexts[ContentSettingsType::GEOLOCATION] =

View File

@ -33,18 +33,18 @@ index 10085136f52ce..ec1be9babecc2 100644
}
diff --git chrome/browser/policy/browser_dm_token_storage_mac.mm chrome/browser/policy/browser_dm_token_storage_mac.mm
index 5cb3cff75871c..51333ff7d85e2 100644
index 27af6ec08f593..6dfab7c74e8da 100644
--- chrome/browser/policy/browser_dm_token_storage_mac.mm
+++ chrome/browser/policy/browser_dm_token_storage_mac.mm
@@ -26,6 +26,7 @@
@@ -27,6 +27,7 @@
#include "base/syslog_logging.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
+#include "chrome/browser/policy/chrome_browser_policy_connector.h"
#include "chrome/common/chrome_paths.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
@@ -47,11 +48,6 @@
namespace policy {
@@ -47,11 +48,6 @@ const char kEnrollmentOptionsFilePath[] = FILE_PATH_LITERAL(
"/Library/Google/Chrome/CloudManagementEnrollmentOptions");
const char kEnrollmentMandatoryOption[] = "Mandatory";
@ -85,7 +85,7 @@ index 5cb3cff75871c..51333ff7d85e2 100644
@@ -138,12 +141,19 @@ bool GetEnrollmentTokenFromFile(std::string* enrollment_token) {
}
absl::optional<bool> IsEnrollmentMandatoryByPolicy() {
std::optional<bool> IsEnrollmentMandatoryByPolicy() {
+ base::apple::ScopedCFTypeRef<CFStringRef> bundle_id_scoper(
+ ChromeBrowserPolicyConnector::GetBundleId());
+ CFStringRef bundle_id = bundle_id_scoper.get();
@ -101,11 +101,11 @@ index 5cb3cff75871c..51333ff7d85e2 100644
if (!value || !CFPreferencesAppValueIsForced(
- kEnrollmentMandatoryOptionPolicyName, kBundleId)) {
+ kEnrollmentMandatoryOptionPolicyName, bundle_id)) {
return absl::optional<bool>();
return std::optional<bool>();
}
diff --git chrome/browser/policy/chrome_browser_policy_connector.cc chrome/browser/policy/chrome_browser_policy_connector.cc
index c012642290973..3f4d1be7f2092 100644
index c2ecd1b63f0d7..c83704788a803 100644
--- chrome/browser/policy/chrome_browser_policy_connector.cc
+++ chrome/browser/policy/chrome_browser_policy_connector.cc
@@ -13,11 +13,14 @@
@ -135,7 +135,7 @@ index c012642290973..3f4d1be7f2092 100644
} // namespace
ChromeBrowserPolicyConnector::ChromeBrowserPolicyConnector()
@@ -265,6 +273,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() {
@@ -270,6 +278,73 @@ void ChromeBrowserPolicyConnector::EnableCommandLineSupportForTesting() {
g_command_line_enabled_for_testing = true;
}
@ -209,7 +209,7 @@ index c012642290973..3f4d1be7f2092 100644
base::flat_set<std::string>
ChromeBrowserPolicyConnector::device_affiliation_ids() const {
#if BUILDFLAG(IS_CHROMEOS_LACROS)
@@ -336,23 +411,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() {
@@ -341,23 +416,22 @@ ChromeBrowserPolicyConnector::CreatePolicyProviders() {
std::unique_ptr<ConfigurationPolicyProvider>
ChromeBrowserPolicyConnector::CreatePlatformProvider() {
#if BUILDFLAG(IS_WIN)
@ -242,7 +242,7 @@ index c012642290973..3f4d1be7f2092 100644
auto loader = std::make_unique<PolicyLoaderMac>(
base::ThreadPool::CreateSequencedTaskRunner(
{base::MayBlock(), base::TaskPriority::BEST_EFFORT}),
@@ -362,7 +436,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() {
@@ -367,7 +441,7 @@ ChromeBrowserPolicyConnector::CreatePlatformProvider() {
std::move(loader));
#elif BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_ANDROID)
base::FilePath config_dir_path;
@ -252,7 +252,7 @@ index c012642290973..3f4d1be7f2092 100644
// If the folder containing the policy files doesn't exist, there's no need
// to have a provider for them. Note that in verified boot, the folder
diff --git chrome/browser/policy/chrome_browser_policy_connector.h chrome/browser/policy/chrome_browser_policy_connector.h
index daa1a4cf0820d..c33db32822fbf 100644
index f6147bc3c59a6..78b1170dd52bb 100644
--- chrome/browser/policy/chrome_browser_policy_connector.h
+++ chrome/browser/policy/chrome_browser_policy_connector.h
@@ -28,6 +28,10 @@
@ -266,7 +266,7 @@ index daa1a4cf0820d..c33db32822fbf 100644
class PrefService;
namespace policy {
@@ -122,6 +126,25 @@ class ChromeBrowserPolicyConnector : public BrowserPolicyConnector {
@@ -125,6 +129,25 @@ class ChromeBrowserPolicyConnector : public BrowserPolicyConnector {
static void EnableCommandLineSupportForTesting();
@ -304,7 +304,7 @@ index 1a2e78c3472ec..5d1bd95a15113 100644
#include "components/policy/policy_constants.h"
namespace policy::path_parser {
@@ -97,16 +98,12 @@
@@ -97,16 +98,12 @@ base::FilePath::StringType ExpandPathVariables(
void CheckUserDataDirPolicy(base::FilePath* user_data_dir) {
// Since the configuration management infrastructure is not initialized when
// this code runs, read the policy preference directly.
@ -355,10 +355,10 @@ index 8dbf958c189dd..6eaccc6688eca 100644
*dir = base::FilePath(policy::path_parser::ExpandPathVariables(value));
return true;
diff --git chrome/common/chrome_paths.cc chrome/common/chrome_paths.cc
index 89678edacdadf..821c4448a8188 100644
index 94843ce782e80..0e3cc5bdb0bd5 100644
--- chrome/common/chrome_paths.cc
+++ chrome/common/chrome_paths.cc
@@ -523,7 +523,8 @@ bool PathProvider(int key, base::FilePath* result) {
@@ -539,7 +539,8 @@ bool PathProvider(int key, base::FilePath* result) {
return false;
}
break;
@ -369,7 +369,7 @@ index 89678edacdadf..821c4448a8188 100644
cur = base::FilePath(policy::kPolicyPath);
break;
diff --git chrome/common/chrome_paths.h chrome/common/chrome_paths.h
index 03387b9680834..76191ba98e80b 100644
index 4cde94111918e..aaf8245abd9a6 100644
--- chrome/common/chrome_paths.h
+++ chrome/common/chrome_paths.h
@@ -8,6 +8,7 @@
@ -380,7 +380,7 @@ index 03387b9680834..76191ba98e80b 100644
#include "extensions/buildflags/buildflags.h"
#include "third_party/widevine/cdm/buildflags.h"
@@ -47,7 +48,7 @@ enum {
@@ -48,7 +49,7 @@ enum {
DIR_INTERNAL_PLUGINS, // Directory where internal plugins reside.
DIR_COMPONENTS, // Directory where built-in implementations of
// component-updated libraries or data reside.
@ -390,10 +390,10 @@ index 03387b9680834..76191ba98e80b 100644
// policy files that allow sys-admins
// to set policies for chrome. This directory
diff --git components/policy/tools/generate_policy_source.py components/policy/tools/generate_policy_source.py
index a17b30c37e07a..adcdf25e38ed1 100755
index d225da88a04fb..191bb6b56df40 100755
--- components/policy/tools/generate_policy_source.py
+++ components/policy/tools/generate_policy_source.py
@@ -486,6 +486,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups,
@@ -448,6 +448,7 @@ def _WritePolicyConstantHeader(all_policies, policy_atomic_groups,
#include <cstdint>
#include <string>
@ -401,7 +401,7 @@ index a17b30c37e07a..adcdf25e38ed1 100755
#include "components/policy/core/common/policy_details.h"
#include "components/policy/core/common/policy_map.h"
@@ -508,9 +509,11 @@ struct SchemaData;
@@ -470,9 +471,11 @@ struct SchemaData;
''')
if target_platform == 'win':
@ -415,7 +415,7 @@ index a17b30c37e07a..adcdf25e38ed1 100755
f.write('''#if BUILDFLAG(IS_CHROMEOS)
// Sets default profile policies values for enterprise users.
@@ -1153,12 +1156,14 @@ namespace policy {
@@ -1115,12 +1118,14 @@ namespace policy {
f.write('} // namespace\n\n')
if target_platform == 'win':

View File

@ -14,7 +14,7 @@ index 7ae18c5a960b0..d48ba838efe6f 100644
? profile_metrics::BrowserProfileType::kRegular
: profile_metrics::BrowserProfileType::kIncognito;
diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
index 9f1cb38d90303..986ac5ed9bdaf 100644
index 826fa20afbb56..f08891c4aaa0d 100644
--- chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
+++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
@@ -31,7 +31,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog(
@ -44,7 +44,7 @@ index caa20ec03434a..2a3ca921445c1 100644
avatar_toolbar_button, GetBrowser().profile(), type);
DCHECK_EQ(nullptr, bubble_tracker_.view());
diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc
index f5f266328283d..672609d94d1b7 100644
index 3e46e2ce50219..ce905695bfe18 100644
--- chrome/browser/ui/views/profiles/incognito_menu_view.cc
+++ chrome/browser/ui/views/profiles/incognito_menu_view.cc
@@ -36,7 +36,9 @@
@ -59,7 +59,7 @@ index f5f266328283d..672609d94d1b7 100644
base::RecordAction(base::UserMetricsAction("IncognitoMenu_Show"));
diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
index 9945ca59efde6..1a071f42bb538 100644
index 38e38d6eabc85..0856ae8d5f5ff 100644
--- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
+++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
@@ -56,7 +56,9 @@ void ProfileMenuCoordinator::Show(bool is_source_accelerator) {

View File

@ -14,10 +14,10 @@ index 9bba6cea235e0..9dc5b40559207 100644
}
diff --git chrome/browser/profiles/profile.cc chrome/browser/profiles/profile.cc
index 94f17d4c532c4..e9605b415a5aa 100644
index 28b166f4f499c..5892638bb43c8 100644
--- chrome/browser/profiles/profile.cc
+++ chrome/browser/profiles/profile.cc
@@ -88,6 +88,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky
@@ -87,6 +87,7 @@ base::LazyInstance<std::set<content::BrowserContext*>>::Leaky
namespace {
@ -25,7 +25,7 @@ index 94f17d4c532c4..e9605b415a5aa 100644
const char kDevToolsOTRProfileIDPrefix[] = "Devtools::BrowserContext";
const char kMediaRouterOTRProfileIDPrefix[] = "MediaRouter::Presentation";
const char kTestOTRProfileIDPrefix[] = "Test::OTR";
@@ -108,6 +109,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const {
@@ -107,6 +108,8 @@ bool Profile::OTRProfileID::AllowsBrowserWindows() const {
// DevTools::BrowserContext, MediaRouter::Presentation, and
// CaptivePortal::Signin are exceptions to this ban.
if (*this == PrimaryID() ||
@ -34,7 +34,7 @@ index 94f17d4c532c4..e9605b415a5aa 100644
base::StartsWith(profile_id_, kDevToolsOTRProfileIDPrefix,
base::CompareCase::SENSITIVE) ||
base::StartsWith(profile_id_, kMediaRouterOTRProfileIDPrefix,
@@ -145,6 +148,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique(
@@ -144,6 +147,16 @@ Profile::OTRProfileID Profile::OTRProfileID::CreateUnique(
base::Uuid::GenerateRandomV4().AsLowercaseString().c_str()));
}
@ -52,10 +52,10 @@ index 94f17d4c532c4..e9605b415a5aa 100644
Profile::OTRProfileID Profile::OTRProfileID::CreateUniqueForDevTools() {
return CreateUnique(kDevToolsOTRProfileIDPrefix);
diff --git chrome/browser/profiles/profile.h chrome/browser/profiles/profile.h
index 52eb459e9deba..11a92e9e5cfdc 100644
index 4bf4b36f01890..b8a966db377db 100644
--- chrome/browser/profiles/profile.h
+++ chrome/browser/profiles/profile.h
@@ -104,6 +104,10 @@ class Profile : public content::BrowserContext {
@@ -103,6 +103,10 @@ class Profile : public content::BrowserContext {
// be applicable to run. Please see crbug.com/1098697#c3 for more details.
static OTRProfileID CreateUnique(const std::string& profile_id_prefix);
@ -66,7 +66,7 @@ index 52eb459e9deba..11a92e9e5cfdc 100644
// Creates a unique OTR profile id to be used for DevTools browser contexts.
static OTRProfileID CreateUniqueForDevTools();
@@ -521,6 +525,8 @@ class Profile : public content::BrowserContext {
@@ -522,6 +526,8 @@ class Profile : public content::BrowserContext {
return instant_service_;
}
@ -75,7 +75,7 @@ index 52eb459e9deba..11a92e9e5cfdc 100644
protected:
// Creates an OffTheRecordProfile which points to this Profile.
static std::unique_ptr<Profile> CreateOffTheRecordProfile(
@@ -532,7 +538,6 @@ class Profile : public content::BrowserContext {
@@ -533,7 +539,6 @@ class Profile : public content::BrowserContext {
static PrefStore* CreateExtensionPrefStore(Profile*,
bool incognito_pref_store);
@ -84,10 +84,10 @@ index 52eb459e9deba..11a92e9e5cfdc 100644
// Returns whether the user has signed in this profile to an account.
diff --git chrome/browser/profiles/profile_impl.cc chrome/browser/profiles/profile_impl.cc
index 52a5f08810e85..ce21b2ea52f06 100644
index c70593cc14b9d..df5ba6a9432da 100644
--- chrome/browser/profiles/profile_impl.cc
+++ chrome/browser/profiles/profile_impl.cc
@@ -1034,7 +1034,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
@@ -1020,7 +1020,9 @@ Profile* ProfileImpl::GetOffTheRecordProfile(const OTRProfileID& otr_profile_id,
otr_profiles_[otr_profile_id] = std::move(otr_profile);
@ -99,10 +99,10 @@ index 52a5f08810e85..ce21b2ea52f06 100644
return raw_otr_profile;
}
diff --git chrome/browser/profiles/profile_manager.cc chrome/browser/profiles/profile_manager.cc
index 861f7d92b35c3..996ae52dcdaab 100644
index 2b7782afe7506..ed52e68ebdc91 100644
--- chrome/browser/profiles/profile_manager.cc
+++ chrome/browser/profiles/profile_manager.cc
@@ -438,7 +438,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
@@ -439,7 +439,7 @@ ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
profile_manager_android_ = std::make_unique<ProfileManagerAndroid>(this);
#endif
@ -112,7 +112,7 @@ index 861f7d92b35c3..996ae52dcdaab 100644
zombie_metrics_timer_.Start(FROM_HERE, base::Minutes(30), this,
diff --git chrome/browser/profiles/profile_manager.h chrome/browser/profiles/profile_manager.h
index f1530f47eebf0..a41dcf65d9f11 100644
index 3d5fd0d5ca858..965ab69b3fe8f 100644
--- chrome/browser/profiles/profile_manager.h
+++ chrome/browser/profiles/profile_manager.h
@@ -134,7 +134,7 @@ class ProfileManager : public Profile::Delegate {

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