Update to Chromium version 117.0.5895.0 (#1171312)

This commit is contained in:
Marshall Greenblatt
2023-07-20 18:11:34 -04:00
parent 1353677a98
commit 8b46735b79
78 changed files with 489 additions and 476 deletions

View File

@@ -21,7 +21,6 @@
#include "base/logging.h"
#include "base/strings/string_util.h"
#include "chrome/browser/font_family_cache.h"
#include "chrome/browser/media/media_device_id_salt.h"
#include "chrome/browser/permissions/permission_manager_factory.h"
#include "chrome/browser/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/profiles/profile_key.h"
@@ -190,8 +189,6 @@ void AlloyBrowserContext::Initialize() {
}
ChromePluginServiceFilter::GetInstance()->RegisterProfile(this);
media_device_id_salt_ = new MediaDeviceIDSalt(pref_service);
}
void AlloyBrowserContext::Shutdown() {
@@ -421,10 +418,6 @@ AlloyBrowserContext::GetReduceAcceptLanguageControllerDelegate() {
return ReduceAcceptLanguageFactory::GetForProfile(this);
}
std::string AlloyBrowserContext::GetMediaDeviceIDSalt() {
return media_device_id_salt_->GetSalt();
}
PrefService* AlloyBrowserContext::GetPrefs() {
return pref_service_.get();
}

View File

@@ -18,7 +18,6 @@
class CefDownloadManagerDelegate;
class CefSSLHostStateDelegate;
class CefVisitedLinkListener;
class MediaDeviceIDSalt;
class PrefService;
namespace extensions {
@@ -83,7 +82,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
override;
content::ReduceAcceptLanguageControllerDelegate*
GetReduceAcceptLanguageControllerDelegate() override;
std::string GetMediaDeviceIDSalt() override;
// Profile overrides.
ChromeZoomLevelPrefs* GetZoomLevelPrefs() override;
@@ -146,8 +144,6 @@ class AlloyBrowserContext : public ChromeProfileAlloy,
std::unique_ptr<DownloadPrefs> download_prefs_;
std::unique_ptr<content::ResourceContext> resource_context_;
scoped_refptr<MediaDeviceIDSalt> media_device_id_salt_;
};
#endif // CEF_LIBCEF_BROWSER_ALLOY_ALLOY_BROWSER_CONTEXT_H_

View File

@@ -43,6 +43,7 @@
#include "net/base/net_module.h"
#include "third_party/widevine/cdm/buildflags.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/color/color_provider_manager.h"
#include "ui/native_theme/native_theme.h"
#if BUILDFLAG(IS_LINUX)

View File

@@ -55,6 +55,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/profile_network_context_service_factory.h"
#include "chrome/browser/net/system_network_context_manager.h"
@@ -85,6 +86,7 @@
#include "components/content_settings/core/browser/cookie_settings.h"
#include "components/embedder_support/switches.h"
#include "components/embedder_support/user_agent_utils.h"
#include "components/media_device_salt/media_device_salt_service.h"
#include "components/pdf/browser/pdf_navigation_throttle.h"
#include "components/pdf/browser/pdf_url_loader_request_interceptor.h"
#include "components/pdf/browser/pdf_web_contents_helper.h"
@@ -567,8 +569,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
embedder_support::kUserAgent,
switches::kUserAgentProductAndVersion,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
}
const std::string& process_type =
@@ -586,8 +587,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
switches::kUncaughtExceptionStackSize,
network::switches::kUnsafelyTreatInsecureOriginAsSecure,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
if (extensions::ExtensionsEnabled()) {
content::RenderProcessHost* process =
@@ -615,8 +615,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kLang,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
}
// Necessary to populate DIR_USER_DATA in sub-processes.
@@ -642,8 +641,7 @@ void AlloyContentBrowserClient::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kLogFile,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
}
if (crash_reporting::Enabled()) {
@@ -1337,16 +1335,31 @@ AlloyContentBrowserClient::GetPluginMimeTypesWithExternalHandlers(
return mime_types;
}
bool AlloyContentBrowserClient::ArePersistentMediaDeviceIDsAllowed(
content::BrowserContext* browser_context,
const GURL& url,
void AlloyContentBrowserClient::GetMediaDeviceIDSalt(
content::RenderFrameHost* rfh,
const net::SiteForCookies& site_for_cookies,
const absl::optional<url::Origin>& top_frame_origin) {
const blink::StorageKey& storage_key,
base::OnceCallback<void(bool, const std::string&)> callback) {
GURL url = rfh->GetLastCommittedURL();
url::Origin top_frame_origin = rfh->GetMainFrame()->GetLastCommittedOrigin();
content::BrowserContext* browser_context = rfh->GetBrowserContext();
// Persistent MediaDevice IDs are allowed if cookies are allowed.
return CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context))
->IsFullCookieAccessAllowed(url, site_for_cookies, top_frame_origin,
net::CookieSettingOverrides());
scoped_refptr<content_settings::CookieSettings> cookie_settings =
CookieSettingsFactory::GetForProfile(
Profile::FromBrowserContext(browser_context));
bool allowed = cookie_settings->IsFullCookieAccessAllowed(
url, site_for_cookies, top_frame_origin,
cookie_settings->SettingOverridesForStorage());
auto* salt_service =
MediaDeviceSaltServiceFactory::GetInstance()->GetForBrowserContext(
browser_context);
if (!salt_service) {
std::move(callback).Run(allowed, browser_context->UniqueId());
return;
}
salt_service->GetSalt(base::BindOnce(std::move(callback), allowed));
}
void AlloyContentBrowserClient::OnWebContentsCreated(

View File

@@ -246,11 +246,11 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
blink::UserAgentMetadata GetUserAgentMetadata() override;
base::flat_set<std::string> GetPluginMimeTypesWithExternalHandlers(
content::BrowserContext* browser_context) override;
bool ArePersistentMediaDeviceIDsAllowed(
content::BrowserContext* browser_context,
const GURL& scope,
void GetMediaDeviceIDSalt(
content::RenderFrameHost* rfh,
const net::SiteForCookies& site_for_cookies,
const absl::optional<url::Origin>& top_frame_origin) override;
const blink::StorageKey& storage_key,
base::OnceCallback<void(bool, const std::string&)> callback) override;
void OnWebContentsCreated(content::WebContents* web_contents) override;
bool IsFindInPageDisabledForOrigin(const url::Origin& origin) override;

View File

@@ -421,3 +421,8 @@ HidSystemTrayIcon* ChromeBrowserProcessAlloy::hid_system_tray_icon() {
DCHECK(false);
return nullptr;
}
UsbSystemTrayIcon* ChromeBrowserProcessAlloy::usb_system_tray_icon() {
DCHECK(false);
return nullptr;
}

View File

@@ -109,6 +109,7 @@ class ChromeBrowserProcessAlloy : public BrowserProcess {
BuildState* GetBuildState() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidSystemTrayIcon* hid_system_tray_icon() override;
UsbSystemTrayIcon* usb_system_tray_icon() override;
private:
bool initialized_;

View File

@@ -8,6 +8,7 @@
#include "base/feature_list.h"
#include "chrome/browser/content_settings/cookie_settings_factory.h"
#include "chrome/browser/media/router/chrome_media_router_factory.h"
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
#include "chrome/browser/plugins/plugin_prefs_factory.h"
#include "chrome/browser/profiles/renderer_updater_factory.h"
#include "chrome/browser/reduce_accept_language/reduce_accept_language_factory.h"
@@ -24,6 +25,7 @@ namespace cef {
void EnsureBrowserContextKeyedServiceFactoriesBuilt() {
CookieSettingsFactory::GetInstance();
MediaDeviceSaltServiceFactory::GetInstance();
media_router::ChromeMediaRouterFactory::GetInstance();
PluginPrefsFactory::GetInstance();
PrefsTabHelper::GetServiceInstance();

View File

@@ -115,8 +115,7 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kUserAgentProductAndVersion,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
}
const std::string& process_type =
@@ -127,8 +126,7 @@ void ChromeContentBrowserClientCef::AppendExtraCommandLineSwitches(
static const char* const kSwitchNames[] = {
switches::kUncaughtExceptionStackSize,
};
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames,
std::size(kSwitchNames));
command_line->CopySwitchesFrom(*browser_cmd, kSwitchNames);
}
CefRefPtr<CefApp> app = CefAppManager::Get()->GetApplication();

View File

@@ -33,13 +33,11 @@ AppViewGuestDelegate* CefExtensionsAPIClient::CreateAppViewGuestDelegate()
}
std::unique_ptr<guest_view::GuestViewManagerDelegate>
CefExtensionsAPIClient::CreateGuestViewManagerDelegate(
content::BrowserContext* context) const {
CefExtensionsAPIClient::CreateGuestViewManagerDelegate() const {
// The GuestViewManager instance associated with the returned Delegate, which
// will be retrieved in the future via GuestViewManager::FromBrowserContext,
// will be associated with the CefBrowserContext.
return base::WrapUnique(
new extensions::ExtensionsGuestViewManagerDelegate(context));
return base::WrapUnique(new extensions::ExtensionsGuestViewManagerDelegate());
}
std::unique_ptr<MimeHandlerViewGuestDelegate>

View File

@@ -18,8 +18,7 @@ class CefExtensionsAPIClient : public ExtensionsAPIClient {
// ExtensionsAPIClient implementation.
AppViewGuestDelegate* CreateAppViewGuestDelegate() const override;
std::unique_ptr<guest_view::GuestViewManagerDelegate>
CreateGuestViewManagerDelegate(
content::BrowserContext* context) const override;
CreateGuestViewManagerDelegate() const override;
std::unique_ptr<MimeHandlerViewGuestDelegate>
CreateMimeHandlerViewGuestDelegate(
MimeHandlerViewGuest* guest) const override;

View File

@@ -20,6 +20,7 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/chrome_url_request_util.h"
#include "chrome/browser/extensions/event_router_forwarder.h"
#include "chrome/browser/media/webrtc/media_device_salt_service_factory.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
@@ -149,25 +150,21 @@ BrowserContext* CefExtensionsBrowserClient::GetOriginalContext(
}
content::BrowserContext*
CefExtensionsBrowserClient::GetRedirectedContextInIncognito(
CefExtensionsBrowserClient::GetContextRedirectedToOriginal(
content::BrowserContext* context,
bool force_guest_profile,
bool force_system_profile) {
bool force_guest_profile) {
return context;
}
content::BrowserContext*
CefExtensionsBrowserClient::GetContextForRegularAndIncognito(
content::BrowserContext* CefExtensionsBrowserClient::GetContextOwnInstance(
content::BrowserContext* context,
bool force_guest_profile,
bool force_system_profile) {
bool force_guest_profile) {
return context;
}
content::BrowserContext* CefExtensionsBrowserClient::GetRegularProfile(
content::BrowserContext* CefExtensionsBrowserClient::GetContextForOriginalOnly(
content::BrowserContext* context,
bool force_guest_profile,
bool force_system_profile) {
bool force_guest_profile) {
return context;
}
@@ -413,4 +410,11 @@ std::string CefExtensionsBrowserClient::GetApplicationLocale() {
return g_browser_process->GetApplicationLocale();
}
media_device_salt::MediaDeviceSaltService*
CefExtensionsBrowserClient::GetMediaDeviceSaltService(
content::BrowserContext* context) {
return MediaDeviceSaltServiceFactory::GetInstance()->GetForBrowserContext(
context);
}
} // namespace extensions

View File

@@ -39,18 +39,15 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
content::BrowserContext* context) override;
content::BrowserContext* GetOriginalContext(
content::BrowserContext* context) override;
content::BrowserContext* GetRedirectedContextInIncognito(
content::BrowserContext* GetContextRedirectedToOriginal(
content::BrowserContext* context,
bool force_guest_profile,
bool force_system_profile) override;
content::BrowserContext* GetContextForRegularAndIncognito(
bool force_guest_profile) override;
content::BrowserContext* GetContextOwnInstance(
content::BrowserContext* context,
bool force_guest_profile,
bool force_system_profile) override;
content::BrowserContext* GetRegularProfile(
bool force_guest_profile) override;
content::BrowserContext* GetContextForOriginalOnly(
content::BrowserContext* context,
bool force_guest_profile,
bool force_system_profile) override;
bool force_guest_profile) override;
bool IsGuestSession(content::BrowserContext* context) const override;
bool IsExtensionIncognitoEnabled(
const std::string& extension_id,
@@ -118,6 +115,8 @@ class CefExtensionsBrowserClient : public ExtensionsBrowserClient {
KioskDelegate* GetKioskDelegate() override;
bool IsLockScreenContext(content::BrowserContext* context) override;
std::string GetApplicationLocale() override;
media_device_salt::MediaDeviceSaltService* GetMediaDeviceSaltService(
content::BrowserContext* context) override;
private:
// Support for extension APIs.

View File

@@ -90,7 +90,7 @@ scoped_refptr<ui::PlatformCursor> ToPlatformCursor(
if (ui_cursor.type() == ui::mojom::CursorType::kCustom) {
platform_cursor = ui::CursorFactory::GetInstance()->CreateImageCursor(
ui::mojom::CursorType::kCustom, ui_cursor.custom_bitmap(),
ui_cursor.custom_hotspot());
ui_cursor.custom_hotspot(), ui_cursor.image_scale_factor());
} else {
cursor_loader.SetDisplay(GetDisplay(browser));

View File

@@ -9,7 +9,6 @@
#include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "base/memory/shared_memory_mapping.h"
#include "components/viz/common/resources/resource_format.h"
#include "components/viz/common/resources/resource_sizes.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h"

View File

@@ -213,14 +213,10 @@ cef_permission_request_types_t GetCefRequestType(
#endif
case permissions::RequestType::kRegisterProtocolHandler:
return CEF_PERMISSION_TYPE_REGISTER_PROTOCOL_HANDLER;
case permissions::RequestType::kSecurityAttestation:
return CEF_PERMISSION_TYPE_SECURITY_ATTESTATION;
case permissions::RequestType::kStorageAccess:
return CEF_PERMISSION_TYPE_STORAGE_ACCESS;
case permissions::RequestType::kTopLevelStorageAccess:
return CEF_PERMISSION_TYPE_TOP_LEVEL_STORAGE_ACCESS;
case permissions::RequestType::kU2fApiRequest:
return CEF_PERMISSION_TYPE_U2F_API_REQUEST;
case permissions::RequestType::kVrSession:
return CEF_PERMISSION_TYPE_VR_SESSION;
case permissions::RequestType::kWindowManagement:

View File

@@ -21,7 +21,6 @@
#include "base/values.h"
#include "chrome/browser/accessibility/accessibility_ui.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/media/media_device_id_salt.h"
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
#include "chrome/browser/net/profile_network_context_service.h"
@@ -46,6 +45,7 @@
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/language/core/browser/language_prefs.h"
#include "components/language/core/browser/pref_names.h"
#include "components/media_device_salt/media_device_id_salt.h"
#include "components/permissions/permission_actions_history.h"
#include "components/permissions/permission_hats_trigger_helper.h"
#include "components/policy/core/common/policy_pref_names.h"
@@ -269,7 +269,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
HostContentSettingsMap::RegisterProfilePrefs(registry.get());
language::LanguagePrefs::RegisterProfilePrefs(registry.get());
media_router::RegisterProfilePrefs(registry.get());
MediaDeviceIDSalt::RegisterProfilePrefs(registry.get());
media_device_salt::MediaDeviceIDSalt::RegisterProfilePrefs(registry.get());
PermissionBubbleMediaAccessHandler::RegisterProfilePrefs(registry.get());
permissions::PermissionActionsHistory::RegisterProfilePrefs(registry.get());
permissions::PermissionHatsTriggerHelper::RegisterProfilePrefs(

View File

@@ -41,7 +41,7 @@
#include "media/media_buildflags.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "ui/color/color_provider_manager.h"
#include "ui/color/color_provider_key.h"
#include "ui/native_theme/native_theme.h"
namespace renderer_prefs {
@@ -219,8 +219,7 @@ bool UpdatePreferredColorScheme(blink::web_pref::WebPreferences* web_prefs,
// WebUI should track the color mode of the ColorProvider associated with
// |web_contents|.
web_prefs->preferred_color_scheme =
web_contents->GetColorMode() ==
ui::ColorProviderManager::ColorMode::kLight
web_contents->GetColorMode() == ui::ColorProviderKey::ColorMode::kLight
? blink::mojom::PreferredColorScheme::kLight
: blink::mojom::PreferredColorScheme::kDark;
}