chore: bump chromium to 95.0.4612.5 (main) (#30503)

* chore: bump chromium in DEPS to 94.0.4604.0

* build: 3-way merge of chromium patches

* chore: bump chromium in DEPS to 94.0.4605.0

* build: 3-way merge of chromium patches

* 3076040: Reland Remove delete_children RemoveAllChildViews arg

Ref: 3076040

* 3069287: Remove the remaining uses and delete the deprecated API

Ref: 3069287

* 2297212: Replace RemoveWithoutPathExpansion(.*, nullptr) with Value::RemoveKey()

Refs: 2297212

Also: 3060296

* 3082756: Change transport_security_persister_path param to be a path to a file.

Refs: 3082756

> this CL intentionally changes the name of the parameter
> in the network context parameters and the order of the constructor
> parameters to ensure all callers update their code to pass a full
> file path rather than a path to a directory.

The 'path' in this diff is already an absolute path, coming from
`CHECK(base::PathService::Get(chrome::DIR_USER_DATA, &path_));` at
08ff1c2cbf/shell/browser/electron_browser_context.cc (L126)

* iwyu: network::mojom::HttpRawHeaderPair

* fixup! 3076040: Reland Remove delete_children RemoveAllChildViews arg

Missed one.

* 2999884: CodeHealth: Remove DictionaryValue::GetStringWithoutPathExpansion

Refs: 2999884
(example of replacing GetStringWithoutPathExpansion() w/FindStringKey())

Also: 3060296
(removal of DictionaryValue::GetStringWithoutPathExpansion)

* 3059260: Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

Refs: 3059260

We had both of these in a 'disable_features' list. Since these feature have
been removed upstream, remove them from our disable list, too.

IMPORTANT: this commit should not be backported to older branches that
still have these features, because doing so would un-disable them.

* 2920890: Load reroute_info from download in-progress and history db back into DownloadItem.

Refs: 2920890

* 3039323: [Clipboard API] Clipboard Custom Formats implementation Part 5.

Refs: 3039323

* chore: bump chromium in DEPS to 94.0.4606.0

* 3084502: Add a new PrintRasterizePdfDpi policy.

Refs: 3084502

* chore: update patches

* chore: bump chromium in DEPS to 94.0.4606.3

* chore: bump chromium in DEPS to 95.0.4608.0

* chore: bump chromium in DEPS to 95.0.4609.0

* [DevTools] Remove report_raw_headers from network::ResourceRequest

2856099

* Remove content::WebContentsObserver::OnInterfaceRequestFromFrame

3092665

* Disable kDesktopCaptureMacV2

3069272

* Add a new PrintRasterizePdfDpi policy.

3084502

* chore: update patches

* chore: bump chromium in DEPS to 95.0.4609.3

* disable `use_lld` for macos

* chore: update patches

* Linux: use chrome_crashpad_handler instead of crashpad_handler

3054290

* chore: fix lint

* Revert "[DevTools] Remove report_raw_headers from network::ResourceRequest"

This reverts commit 28f4da1582d046e96cb58f3cbb590503e89dfd0d.

* [DevTools] Remove report_raw_headers from network::ResourceRequest (Attempt #2)

2856099

* DCHECK that predictor always has a non-empty NetworkIsolationKey.

3067698

* Remove --no-untrusted-code-mitigations from //content and //gin

3096585

* fixup! Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

3059260

* fixup! Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

* Convert PrintManager to RenderFrameHostReceiverSet.

3072019

* chore: bump chromium in DEPS to 95.0.4612.5

* chore: disable v8 oilpan

* [Compiler] Remove untrusted code mitigations.

3045704

* Remove most FTP logic from services/network.

3076119

* Rename scale_factor.h -> resource_scale_factor.h

3057113

* [GURL -> SiteForCookies] extensions/

3100825

* breadcrumbs: add desktop entry point

3021746

* Move args_ to private in ExtensionFunction

3076261

* chore: iwyu

* fixup! Remove kSameSiteByDefaultCookies and kCookiesWithoutSameSiteMustBeSecure

* Disable kDesktopCaptureMacV2

3069272

* fixup! [Compiler] Remove untrusted code mitigations.

* fixup! Disable kDesktopCaptureMacV2

* Revert "chore: disable v8 oilpan"

This reverts commit 5d255cf1d8e8efbb906047937a713279e5f800d0.

* Reland "chore: disable v8 oilpan"

This reverts commit 1c252765b07a205560e7b5eed06de2605336e2d8.

The previous revert was to test on which platforms did the
heapsnapshot test actually fail.

* [Clipboard API] Clipboard Custom Formats implementation Part 5.

3039323

* Convert ExtensionFrameHost to RenderFrameHostReceiverSet.

3063358

* Convert PDFWebContentsHelper to RenderFrameHostReceiverSet.

3049751

* [Underscore Migration] Migrate ui/legacy

3093160

* chore: remove unknown permission error

* chore: fix lint

* chore: ignore -Wunreachable-code-return for node deps/

* fixup! chore: ignore -Wunreachable-code-return for node deps/

* fix: windows build

* fix: build dependency

Dependency was missed in cbeae20438

* 3108669: arm,dsp: Fix 8bpp Dct64_NEON().

3108669

* chore: revert libgav1 roll

* Revert "3108669: arm,dsp: Fix 8bpp Dct64_NEON()."

This reverts commit 7ed31323127aac8ba2eaff9cae6c9be9a4954f33.

* Revert "chore: revert libgav1 roll"

This reverts commit 084a490d298811267316c786762fe7aa91b6318d.

* chore: revert clang roll

* chore:  Fix -Wunreachable-code-aggressive warnings in arm and arm64 code

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: mlaurencin <mlaurencin@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
electron-roller[bot] 2021-08-23 20:52:17 -04:00 committed by GitHub
parent 10c4931477
commit 5513e66982
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
109 changed files with 1322 additions and 477 deletions

View file

@ -32,6 +32,7 @@
#include "media/audio/audio_manager.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/ssl_cert_request_info.h"
#include "net/ssl/ssl_private_key.h"
#include "sandbox/policy/switches.h"
#include "shell/browser/api/electron_api_menu.h"
#include "shell/browser/api/electron_api_session.h"

View file

@ -294,7 +294,6 @@ v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
const std::string* value = details.FindStringKey("value");
const std::string* domain = details.FindStringKey("domain");
const std::string* path = details.FindStringKey("path");
bool secure = details.FindBoolKey("secure").value_or(false);
bool http_only = details.FindBoolKey("httpOnly").value_or(false);
const std::string* same_site_string = details.FindStringKey("sameSite");
net::CookieSameSite same_site;
@ -303,6 +302,8 @@ v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
promise.RejectWithErrorMessage(error);
return handle;
}
bool secure = details.FindBoolKey("secure").value_or(
same_site == net::CookieSameSite::NO_RESTRICTION);
bool same_party =
details.FindBoolKey("sameParty")
.value_or(secure && same_site != net::CookieSameSite::STRICT_MODE);

View file

@ -269,7 +269,8 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
download::DownloadItem::INTERRUPTED,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false, base::Time(),
false, std::vector<download::DownloadItem::ReceivedSlice>());
false, std::vector<download::DownloadItem::ReceivedSlice>(),
download::DownloadItemRerouteInfo());
}
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
@ -911,7 +912,7 @@ static void StartPreconnectOnUI(ElectronBrowserContext* browser_context,
int num_sockets_to_preconnect) {
std::vector<predictors::PreconnectRequest> requests = {
{url::Origin::Create(url), num_sockets_to_preconnect,
net::NetworkIsolationKey()}};
net::NetworkIsolationKey::CreateTransient()}};
browser_context->GetPreconnectManager()->Start(url, requests);
}

View file

@ -20,6 +20,7 @@
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/chunked_data_pipe_getter.mojom.h"
#include "services/network/public/mojom/http_raw_headers.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "shell/browser/api/electron_api_session.h"
#include "shell/browser/electron_browser_context.h"
@ -277,6 +278,10 @@ SimpleURLLoaderWrapper::SimpleURLLoaderWrapper(
url_loader_network_observer_remote.InitWithNewPipeAndPassReceiver());
request->trusted_params->url_loader_network_observer =
std::move(url_loader_network_observer_remote);
// Chromium filters headers using browser rules, while for net module we have
// every header passed. Setting the following id will allow us to capture the
// raw headers in the URLLoader.
request->devtools_request_id = base::UnguessableToken::Create().ToString();
// SimpleURLLoader wants to control the request body itself. We have other
// ideas.
auto request_body = std::move(request->request_body);
@ -489,10 +494,6 @@ gin::Handle<SimpleURLLoaderWrapper> SimpleURLLoaderWrapper::Create(
options |= network::mojom::kURLLoadOptionBlockAllCookies;
}
// Chromium filters headers using browser rules, while for net module we have
// every header passed.
request->report_raw_headers = true;
v8::Local<v8::Value> body;
v8::Local<v8::Value> chunk_pipe_getter;
if (opts.Get("body", &body)) {
@ -577,9 +578,8 @@ void SimpleURLLoaderWrapper::OnResponseStarted(
dict.Set("httpVersion", response_head.headers->GetHttpVersion());
// Note that |response_head.headers| are filtered by Chromium and should not
// be used here.
DCHECK(response_head.raw_request_response_info);
dict.Set("rawHeaders",
response_head.raw_request_response_info->response_headers);
DCHECK(!response_head.raw_response_headers.empty());
dict.Set("rawHeaders", response_head.raw_response_headers);
Emit("response-started", final_url, dict);
}

View file

@ -419,8 +419,9 @@ bool IsDeviceNameValid(const std::u16string& device_name) {
#elif defined(OS_WIN)
printing::ScopedPrinterHandle printer;
return printer.OpenPrinterWithName(base::as_wcstr(device_name));
#endif
#else
return true;
#endif
}
std::u16string GetDefaultPrinterAsync() {
@ -1497,13 +1498,6 @@ void WebContents::DidChangeThemeColor() {
}
}
void WebContents::OnInterfaceRequestFromFrame(
content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle* interface_pipe) {
registry_.TryBindInterface(interface_name, interface_pipe, render_frame_host);
}
void WebContents::DidAcquireFullscreen(content::RenderFrameHost* rfh) {
set_fullscreen_frame(rfh);
}
@ -3415,7 +3409,7 @@ void WebContents::DevToolsRemoveFileSystem(
auto* pref_service = GetPrefService(GetDevToolsWebContents());
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->RemoveWithoutPathExpansion(path, nullptr);
update.Get()->RemoveKey(path);
base::Value file_system_path_value(path);
inspectable_web_contents_->CallClientFunction("DevToolsAPI.fileSystemRemoved",

View file

@ -30,7 +30,6 @@
#include "gin/wrappable.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "printing/buildflags/buildflags.h"
#include "services/service_manager/public/cpp/binder_registry.h"
#include "shell/browser/api/frame_subscriber.h"
#include "shell/browser/api/save_page_handler.h"
#include "shell/browser/event_emitter_mixin.h"
@ -581,10 +580,6 @@ class WebContents : public gin::Wrappable<WebContents>,
const content::MediaPlayerId& id,
content::WebContentsObserver::MediaStoppedReason reason) override;
void DidChangeThemeColor() override;
void OnInterfaceRequestFromFrame(
content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
mojo::ScopedMessagePipeHandle* interface_pipe) override;
void OnCursorChanged(const content::WebCursor& cursor) override;
void DidAcquireFullscreen(content::RenderFrameHost* rfh) override;
@ -770,8 +765,6 @@ class WebContents : public gin::Wrappable<WebContents>,
// Stores the frame thats currently in fullscreen, nullptr if there is none.
content::RenderFrameHost* fullscreen_frame_ = nullptr;
service_manager::BinderRegistryWithArgs<content::RenderFrameHost*> registry_;
base::WeakPtrFactory<WebContents> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(WebContents);

View file

@ -89,6 +89,12 @@ BuildState* BrowserProcessImpl::GetBuildState() {
return nullptr;
}
breadcrumbs::BreadcrumbPersistentStorageManager*
BrowserProcessImpl::GetBreadcrumbPersistentStorageManager() {
NOTIMPLEMENTED();
return nullptr;
}
void BrowserProcessImpl::PostEarlyInitialization() {
PrefServiceFactory prefs_factory;
auto pref_registry = base::MakeRefCounted<PrefRegistrySimple>();

View file

@ -39,6 +39,8 @@ class BrowserProcessImpl : public BrowserProcess {
static void ApplyProxyModeFromCommandLine(ValueMapPrefStore* pref_store);
BuildState* GetBuildState() override;
breadcrumbs::BreadcrumbPersistentStorageManager*
GetBreadcrumbPersistentStorageManager() override;
void PostEarlyInitialization();
void PreCreateThreads();
void PostDestroyThreads() {}

View file

@ -192,6 +192,14 @@
#include "ui/views/widget/widget.h"
#endif
#if BUILDFLAG(ENABLE_PRINTING)
#include "shell/browser/printing/print_view_manager_electron.h"
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck
#endif
using content::BrowserThread;
namespace electron {
@ -1309,16 +1317,15 @@ void ElectronBrowserClient::CreateWebSocket(
if (web_request_api && web_request_api->MayHaveProxies()) {
web_request_api->ProxyWebSocket(frame, std::move(factory), url,
site_for_cookies.RepresentativeUrl(),
user_agent, std::move(handshake_client));
site_for_cookies, user_agent,
std::move(handshake_client));
return;
}
}
#endif
ProxyingWebSocket::StartProxying(
web_request.get(), std::move(factory), url,
site_for_cookies.RepresentativeUrl(), user_agent,
web_request.get(), std::move(factory), url, site_for_cookies, user_agent,
std::move(handshake_client), true, frame->GetProcess()->GetID(),
frame->GetRoutingID(), frame->GetLastCommittedOrigin(), browser_context,
&next_id_);
@ -1446,6 +1453,33 @@ bool ElectronBrowserClient::BindAssociatedReceiverFromFrame(
render_frame_host);
return true;
}
#if BUILDFLAG(ENABLE_PRINTING)
if (interface_name == printing::mojom::PrintManagerHost::Name_) {
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver(
std::move(*handle));
PrintViewManagerElectron::BindPrintManagerHost(std::move(receiver),
render_frame_host);
return true;
}
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
if (interface_name == extensions::mojom::LocalFrameHost::Name_) {
extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>(
std::move(*handle)),
render_frame_host);
return true;
}
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
if (interface_name == pdf::mojom::PdfService::Name_) {
pdf::PDFWebContentsHelper::BindPdfService(
mojo::PendingAssociatedReceiver<pdf::mojom::PdfService>(
std::move(*handle)),
render_frame_host);
return true;
}
#endif
return false;
}

View file

@ -67,11 +67,10 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
if (init_result_)
return init_result_.value();
const auto& list = args_->GetList();
if (list.size() < 2)
if (args().size() < 2)
return set_init_result(VALIDATION_FAILURE);
const auto& tab_id_value = list[0];
const auto& tab_id_value = args()[0];
// |tab_id| is optional so it's ok if it's not there.
int tab_id = -1;
if (tab_id_value.is_int()) {
@ -83,7 +82,7 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
}
// |details| are not optional.
const base::Value& details_value = list[1];
const base::Value& details_value = args()[1];
if (!details_value.is_dict())
return set_init_result(VALIDATION_FAILURE);
std::unique_ptr<InjectDetails> details(new InjectDetails());
@ -184,7 +183,7 @@ bool TabsExecuteScriptFunction::ShouldRemoveCSS() const {
}
ExtensionFunction::ResponseAction TabsGetFunction::Run() {
std::unique_ptr<tabs::Get::Params> params(tabs::Get::Params::Create(*args_));
std::unique_ptr<tabs::Get::Params> params(tabs::Get::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params.get());
int tab_id = params->tab_id;
@ -206,7 +205,7 @@ ExtensionFunction::ResponseAction TabsGetFunction::Run() {
ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
std::unique_ptr<tabs::SetZoom::Params> params(
tabs::SetZoom::Params::Create(*args_));
tabs::SetZoom::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@ -234,7 +233,7 @@ ExtensionFunction::ResponseAction TabsSetZoomFunction::Run() {
ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
std::unique_ptr<tabs::GetZoom::Params> params(
tabs::GetZoom::Params::Create(*args_));
tabs::GetZoom::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@ -250,7 +249,7 @@ ExtensionFunction::ResponseAction TabsGetZoomFunction::Run() {
ExtensionFunction::ResponseAction TabsGetZoomSettingsFunction::Run() {
std::unique_ptr<tabs::GetZoomSettings::Params> params(
tabs::GetZoomSettings::Params::Create(*args_));
tabs::GetZoomSettings::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@ -274,7 +273,7 @@ ExtensionFunction::ResponseAction TabsSetZoomSettingsFunction::Run() {
using api::tabs::ZoomSettings;
std::unique_ptr<tabs::SetZoomSettings::Params> params(
tabs::SetZoomSettings::Params::Create(*args_));
tabs::SetZoomSettings::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params);
int tab_id = params->tab_id ? *params->tab_id : -1;
@ -401,7 +400,7 @@ TabsUpdateFunction::TabsUpdateFunction() : web_contents_(nullptr) {}
ExtensionFunction::ResponseAction TabsUpdateFunction::Run() {
std::unique_ptr<tabs::Update::Params> params(
tabs::Update::Params::Create(*args_));
tabs::Update::Params::Create(args()));
EXTENSION_FUNCTION_VALIDATE(params.get());
int tab_id = params->tab_id ? *params->tab_id : -1;

View file

@ -30,14 +30,7 @@ void InitializeFeatureList() {
// Can be reenabled when our site instance policy is aligned with chromium
// when node integration is enabled.
disable_features +=
std::string(",") + features::kSpareRendererForSitePerProcess.name +
// Disable SameSite-by-default, this will be a breaking change for many
// apps which cannot land in master until 11-x-y is branched out. For more
// info
// https://groups.google.com/a/chromium.org/g/embedder-dev/c/4yJi4Twj2NM/m/9bhpWureCAAJ
std::string(",") + net::features::kSameSiteByDefaultCookies.name +
std::string(",") +
net::features::kCookiesWithoutSameSiteMustBeSecure.name;
std::string(",") + features::kSpareRendererForSitePerProcess.name;
#if !BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
disable_features += std::string(",") + media::kPictureInPicture.name;
@ -48,12 +41,6 @@ void InitializeFeatureList() {
// an empty suggestions list to be returned
disable_features +=
std::string(",") + spellcheck::kWinRetrieveSuggestionsOnlyOnDemand.name;
#endif
#if defined(OS_MAC)
// Disable kWindowCaptureMacV2, which causes the wrong window id to
// be returned (this has been disabled in upstream Chromium here):
// https://chromium-review.googlesource.com/c/chromium/src/+/3069272
disable_features += std::string(",") + features::kWindowCaptureMacV2.name;
#endif
base::FeatureList::InitializeInstance(enable_features, disable_features);
}

View file

@ -23,7 +23,6 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/desktop_media_id.h"
#include "content/public/common/content_features.h"
#include "shell/browser/javascript_environment.h"
#include "shell/browser/native_browser_view_mac.h"
#include "shell/browser/ui/cocoa/electron_native_widget_mac.h"
@ -1236,11 +1235,13 @@ content::DesktopMediaID NativeWindowMac::GetDesktopMediaID() const {
content::DesktopMediaID::TYPE_WINDOW, GetAcceleratedWidget());
// c.f.
// https://source.chromium.org/chromium/chromium/src/+/master:chrome/browser/media/webrtc/native_desktop_media_list.cc;l=372?q=kWindowCaptureMacV2&ss=chromium
if (base::FeatureList::IsEnabled(features::kWindowCaptureMacV2)) {
// Refs https://github.com/electron/electron/pull/30507
// TODO(deepak1556): Match upstream for `kWindowCaptureMacV2`
#if 0
if (remote_cocoa::ScopedCGWindowID::Get(desktop_media_id.id)) {
desktop_media_id.window_id = desktop_media_id.id;
}
}
#endif
return desktop_media_id;
}

View file

@ -81,13 +81,9 @@ void NetworkContextService::ConfigureNetworkContextParams(
network_context_params->enable_encrypted_cookies =
electron::fuses::IsCookieEncryptionEnabled();
network_context_params->transport_security_persister_path = path;
network_context_params->transport_security_persister_file_path = path;
}
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
network_context_params->enable_ftp_url_support = true;
#endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
proxy_config_monitor_.AddToNetworkContextParams(network_context_params);
BrowserProcessImpl::ApplyProxyModeFromCommandLine(

View file

@ -230,7 +230,7 @@ void ProxyingWebSocket::StartProxying(
WebRequestAPI* web_request_api,
WebSocketFactory factory,
const GURL& url,
const GURL& site_for_cookies,
const net::SiteForCookies& site_for_cookies,
const absl::optional<std::string>& user_agent,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client,
@ -243,7 +243,7 @@ void ProxyingWebSocket::StartProxying(
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
network::ResourceRequest request;
request.url = url;
request.site_for_cookies = net::SiteForCookies::FromUrl(site_for_cookies);
request.site_for_cookies = site_for_cookies;
if (user_agent) {
request.headers.SetHeader(net::HttpRequestHeaders::kUserAgent, *user_agent);
}

View file

@ -95,7 +95,7 @@ class ProxyingWebSocket : public network::mojom::WebSocketHandshakeClient,
WebRequestAPI* web_request_api,
WebSocketFactory factory,
const GURL& url,
const GURL& site_for_cookies,
const net::SiteForCookies& site_for_cookies,
const absl::optional<std::string>& user_agent,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client,

View file

@ -191,10 +191,6 @@ void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(
network_context_params->proxy_resolver_factory =
ChromeMojoProxyResolverFactory::CreateWithSelfOwnedReceiver();
#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
network_context_params->enable_ftp_url_support = true;
#endif
}
// static

View file

@ -16,6 +16,19 @@ PrintViewManagerElectron::PrintViewManagerElectron(
PrintViewManagerElectron::~PrintViewManagerElectron() = default;
// static
void PrintViewManagerElectron::BindPrintManagerHost(
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver,
content::RenderFrameHost* rfh) {
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
if (!web_contents)
return;
auto* print_manager = PrintViewManagerElectron::FromWebContents(web_contents);
if (!print_manager)
return;
print_manager->BindReceiver(std::move(receiver), rfh);
}
void PrintViewManagerElectron::SetupScriptedPrintPreview(
SetupScriptedPrintPreviewCallback callback) {
std::move(callback).Run();

View file

@ -18,6 +18,11 @@ class PrintViewManagerElectron
public:
~PrintViewManagerElectron() override;
static void BindPrintManagerHost(
mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost>
receiver,
content::RenderFrameHost* rfh);
void SetupScriptedPrintPreview(
SetupScriptedPrintPreviewCallback callback) override;
void ShowScriptedPrintPreview(bool source_is_modifiable) override;

View file

@ -868,7 +868,7 @@ void InspectableWebContents::SetPreference(const std::string& name,
void InspectableWebContents::RemovePreference(const std::string& name) {
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
update.Get()->RemoveWithoutPathExpansion(name, nullptr);
update.Get()->RemoveKey(name);
}
void InspectableWebContents::ClearPreferences() {

View file

@ -213,7 +213,7 @@ void AutofillPopupView::CreateChildViews() {
if (!popup_)
return;
RemoveAllChildViews(true);
RemoveAllChildViews();
for (int i = 0; i < popup_->GetLineCount(); ++i) {
auto* child_view = new AutofillPopupChildView(popup_->GetValueAt(i));

View file

@ -218,7 +218,7 @@ void MenuBar::RefreshColorCache(const ui::NativeTheme* theme) {
}
void MenuBar::RebuildChildren() {
RemoveAllChildViews(true);
RemoveAllChildViews();
for (int i = 0, n = GetItemCount(); i < n; ++i) {
auto* button = new SubmenuButton(
base::BindRepeating(&MenuBar::ButtonPressed, base::Unretained(this), i),

View file

@ -94,7 +94,7 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
}
if (modification_is_removal)
host_zoom_dictionary->RemoveWithoutPathExpansion(change.host, nullptr);
host_zoom_dictionary->RemoveKey(change.host);
else
host_zoom_dictionary->SetKey(change.host, base::Value(level));
}
@ -107,9 +107,7 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
for (base::DictionaryValue::Iterator i(*host_zoom_dictionary_copy);
!i.IsAtEnd(); i.Advance()) {
const std::string& host(i.key());
double zoom_level = 0;
bool has_valid_zoom_level = i.value().GetAsDouble(&zoom_level);
const absl::optional<double> zoom_level = i.value().GetIfDouble();
// Filter out A) the empty host, B) zoom levels equal to the default; and
// remember them, so that we can later erase them from Prefs.
@ -117,14 +115,14 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
// level was set to its current value. In either case, SetZoomLevelForHost
// will ignore type B values, thus, to have consistency with HostZoomMap's
// internal state, these values must also be removed from Prefs.
if (host.empty() || !has_valid_zoom_level ||
blink::PageZoomValuesEqual(zoom_level,
if (host.empty() || !zoom_level ||
blink::PageZoomValuesEqual(*zoom_level,
host_zoom_map_->GetDefaultZoomLevel())) {
keys_to_remove.push_back(host);
continue;
}
host_zoom_map_->SetZoomLevelForHost(host, zoom_level);
host_zoom_map_->SetZoomLevelForHost(host, *zoom_level);
}
// Sanitize prefs to remove entries that match the default zoom level and/or
@ -136,7 +134,7 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
host_zoom_dictionaries->GetDictionary(partition_key_,
&sanitized_host_zoom_dictionary);
for (const std::string& s : keys_to_remove)
sanitized_host_zoom_dictionary->RemoveWithoutPathExpansion(s, nullptr);
sanitized_host_zoom_dictionary->RemoveKey(s);
}
}