chore: bump chromium to 135.0.7027.0 (main) (#45677)

* chore: bump chromium in DEPS to 135.0.7021.0

* chore: bump chromium in DEPS to 135.0.7023.0

* chore: update patches

* chore: gen-libc++-filenames.js

* [Extensions] Add a BUILD.gn file for the chrome.system.display API.

Refs 6227347

* chore: bump chromium in DEPS to 135.0.7025.0

* fixup! [Extensions] Add a BUILD.gn file for the chrome.system.display API.

* [DevTools] Add support for automatic workspace folders.

Refs 6275926

* Add UseCounter for potential PNA 2.0 breakage

Refs 6259197

* Remove references to NavigationEntry/Controller in Zoom code.

Refs 6258070

* chore: update patches

* Allow DevTools to record UmaHistogramMediumTimes

Refs 6183713

* chore: update patches

* [gpu] Remove unnecessary media_buildflags include

Refs 6286526

* chore: bump chromium in DEPS to 135.0.7027.0

* chore: update patches

* Remove type alias

Refs 6280957

* [Refactor] Make ExtensionRegistrar a browser keyed service.

Refs 6285230

* Remove unused functions

Refs 6278736

* chore: IWYU

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
This commit is contained in:
electron-roller[bot] 2025-02-21 14:46:51 -08:00 committed by GitHub
parent 6248c2436a
commit 612da3ec47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 347 additions and 575 deletions

View file

@ -1685,7 +1685,7 @@ ElectronBrowserClient::CreateLoginDelegate(
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
content::GuestPageHolder* guest_page_holder,
LoginAuthRequiredCallback auth_required_callback) {
content::LoginDelegate::LoginAuthRequiredCallback auth_required_callback) {
return std::make_unique<LoginHandler>(
auth_info, web_contents, is_request_for_primary_main_frame,
is_request_for_navigation, base::kNullProcessId, url, response_headers,

View file

@ -292,7 +292,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
content::GuestPageHolder* guest_page_holder,
LoginAuthRequiredCallback auth_required_callback) override;
content::LoginDelegate::LoginAuthRequiredCallback auth_required_callback)
override;
void SiteInstanceGotProcessAndSite(
content::SiteInstance* site_instance) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>>

View file

@ -1,11 +0,0 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "shell/browser/extensions/electron_display_info_provider.h"
namespace extensions {
ElectronDisplayInfoProvider::ElectronDisplayInfoProvider() = default;
} // namespace extensions

View file

@ -1,24 +0,0 @@
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_DISPLAY_INFO_PROVIDER_H_
#define ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_DISPLAY_INFO_PROVIDER_H_
#include "extensions/browser/api/system_display/display_info_provider.h"
namespace extensions {
class ElectronDisplayInfoProvider : public DisplayInfoProvider {
public:
ElectronDisplayInfoProvider();
// disable copy
ElectronDisplayInfoProvider(const ElectronDisplayInfoProvider&) = delete;
ElectronDisplayInfoProvider& operator=(const ElectronDisplayInfoProvider&) =
delete;
};
} // namespace extensions
#endif // ELECTRON_SHELL_BROWSER_EXTENSIONS_ELECTRON_DISPLAY_INFO_PROVIDER_H_

View file

@ -94,7 +94,9 @@ std::pair<scoped_refptr<const Extension>, std::string> LoadUnpacked(
ElectronExtensionLoader::ElectronExtensionLoader(
content::BrowserContext* browser_context)
: browser_context_(browser_context),
extension_registrar_(browser_context, this) {}
extension_registrar_(ExtensionRegistrar::Get(browser_context)) {
extension_registrar_->SetDelegate(this);
}
ElectronExtensionLoader::~ElectronExtensionLoader() = default;
@ -119,7 +121,8 @@ void ElectronExtensionLoader::ReloadExtension(const ExtensionId& extension_id) {
DCHECK_EQ(false, did_schedule_reload_);
base::AutoReset<bool> reset_did_schedule_reload(&did_schedule_reload_, false);
extension_registrar_.ReloadExtension(extension_id, LoadErrorBehavior::kQuiet);
extension_registrar_->ReloadExtension(extension_id,
LoadErrorBehavior::kQuiet);
if (did_schedule_reload_)
return;
}
@ -127,7 +130,7 @@ void ElectronExtensionLoader::ReloadExtension(const ExtensionId& extension_id) {
void ElectronExtensionLoader::UnloadExtension(
const ExtensionId& extension_id,
extensions::UnloadedExtensionReason reason) {
extension_registrar_.RemoveExtension(extension_id, reason);
extension_registrar_->RemoveExtension(extension_id, reason);
}
void ElectronExtensionLoader::FinishExtensionLoad(
@ -135,7 +138,7 @@ void ElectronExtensionLoader::FinishExtensionLoad(
std::pair<scoped_refptr<const Extension>, std::string> result) {
scoped_refptr<const Extension> extension = result.first;
if (extension) {
extension_registrar_.AddExtension(extension);
extension_registrar_->AddExtension(extension);
// Write extension install time to ExtensionPrefs. This is required by
// WebRequestAPI which calls extensions::ExtensionPrefs::GetInstallTime.
@ -163,7 +166,7 @@ void ElectronExtensionLoader::FinishExtensionReload(
std::pair<scoped_refptr<const Extension>, std::string> result) {
scoped_refptr<const Extension> extension = result.first;
if (extension) {
extension_registrar_.AddExtension(extension);
extension_registrar_->AddExtension(extension);
}
}

View file

@ -53,7 +53,7 @@ class ElectronExtensionLoader : public ExtensionRegistrar::Delegate {
void UnloadExtension(const ExtensionId& extension_id,
extensions::UnloadedExtensionReason reason);
ExtensionRegistrar* registrar() { return &extension_registrar_; }
raw_ptr<ExtensionRegistrar> registrar() { return extension_registrar_; }
private:
// If the extension loaded successfully, enables it. If it's an app, launches
@ -92,7 +92,7 @@ class ElectronExtensionLoader : public ExtensionRegistrar::Delegate {
raw_ptr<content::BrowserContext> browser_context_; // Not owned.
// Registers and unregisters extensions.
ExtensionRegistrar extension_registrar_;
raw_ptr<ExtensionRegistrar> extension_registrar_;
// Holds keep-alives for relaunching apps.
// ShellKeepAliveRequester keep_alive_requester_;

View file

@ -30,7 +30,7 @@ LoginHandler::LoginHandler(
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
LoginAuthRequiredCallback auth_required_callback)
content::LoginDelegate::LoginAuthRequiredCallback auth_required_callback)
: auth_required_callback_(std::move(auth_required_callback)) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);

View file

@ -22,15 +22,16 @@ namespace electron {
// Handles HTTP basic auth.
class LoginHandler : public content::LoginDelegate {
public:
LoginHandler(const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
bool is_request_for_primary_main_frame,
bool is_request_for_navigation,
base::ProcessId process_id,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
LoginAuthRequiredCallback auth_required_callback);
LoginHandler(
const net::AuthChallengeInfo& auth_info,
content::WebContents* web_contents,
bool is_request_for_primary_main_frame,
bool is_request_for_navigation,
base::ProcessId process_id,
const GURL& url,
scoped_refptr<net::HttpResponseHeaders> response_headers,
bool first_auth_attempt,
content::LoginDelegate::LoginAuthRequiredCallback auth_required_callback);
~LoginHandler() override;
// disable copy
@ -48,7 +49,7 @@ class LoginHandler : public content::LoginDelegate {
bool first_auth_attempt);
void CallbackFromJS(gin::Arguments* args);
LoginAuthRequiredCallback auth_required_callback_;
content::LoginDelegate::LoginAuthRequiredCallback auth_required_callback_;
base::WeakPtrFactory<LoginHandler> weak_factory_{this};
};

View file

@ -70,6 +70,11 @@ class URLLoaderNetworkObserver
const std::optional<std::string>& private_network_device_id,
const std::optional<std::string>& private_network_device_name,
OnPrivateNetworkAccessPermissionRequiredCallback callback) override {}
void OnUrlLoaderConnectedToPrivateNetwork(
const GURL& request_url,
network::mojom::IPAddressSpace response_address_space,
network::mojom::IPAddressSpace client_address_space,
network::mojom::IPAddressSpace target_address_space) override {}
void Clone(
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
observer) override;

View file

@ -112,6 +112,12 @@ class InspectableWebContents
void RemoveFileSystem(const std::string& file_system_path) override;
void UpgradeDraggedFileSystemPermissions(
const std::string& file_system_url) override {}
void ConnectAutomaticFileSystem(DispatchCallback callback,
const std::string& file_system_path,
const std::string& file_system_uuid,
bool add_if_missing) override {}
void DisconnectAutomaticFileSystem(
const std::string& file_system_path) override {}
void IndexPath(int index_request_id,
const std::string& file_system_path,
const std::string& excluded_folders) override;
@ -167,6 +173,8 @@ class InspectableWebContents
void SetOpenNewWindowForPopups(bool value) override {}
void RecordPerformanceHistogram(const std::string& name,
double duration) override {}
void RecordPerformanceHistogramMedium(const std::string& name,
double duration) override {}
void RecordUserMetricsAction(const std::string& name) override {}
void RecordImpression(const ImpressionEvent& event) override {}
void RecordResize(const ResizeEvent& event) override {}

View file

@ -72,9 +72,6 @@ void WebContentsZoomController::SetEmbedderZoomController(
bool WebContentsZoomController::SetZoomLevel(double level) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
// Cannot zoom in disabled mode. Also, don't allow changing zoom level on
// a crashed tab, an error page or an interstitial page.
if (zoom_mode_ == ZOOM_MODE_DISABLED ||
@ -116,14 +113,14 @@ bool WebContentsZoomController::SetZoomLevel(double level) {
for (auto& observer : observers_)
observer.OnZoomChanged(zoom_change_data);
} else {
if (!entry) {
const GURL url = content::HostZoomMap::GetURLForRenderFrameHost(rfh_id);
if (url.is_empty()) {
// If we exit without triggering an update, we should clear event_data_,
// else we may later trigger a DCHECK(event_data_).
event_data_.reset();
return false;
}
std::string host =
net::GetHostOrSpecFromURL(content::HostZoomMap::GetURLFromEntry(entry));
std::string host = net::GetHostOrSpecFromURL(url);
zoom_map->SetZoomLevelForHost(host, level);
}
@ -181,11 +178,9 @@ void WebContentsZoomController::SetZoomMode(ZoomMode new_mode) {
switch (new_mode) {
case ZOOM_MODE_DEFAULT: {
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
const GURL url = content::HostZoomMap::GetURLForRenderFrameHost(rfh_id);
if (entry) {
GURL url = content::HostZoomMap::GetURLFromEntry(entry);
if (!url.is_empty()) {
const std::string host = net::GetHostOrSpecFromURL(url);
const std::string scheme = url.scheme();
@ -376,14 +371,15 @@ void WebContentsZoomController::OnZoomLevelChanged(
void WebContentsZoomController::UpdateState(const std::string& host) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
auto* rfh = web_contents()->GetPrimaryMainFrame();
// If |host| is empty, all observers should be updated.
if (!host.empty()) {
// Use the navigation entry's URL instead of the WebContents' so virtual
// URLs work (e.g. chrome://settings). http://crbug.com/153950
content::NavigationEntry* entry =
web_contents()->GetController().GetLastCommittedEntry();
if (!entry || host != net::GetHostOrSpecFromURL(
content::HostZoomMap::GetURLFromEntry(entry))) {
// Get the (non-virtual) url to be tracked by the HostZoomMap. Getting urls
// directly from a WebContents may result in a virtual url, so prefer using
// the value from the `rfh` instead, per https://crbug.com/40290372.
const GURL url =
content::HostZoomMap::GetURLForRenderFrameHost(rfh->GetGlobalId());
if (url.is_empty() || host != net::GetHostOrSpecFromURL(url)) {
return;
}
}

View file

@ -129,6 +129,11 @@ class SimpleURLLoaderWrapper final
void Clone(
mojo::PendingReceiver<network::mojom::URLLoaderNetworkServiceObserver>
observer) override;
void OnUrlLoaderConnectedToPrivateNetwork(
const GURL& request_url,
network::mojom::IPAddressSpace response_address_space,
network::mojom::IPAddressSpace client_address_space,
network::mojom::IPAddressSpace target_address_space) override {}
scoped_refptr<network::SharedURLLoaderFactory> GetURLLoaderFactoryForURL(
const GURL& url);

View file

@ -75,8 +75,7 @@ struct DeleteOnUIThread {
static void Destruct(const T* x) {
if (electron::IsBrowserProcess() &&
!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
content::BrowserThread::DeleteSoon(content::BrowserThread::UI, FROM_HERE,
x);
content::GetUIThreadTaskRunner({})->DeleteSoon(FROM_HERE, x);
} else {
delete x;
}

View file

@ -40,6 +40,7 @@
#include "third_party/blink/public/common/page/page_zoom.h"
#include "third_party/blink/public/common/web_cache/web_cache_resource_type_stats.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/public/platform/web_cache.h"
#include "third_party/blink/public/platform/web_isolated_world_info.h"
#include "third_party/blink/public/web/web_custom_element.h"