chore: bump chromium to 133.0.6920.0 (main) (#45055)

* chore: bump chromium in DEPS to 133.0.6902.0

* chore: bump chromium in DEPS to 133.0.6903.0

* chore: update patches

* Update PdfViewer Save File Picker to use showSaveFilePicker.

Refs 6074308

* Code Health: Clean up stale MacWebContentsOcclusion

Refs 6078344

* Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID

Refs 6065543

* [WebRTC] Make WebRTC IP Handling policy a mojo enum

Refs 6063620

* chore: gen filenames.libcxx.gni

* Remove allow_unsafe_buffers pragma in //printing

Refs 6092280

* refactor: to use ChildProcessId where possible

Refs https://issues.chromium.org/issues/379869738

* [Win] Update TabletMode detection code

Refs 6003486

* chore: bump chromium in DEPS to 133.0.6905.0

* chore: update patches

* Reland "Move global shortcut listener to //ui/base"

Refs 6099035

* [shared storage] Implement the batch `with_lock` option for response header

Refs 6072742

* chore: bump chromium in DEPS to 133.0.6907.0

* chore: bump chromium in DEPS to 133.0.6909.0

* chore: bump chromium in DEPS to 133.0.6911.0

* chore: bump chromium in DEPS to 133.0.6912.0

* chore: update patches

* WebUI: Reveal hidden deps to ui/webui/resources.

Refs 6096291

* chore: bump chromium in DEPS to 133.0.6913.0

* chore: bump chromium in DEPS to 133.0.6915.0

* Code Health: Clean up stale base::Feature "AccessibilityTreeForViews"

Refs 6104174

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* fix: remove fastapitypedarray usage

* chore: update patches

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

* Code Health: Clean up stale base::Feature "WinRetrieveSuggestionsOnlyOnDemand"

Refs 6109477

* fix: empty suggestions with windows platform checker

Amends the fix from https://github.com/electron/electron/pull/29690
since the feature flag is no longer available. We follow the
same pattern as //chrome/browser/renderer_context_menu/spelling_menu_observer.cc
to generate the suggestion list on demand when context menu action
is invoked.

Co-authored-by: David Sanders <dsanders11@ucsbalum.com>

* fixup! fix: empty suggestions with windows platform checker

* fixup! fix: empty suggestions with windows platform checker

* revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | 6078344

* Revert "revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | 6078344"

This reverts commit 9cacda452ed5a072351e8f5a35b009d91843a08c.

* chore: bump to 133.0.6920.0, update patches

* Revert "6078344: Code Health: Clean up stale MacWebContentsOcclusion"

Refs: 6078344

* fixup! Update PdfViewer Save File Picker to use showSaveFilePicker.

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: David Sanders <dsanders11@ucsbalum.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
This commit is contained in:
electron-roller[bot] 2025-01-10 10:52:34 -06:00 committed by GitHub
parent 062d14e553
commit 7d05b78479
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
120 changed files with 1167 additions and 2629 deletions

View file

@ -543,11 +543,12 @@ App::App() {
->set_delegate(this);
Browser::Get()->AddObserver(this);
auto pid = content::ChildProcessHost::kInvalidUniqueID;
auto unsafe_pid = content::ChildProcessId::FromUnsafeValue(
content::ChildProcessHost::kInvalidUniqueID);
auto process_metric = std::make_unique<electron::ProcessMetric>(
content::PROCESS_TYPE_BROWSER, base::GetCurrentProcessHandle(),
base::ProcessMetrics::CreateCurrentProcessMetrics());
app_metrics_[pid] = std::move(process_metric);
app_metrics_[unsafe_pid] = std::move(process_metric);
}
App::~App() {
@ -785,26 +786,28 @@ void App::OnGpuInfoUpdate() {
void App::BrowserChildProcessLaunchedAndConnected(
const content::ChildProcessData& data) {
ChildProcessLaunched(data.process_type, data.id, data.GetProcess().Handle(),
data.metrics_name, base::UTF16ToUTF8(data.name));
ChildProcessLaunched(data.process_type,
content::ChildProcessId::FromUnsafeValue(data.id),
data.GetProcess().Handle(), data.metrics_name,
base::UTF16ToUTF8(data.name));
}
void App::BrowserChildProcessHostDisconnected(
const content::ChildProcessData& data) {
ChildProcessDisconnected(data.id);
ChildProcessDisconnected(content::ChildProcessId::FromUnsafeValue(data.id));
}
void App::BrowserChildProcessCrashed(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) {
ChildProcessDisconnected(data.id);
ChildProcessDisconnected(content::ChildProcessId::FromUnsafeValue(data.id));
BrowserChildProcessCrashedOrKilled(data, info);
}
void App::BrowserChildProcessKilled(
const content::ChildProcessData& data,
const content::ChildProcessTerminationInfo& info) {
ChildProcessDisconnected(data.id);
ChildProcessDisconnected(content::ChildProcessId::FromUnsafeValue(data.id));
BrowserChildProcessCrashedOrKilled(data, info);
}
@ -834,7 +837,7 @@ void App::RenderProcessExited(content::RenderProcessHost* host) {
}
void App::ChildProcessLaunched(int process_type,
int pid,
content::ChildProcessId pid,
base::ProcessHandle handle,
const std::string& service_name,
const std::string& name) {
@ -848,7 +851,7 @@ void App::ChildProcessLaunched(int process_type,
process_type, handle, std::move(metrics), service_name, name);
}
void App::ChildProcessDisconnected(int pid) {
void App::ChildProcessDisconnected(content::ChildProcessId pid) {
app_metrics_.erase(pid);
}

View file

@ -186,11 +186,11 @@ class App final : public ElectronBrowserClient::Delegate,
void SetAppPath(const base::FilePath& app_path);
void ChildProcessLaunched(int process_type,
int pid,
content::ChildProcessId pid,
base::ProcessHandle handle,
const std::string& service_name = std::string(),
const std::string& name = std::string());
void ChildProcessDisconnected(int pid);
void ChildProcessDisconnected(content::ChildProcessId pid);
void SetAppLogsPath(gin_helper::ErrorThrower thrower,
std::optional<base::FilePath> custom_path);
@ -275,7 +275,9 @@ class App final : public ElectronBrowserClient::Delegate,
base::FilePath app_path_;
// pid -> electron::ProcessMetric
base::flat_map<int, std::unique_ptr<electron::ProcessMetric>> app_metrics_;
base::flat_map<content::ChildProcessId,
std::unique_ptr<electron::ProcessMetric>>
app_metrics_;
bool disable_hw_acceleration_ = false;
bool disable_domain_blocking_for_3DAPIs_ = false;

View file

@ -143,6 +143,7 @@
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
#include "third_party/blink/public/common/page/page_zoom.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
#include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h"
@ -191,6 +192,14 @@
#include "content/public/browser/plugin_service.h"
#endif
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
#include "chrome/browser/spellchecker/spellcheck_factory.h"
#include "chrome/browser/spellchecker/spellcheck_service.h"
#include "components/spellcheck/browser/spellcheck_platform.h"
#include "components/spellcheck/common/spellcheck_common.h"
#include "components/spellcheck/common/spellcheck_features.h"
#endif
#if !IS_MAS_BUILD()
#include "chrome/browser/hang_monitor/hang_crash_dump.h" // nogncheck
#endif
@ -560,7 +569,7 @@ std::string RegisterFileSystem(content::WebContents* web_contents,
content::ChildProcessSecurityPolicy* policy =
content::ChildProcessSecurityPolicy::GetInstance();
content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
int renderer_id = render_view_host->GetProcess()->GetID();
int renderer_id = render_view_host->GetProcess()->GetDeprecatedID();
policy->GrantReadFileSystem(renderer_id, file_system.id());
policy->GrantWriteFileSystem(renderer_id, file_system.id());
policy->GrantCreateFileForFileSystem(renderer_id, file_system.id());
@ -1464,11 +1473,44 @@ void WebContents::RendererResponsive(
bool WebContents::HandleContextMenu(content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params) {
Emit("context-menu", std::make_pair(params, &render_frame_host));
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
if (!params.misspelled_word.empty() && spellcheck::UseBrowserSpellChecker()) {
SpellcheckService* spellcheck_service =
SpellcheckServiceFactory::GetForContext(
render_frame_host.GetBrowserContext());
if (spellcheck_service) {
spellcheck_platform::GetPerLanguageSuggestions(
spellcheck_service->platform_spell_checker(), params.misspelled_word,
base::BindOnce(&WebContents::OnGetPlatformSuggestionsComplete,
GetWeakPtr(), std::ref(render_frame_host), params));
}
} else {
#endif
Emit("context-menu",
std::make_tuple(params, &render_frame_host,
std::optional<std::vector<std::u16string>>{}));
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
}
#endif
return true;
}
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
void WebContents::OnGetPlatformSuggestionsComplete(
content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params,
const spellcheck::PerLanguageSuggestions&
platform_per_language_suggestions) {
std::vector<std::u16string> combined_suggestions;
spellcheck::FillSuggestions(platform_per_language_suggestions,
&combined_suggestions);
Emit("context-menu",
std::make_tuple(params, &render_frame_host,
std::make_optional(combined_suggestions)));
}
#endif
void WebContents::FindReply(content::WebContents* web_contents,
int request_id,
int number_of_matches,
@ -1740,7 +1782,8 @@ void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
// This event is necessary for tracking any states with respect to
// intermediate render view hosts aka speculative render view hosts. Currently
// used by object-registry.js to ref count remote objects.
Emit("render-view-deleted", render_view_host->GetProcess()->GetID());
Emit("render-view-deleted",
render_view_host->GetProcess()->GetID().GetUnsafeValue());
if (web_contents()->GetRenderViewHost() == render_view_host) {
// When the RVH that has been deleted is the current RVH it means that the
@ -1748,7 +1791,7 @@ void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
// Currently tracked by guest-window-manager.ts to destroy the
// BrowserWindow.
Emit("current-render-view-deleted",
render_view_host->GetProcess()->GetID());
render_view_host->GetProcess()->GetID().GetUnsafeValue());
}
}
@ -1820,7 +1863,8 @@ void WebContents::DOMContentLoaded(
void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
const GURL& validated_url) {
bool is_main_frame = !render_frame_host->GetParent();
int frame_process_id = render_frame_host->GetProcess()->GetID();
int32_t frame_process_id =
render_frame_host->GetProcess()->GetID().GetUnsafeValue();
int frame_routing_id = render_frame_host->GetRoutingID();
auto weak_this = GetWeakPtr();
Emit("did-frame-finish-load", is_main_frame, frame_process_id,
@ -1847,7 +1891,8 @@ void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
return;
bool is_main_frame = !render_frame_host->GetParent();
int frame_process_id = render_frame_host->GetProcess()->GetID();
int32_t frame_process_id =
render_frame_host->GetProcess()->GetID().GetUnsafeValue();
int frame_routing_id = render_frame_host->GetRoutingID();
Emit("did-fail-load", error_code, "", url, is_main_frame, frame_process_id,
frame_routing_id);
@ -1872,7 +1917,7 @@ bool WebContents::EmitNavigationEvent(
int frame_process_id = -1, frame_routing_id = -1;
content::RenderFrameHost* frame_host = GetRenderFrameHost(navigation_handle);
if (frame_host) {
frame_process_id = frame_host->GetProcess()->GetID();
frame_process_id = frame_host->GetProcess()->GetID().GetUnsafeValue();
frame_routing_id = frame_host->GetRoutingID();
}
bool is_same_document = navigation_handle->IsSameDocument();
@ -2019,7 +2064,7 @@ gin::Handle<gin_helper::internal::Event> WebContents::MakeEventWithSender(
if (frame) {
dict.SetGetter("senderFrame", frame);
dict.Set("frameId", frame->GetRoutingID());
dict.Set("processId", frame->GetProcess()->GetID());
dict.Set("processId", frame->GetProcess()->GetID().GetUnsafeValue());
dict.Set("frameTreeNodeId", frame->GetFrameTreeNodeId());
}
return event;
@ -2121,7 +2166,7 @@ void WebContents::DidFinishNavigation(
navigation_handle->GetRenderFrameHost();
int frame_process_id = -1, frame_routing_id = -1;
if (frame_host) {
frame_process_id = frame_host->GetProcess()->GetID();
frame_process_id = frame_host->GetProcess()->GetID().GetUnsafeValue();
frame_routing_id = frame_host->GetRoutingID();
}
if (!navigation_handle->IsErrorPage()) {
@ -2353,8 +2398,12 @@ void WebContents::SetBackgroundThrottling(bool allowed) {
}
}
int WebContents::GetProcessID() const {
return web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
int32_t WebContents::GetProcessID() const {
return web_contents()
->GetPrimaryMainFrame()
->GetProcess()
->GetID()
.GetUnsafeValue();
}
base::ProcessId WebContents::GetOSProcessID() const {
@ -2594,7 +2643,8 @@ int WebContents::GetHistoryLength() const {
}
const std::string WebContents::GetWebRTCIPHandlingPolicy() const {
return web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy;
return blink::ToString(
web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy);
}
void WebContents::SetWebRTCIPHandlingPolicy(
@ -2602,7 +2652,7 @@ void WebContents::SetWebRTCIPHandlingPolicy(
if (GetWebRTCIPHandlingPolicy() == webrtc_ip_handling_policy)
return;
web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy =
webrtc_ip_handling_policy;
blink::ToWebRTCIPHandlingPolicy(webrtc_ip_handling_policy);
web_contents()->SyncRendererPrefs();
}
@ -2662,8 +2712,9 @@ std::string WebContents::GetMediaSourceID(
content::DesktopMediaID media_id(
content::DesktopMediaID::TYPE_WEB_CONTENTS,
content::DesktopMediaID::kNullId,
content::WebContentsMediaCaptureId(frame_host->GetProcess()->GetID(),
frame_host->GetRoutingID()));
content::WebContentsMediaCaptureId(
frame_host->GetProcess()->GetDeprecatedID(),
frame_host->GetRoutingID()));
auto* request_frame_host = request_web_contents->GetPrimaryMainFrame();
if (!request_frame_host)
@ -2671,7 +2722,7 @@ std::string WebContents::GetMediaSourceID(
std::string id =
content::DesktopStreamsRegistry::GetInstance()->RegisterStream(
request_frame_host->GetProcess()->GetID(),
request_frame_host->GetProcess()->GetDeprecatedID(),
request_frame_host->GetRoutingID(),
url::Origin::Create(request_frame_host->GetLastCommittedURL()
.DeprecatedGetOriginAsURL()),

View file

@ -55,6 +55,10 @@ class ScriptExecutor;
}
#endif
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
#include "components/spellcheck/common/spellcheck_common.h"
#endif
namespace blink {
struct DeviceEmulationParams;
// enum class PermissionType;
@ -183,7 +187,7 @@ class WebContents final : public ExclusiveAccessContext,
bool GetBackgroundThrottling() const override;
void SetBackgroundThrottling(bool allowed);
int GetProcessID() const;
int32_t GetProcessID() const;
base::ProcessId GetOSProcessID() const;
[[nodiscard]] Type type() const { return type_; }
bool Equal(const WebContents* web_contents) const;
@ -795,6 +799,14 @@ class WebContents final : public ExclusiveAccessContext,
// Update the html fullscreen flag in both browser and renderer.
void UpdateHtmlApiFullscreen(bool fullscreen);
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
void OnGetPlatformSuggestionsComplete(
content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params,
const spellcheck::PerLanguageSuggestions&
platform_per_language_suggestions);
#endif
v8::Global<v8::Value> session_;
v8::Global<v8::Value> devtools_web_contents_;
v8::Global<v8::Value> debugger_;

View file

@ -362,10 +362,10 @@ base::ProcessId WebFrameMain::OSProcessID() const {
return base::GetProcId(process_handle);
}
int WebFrameMain::ProcessID() const {
int32_t WebFrameMain::ProcessID() const {
if (!CheckRenderFrame())
return -1;
return render_frame_->GetProcess()->GetID();
return render_frame_->GetProcess()->GetID().GetUnsafeValue();
}
int WebFrameMain::RoutingID() const {

View file

@ -122,7 +122,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
content::FrameTreeNodeId FrameTreeNodeID() const;
std::string Name() const;
base::ProcessId OSProcessID() const;
int ProcessID() const;
int32_t ProcessID() const;
int RoutingID() const;
GURL URL() const;
std::string Origin() const;

View file

@ -10,6 +10,7 @@
#include <string>
#include "components/keyed_service/core/keyed_service.h"
#include "content/public/browser/child_process_id.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "third_party/blink/public/mojom/badging/badging.mojom.h"
#include "url/gurl.h"
@ -59,30 +60,31 @@ class BadgeManager : public KeyedService, public blink::mojom::BadgeService {
// The BindingContext for Window execution contexts.
class FrameBindingContext final : public BindingContext {
public:
FrameBindingContext(int process_id, int frame_id)
FrameBindingContext(content::ChildProcessId process_id, int frame_id)
: process_id_(process_id), frame_id_(frame_id) {}
~FrameBindingContext() override = default;
int GetProcessId() { return process_id_; }
content::ChildProcessId GetProcessId() { return process_id_; }
int GetFrameId() { return frame_id_; }
private:
int process_id_;
content::ChildProcessId process_id_;
int frame_id_;
};
// The BindingContext for ServiceWorkerGlobalScope execution contexts.
class ServiceWorkerBindingContext final : public BindingContext {
public:
ServiceWorkerBindingContext(int process_id, const GURL& scope)
ServiceWorkerBindingContext(content::ChildProcessId process_id,
const GURL& scope)
: process_id_(process_id), scope_(scope) {}
~ServiceWorkerBindingContext() override = default;
int GetProcessId() { return process_id_; }
content::ChildProcessId GetProcessId() { return process_id_; }
GURL GetScope() { return scope_; }
private:
int process_id_;
content::ChildProcessId process_id_;
GURL scope_;
};

View file

@ -285,7 +285,7 @@ RenderProcessHostPrivilege GetProcessPrivilege(
content::RenderProcessHost* process_host,
extensions::ProcessMap* process_map) {
std::optional<extensions::ExtensionId> extension_id =
process_map->GetExtensionIdForProcess(process_host->GetID());
process_map->GetExtensionIdForProcess(process_host->GetDeprecatedID());
if (!extension_id.has_value())
return RenderProcessHostPrivilege::kNormal;
@ -357,7 +357,7 @@ ElectronBrowserClient::~ElectronBrowserClient() {
}
content::WebContents* ElectronBrowserClient::GetWebContentsFromProcessID(
int process_id) {
content::ChildProcessId process_id) {
// If the process is a pending process, we should use the web contents
// for the frame host passed into RegisterPendingProcess.
const auto iter = pending_processes_.find(process_id);
@ -376,7 +376,8 @@ content::SiteInstance* ElectronBrowserClient::GetSiteInstanceFromAffinity(
return nullptr;
}
bool ElectronBrowserClient::IsRendererSubFrame(int process_id) const {
bool ElectronBrowserClient::IsRendererSubFrame(
content::ChildProcessId process_id) const {
return base::Contains(renderer_is_subframe_, process_id);
}
@ -570,13 +571,15 @@ void ElectronBrowserClient::AppendExtraCommandLineSwitches(
command_line->AppendSwitch("profile-electron-init");
}
content::ChildProcessId unsafe_process_id =
content::ChildProcessId::FromUnsafeValue(process_id);
content::WebContents* web_contents =
GetWebContentsFromProcessID(process_id);
GetWebContentsFromProcessID(unsafe_process_id);
if (web_contents) {
auto* web_preferences = WebContentsPreferences::From(web_contents);
if (web_preferences)
web_preferences->AppendCommandLineSwitches(
command_line, IsRendererSubFrame(process_id));
command_line, IsRendererSubFrame(unsafe_process_id));
}
}
}
@ -724,7 +727,8 @@ void ElectronBrowserClient::SiteInstanceGotProcessAndSite(
return;
extensions::ProcessMap::Get(browser_context)
->Insert(extension->id(), site_instance->GetProcess()->GetID());
->Insert(extension->id(),
site_instance->GetProcess()->GetDeprecatedID());
}
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
}
@ -851,7 +855,7 @@ void ElectronBrowserClient::WebNotificationAllowed(
void ElectronBrowserClient::RenderProcessHostDestroyed(
content::RenderProcessHost* host) {
int process_id = host->GetID();
content::ChildProcessId process_id = host->GetID();
pending_processes_.erase(process_id);
renderer_is_subframe_.erase(process_id);
host->RemoveObserver(this);
@ -1283,7 +1287,7 @@ void ElectronBrowserClient::CreateWebSocket(
ProxyingWebSocket::StartProxying(
web_request.get(), std::move(factory), url, site_for_cookies, user_agent,
std::move(handshake_client), true, frame->GetProcess()->GetID(),
std::move(handshake_client), true, frame->GetProcess()->GetDeprecatedID(),
frame->GetRoutingID(), frame->GetLastCommittedOrigin(), browser_context,
&next_id_);
}
@ -1483,7 +1487,7 @@ void ElectronBrowserClient::
&render_frame_host));
#endif
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
int render_process_id = render_frame_host.GetProcess()->GetID();
int render_process_id = render_frame_host.GetProcess()->GetDeprecatedID();
associated_registry.AddInterface<extensions::mojom::EventRouter>(
base::BindRepeating(&extensions::EventRouter::BindForRenderer,
render_process_id));
@ -1535,8 +1539,8 @@ void ElectronBrowserClient::BindHostReceiverForRenderer(
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
if (auto host_receiver =
receiver.As<spellcheck::mojom::SpellCheckInitializationHost>()) {
SpellCheckInitializationHostImpl::Create(render_process_host->GetID(),
std::move(host_receiver));
SpellCheckInitializationHostImpl::Create(
render_process_host->GetDeprecatedID(), std::move(host_receiver));
return;
}
#endif
@ -1582,7 +1586,7 @@ void ElectronBrowserClient::ExposeInterfacesToRenderer(
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
associated_registry->AddInterface<extensions::mojom::RendererHost>(
base::BindRepeating(&extensions::RendererStartupHelper::BindForRenderer,
render_process_host->GetID()));
render_process_host->GetDeprecatedID()));
#endif
}
@ -1599,8 +1603,8 @@ void ElectronBrowserClient::RegisterBrowserInterfaceBindersForFrame(
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));
SpellCheckHostChromeImpl::Create(
frame_host->GetProcess()->GetDeprecatedID(), std::move(receiver));
}));
#endif
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)

View file

@ -66,7 +66,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
void set_delegate(Delegate* delegate) { delegate_ = delegate; }
// Returns the WebContents for pending render processes.
content::WebContents* GetWebContentsFromProcessID(int process_id);
content::WebContents* GetWebContentsFromProcessID(
content::ChildProcessId process_id);
NotificationPresenter* GetNotificationPresenter();
@ -327,12 +328,13 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
const GURL& url,
content::RenderFrameHost* rfh) const;
bool IsRendererSubFrame(int process_id) const;
bool IsRendererSubFrame(content::ChildProcessId process_id) const;
// pending_render_process => web contents.
base::flat_map<int, content::WebContents*> pending_processes_;
base::flat_map<content::ChildProcessId, content::WebContents*>
pending_processes_;
base::flat_set<int> renderer_is_subframe_;
base::flat_set<content::ChildProcessId> renderer_is_subframe_;
std::unique_ptr<PlatformNotificationService> notification_service_;
std::unique_ptr<NotificationPresenter> notification_presenter_;

View file

@ -689,8 +689,8 @@ void ElectronBrowserContext::DisplayMediaDeviceChosen(
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
blink::MediaStreamDevice video_device(
request.video_type,
content::WebContentsMediaCaptureId(rfh->GetProcess()->GetID(),
rfh->GetRoutingID())
content::WebContentsMediaCaptureId(
rfh->GetProcess()->GetDeprecatedID(), rfh->GetRoutingID())
.ToString(),
base::UTF16ToUTF8(web_contents->GetTitle()));
video_device.display_media_info = DesktopMediaIDToDisplayMediaInformation(
@ -730,9 +730,9 @@ void ElectronBrowserContext::DisplayMediaDeviceChosen(
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
blink::MediaStreamDevice audio_device(
request.audio_type,
content::WebContentsMediaCaptureId(rfh->GetProcess()->GetID(),
rfh->GetRoutingID(),
disable_local_echo)
content::WebContentsMediaCaptureId(
rfh->GetProcess()->GetDeprecatedID(), rfh->GetRoutingID(),
disable_local_echo)
.ToString(),
"Tab audio");
audio_device.display_media_info = DesktopMediaIDToDisplayMediaInformation(

View file

@ -193,7 +193,7 @@ void ElectronPermissionManager::RequestPermissionsWithDetails(
if (permission == blink::PermissionType::MIDI_SYSEX) {
content::ChildProcessSecurityPolicy::GetInstance()
->GrantSendMidiSysExMessage(
render_frame_host->GetProcess()->GetID());
render_frame_host->GetProcess()->GetDeprecatedID());
} else if (permission == blink::PermissionType::GEOLOCATION) {
ElectronBrowserMainParts::Get()
->GetGeolocationControl()

View file

@ -19,8 +19,11 @@
#include "third_party/blink/public/common/features.h"
#if BUILDFLAG(IS_MAC)
#include "content/common/features.h" // nogncheck
#include "device/base/features.h" // nogncheck
#include "device/base/features.h" // nogncheck
#endif
#if BUILDFLAG(ENABLE_PDF_VIEWER)
#include "pdf/pdf_features.h"
#endif
namespace electron {
@ -40,19 +43,18 @@ void InitializeFeatureList() {
#if BUILDFLAG(IS_WIN)
disable_features +=
// Disable async spellchecker suggestions for Windows, which causes
// an empty suggestions list to be returned
std::string(",") + spellcheck::kWinRetrieveSuggestionsOnlyOnDemand.name +
// Delayed spellcheck initialization is causing the
// 'custom dictionary word list API' spec to crash.
std::string(",") + spellcheck::kWinDelaySpellcheckServiceInit.name;
#endif
#if BUILDFLAG(IS_MAC)
// Disable window occlusion checker.
disable_features +=
std::string(",") + features::kMacWebContentsOcclusion.name;
#if BUILDFLAG(ENABLE_PDF_VIEWER)
// Enable window.showSaveFilePicker api for saving pdf files.
// Refs https://issues.chromium.org/issues/373852607
enable_features +=
std::string(",") + chrome_pdf::features::kPdfUseShowSaveFilePicker.name;
#endif
std::string platform_specific_enable_features =
EnablePlatformSpecificFeatures();
if (platform_specific_enable_features.size() > 0) {

View file

@ -1174,7 +1174,9 @@ bool NativeWindowViews::IsKiosk() const {
bool NativeWindowViews::IsTabletMode() const {
#if BUILDFLAG(IS_WIN)
return base::win::IsWindows10OrGreaterTabletMode(GetAcceleratedWidget());
// TODO: Prefer the async version base::win::IsDeviceInTabletMode
// which requires making the public api async.
return base::win::IsWindows10TabletMode(GetAcceleratedWidget());
#else
return false;
#endif

View file

@ -111,6 +111,7 @@ void URLLoaderNetworkObserver::OnSharedStorageHeaderReceived(
const url::Origin& request_origin,
std::vector<network::mojom::SharedStorageModifierMethodWithOptionsPtr>
methods,
const std::optional<std::string>& with_lock,
OnSharedStorageHeaderReceivedCallback callback) {
std::move(callback).Run();
}

View file

@ -52,6 +52,7 @@ class URLLoaderNetworkObserver
const url::Origin& request_origin,
std::vector<network::mojom::SharedStorageModifierMethodWithOptionsPtr>
methods,
const std::optional<std::string>& with_lock,
OnSharedStorageHeaderReceivedCallback callback) override;
void OnDataUseUpdate(int32_t network_traffic_annotation_id_hash,
int64_t recv_bytes,

View file

@ -18,7 +18,7 @@
NetworkHintsHandlerImpl::NetworkHintsHandlerImpl(
content::RenderFrameHost* frame_host)
: network_hints::SimpleNetworkHintsHandlerImpl(
frame_host->GetProcess()->GetID(),
frame_host->GetProcess()->GetDeprecatedID(),
frame_host->GetRoutingID()),
browser_context_(frame_host->GetProcess()->GetBrowserContext()) {}

View file

@ -980,7 +980,8 @@ void OffScreenRenderWidgetHostView::ResizeRootLayer(bool force) {
viz::FrameSinkId OffScreenRenderWidgetHostView::AllocateFrameSinkId() {
return viz::FrameSinkId(
base::checked_cast<uint32_t>(render_widget_host_->GetProcess()->GetID()),
base::checked_cast<uint32_t>(
render_widget_host_->GetProcess()->GetDeprecatedID()),
base::checked_cast<uint32_t>(render_widget_host_->GetRoutingID()));
}

View file

@ -603,7 +603,7 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() {
// process. Grant the devtools process the ability to request URLs from the
// extension.
content::ChildProcessSecurityPolicy::GetInstance()->GrantRequestOrigin(
web_contents_->GetPrimaryMainFrame()->GetProcess()->GetID(),
web_contents_->GetPrimaryMainFrame()->GetProcess()->GetDeprecatedID(),
url::Origin::Create(extension->url()));
base::Value::Dict extension_info;

View file

@ -68,14 +68,8 @@ constexpr std::string_view kSupportedApiTypesField = "supportedApiTypes";
constexpr std::string_view kTreeField = "tree";
constexpr std::string_view kTypeField = "type";
constexpr std::string_view kUrlField = "url";
constexpr std::string_view kWidgetsField = "widgets";
constexpr std::string_view kApiTypeField = "apiType";
#if defined(USE_AURA)
constexpr std::string_view kWidgetIdField = "widgetId";
constexpr std::string_view kWidget = "widget";
#endif
// Global flags
constexpr std::string_view kBrowser = "browser";
constexpr std::string_view kCopyTree = "copyTree";
@ -87,7 +81,6 @@ constexpr std::string_view kPDFPrinting = "pdfPrinting";
constexpr std::string_view kScreenReader = "screenreader";
constexpr std::string_view kShowOrRefreshTree = "showOrRefreshTree";
constexpr std::string_view kText = "text";
constexpr std::string_view kViewsAccessibility = "viewsAccessibility";
constexpr std::string_view kWeb = "web";
// Possible global flag values
@ -140,8 +133,8 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
}
return BuildTargetDescriptor(url, title, favicon_url,
rvh->GetProcess()->GetID(), rvh->GetRoutingID(),
accessibility_mode);
rvh->GetProcess()->GetDeprecatedID(),
rvh->GetRoutingID(), accessibility_mode);
}
base::Value::Dict BuildTargetDescriptor(electron::NativeWindow* window) {
@ -152,19 +145,6 @@ base::Value::Dict BuildTargetDescriptor(electron::NativeWindow* window) {
return target_data;
}
#if defined(USE_AURA)
base::Value::Dict BuildTargetDescriptor(views::Widget* widget) {
base::Value::Dict widget_data;
widget_data.Set(kNameField, widget->widget_delegate()->GetWindowTitle());
widget_data.Set(kTypeField, kWidget);
// Use the Widget's root view ViewAccessibility's unique ID for lookup.
int32_t id = widget->GetRootView()->GetViewAccessibility().GetUniqueId();
widget_data.Set(kWidgetIdField, id);
return widget_data;
}
#endif // defined(USE_AURA)
bool ShouldHandleAccessibilityRequestCallback(const std::string& path) {
return path == kTargetsDataFile;
}
@ -205,10 +185,6 @@ void HandleAccessibilityRequestCallback(
// The "pdfPrinting" flag is independent of the others.
data.Set(kPDFPrinting, pdf_printing ? kOn : kOff);
// The "Top Level Widgets" section is only relevant if views accessibility is
// enabled.
data.Set(kViewsAccessibility, features::IsAccessibilityTreeForViewsEnabled());
std::string pref_api_type =
std::string(pref->GetString(prefs::kShownAccessibilityApiType));
bool pref_api_type_supported = false;
@ -282,19 +258,6 @@ void HandleAccessibilityRequestCallback(
}
data.Set(kBrowsersField, std::move(window_list));
base::Value::List widgets_list;
#if defined(USE_AURA)
if (features::IsAccessibilityTreeForViewsEnabled()) {
views::WidgetAXTreeIDMap& manager_map =
views::WidgetAXTreeIDMap::GetInstance();
const std::vector<views::Widget*> widgets = manager_map.GetWidgets();
for (views::Widget* widget : widgets) {
widgets_list.Append(BuildTargetDescriptor(widget));
}
}
#endif // defined(USE_AURA)
data.Set(kWidgetsField, std::move(widgets_list));
std::move(callback).Run(base::MakeRefCounted<base::RefCountedString>(
base::WriteJson(data).value_or("")));
}

View file

@ -283,7 +283,7 @@ bool WebContentsPreferences::IsSandboxed() const {
// static
content::WebContents* WebContentsPreferences::GetWebContentsFromProcessID(
int process_id) {
content::ChildProcessId process_id) {
for (WebContentsPreferences* preferences : Instances()) {
content::WebContents* web_contents = preferences->web_contents_;
if (web_contents->GetPrimaryMainFrame()->GetProcess()->GetID() ==

View file

@ -85,7 +85,8 @@ class WebContentsPreferences
friend class ElectronBrowserClient;
// Get WebContents according to process ID.
static content::WebContents* GetWebContentsFromProcessID(int process_id);
static content::WebContents* GetWebContentsFromProcessID(
content::ChildProcessId process_id);
void Clear();
void SaveLastPreferences();

View file

@ -31,8 +31,9 @@ void WebViewGuestDelegate::AttachToIframe(
int embedder_frame_id) {
embedder_web_contents_ = embedder_web_contents;
int embedder_process_id =
embedder_web_contents_->GetPrimaryMainFrame()->GetProcess()->GetID();
int embedder_process_id = embedder_web_contents_->GetPrimaryMainFrame()
->GetProcess()
->GetDeprecatedID();
auto* embedder_frame =
content::RenderFrameHost::FromID(embedder_process_id, embedder_frame_id);
DCHECK_EQ(embedder_web_contents_,

View file

@ -469,6 +469,7 @@ void SimpleURLLoaderWrapper::OnSharedStorageHeaderReceived(
const url::Origin& request_origin,
std::vector<network::mojom::SharedStorageModifierMethodWithOptionsPtr>
methods,
const std::optional<std::string>& with_lock,
OnSharedStorageHeaderReceivedCallback callback) {
std::move(callback).Run();
}

View file

@ -116,6 +116,7 @@ class SimpleURLLoaderWrapper final
const url::Origin& request_origin,
std::vector<network::mojom::SharedStorageModifierMethodWithOptionsPtr>
methods,
const std::optional<std::string>& with_lock,
OnSharedStorageHeaderReceivedCallback callback) override;
void OnDataUseUpdate(int32_t network_traffic_annotation_id_hash,
int64_t recv_bytes,

View file

@ -88,8 +88,7 @@ v8::Local<v8::Value> Converter<blink::mojom::MenuItem::Type>::ToV8(
v8::Local<v8::Value> Converter<ContextMenuParamsWithRenderFrameHost>::ToV8(
v8::Isolate* isolate,
const ContextMenuParamsWithRenderFrameHost& val) {
const auto& params = val.first;
content::RenderFrameHost* render_frame_host = val.second;
auto [params, render_frame_host, optional_suggestions] = val;
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
dict.SetGetter("frame", render_frame_host, v8::DontEnum);
dict.Set("x", params.x);
@ -114,7 +113,11 @@ v8::Local<v8::Value> Converter<ContextMenuParamsWithRenderFrameHost>::ToV8(
dict.Set("misspelledWord", params.misspelled_word);
dict.Set("selectionRect", params.selection_rect);
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
dict.Set("dictionarySuggestions", params.dictionary_suggestions);
if (optional_suggestions) {
dict.Set("dictionarySuggestions", optional_suggestions.value());
} else {
dict.Set("dictionarySuggestions", params.dictionary_suggestions);
}
dict.Set("spellcheckEnabled", params.spellcheck_enabled);
#else
dict.Set("spellcheckEnabled", false);

View file

@ -26,7 +26,9 @@ struct NativeWebKeyboardEvent;
}
using ContextMenuParamsWithRenderFrameHost =
std::pair<content::ContextMenuParams, content::RenderFrameHost*>;
std::tuple<content::ContextMenuParams,
content::RenderFrameHost*,
std::optional<std::vector<std::u16string>>>;
namespace gin {

View file

@ -56,7 +56,7 @@ Converter<gin_helper::AccessorValue<content::RenderFrameHost*>>::ToV8(
if (!rfh)
return v8::Null(isolate);
const int process_id = rfh->GetProcess()->GetID();
const int32_t process_id = rfh->GetProcess()->GetID().GetUnsafeValue();
const int routing_id = rfh->GetRoutingID();
if (rfh_templ.IsEmpty()) {