chore: bump chromium to 146.0.7666.0 (main) (#49528)

* chore: bump chromium in DEPS to 146.0.7652.0

* fix(patch-conflict): update mas_avoid_private_macos_api_usage context for constrainFrameRect method

The upstream CL added a new constrainFrameRect:toScreen: method override to
NativeWidgetMacNSWindow as part of headless mode window zoom implementation.
The MAS patch's #endif for frameViewClassForStyleMask now correctly appears
after that method, since constrainFrameRect is a public API override that
doesn't need to be guarded.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7487666

* fix(patch-conflict): update printing.patch for base::DictValue rename

Updated printing.patch to use the new base::DictValue type name instead of
base::Value::Dict following Chromium's type renaming change. This affects
CompleteUpdatePrintSettings() signature and related code.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509820

* fix(patch-conflict): update accessibility_ui patch for base::DictValue/ListValue rename

Updated adjust_accessibility_ui_for_electron.patch to use the new
base::DictValue and base::ListValue type names instead of base::Value::Dict
and base::Value::List following Chromium's type renaming change.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509820

* chore: update patches

* 6625736: Rename DURABLE_STORAGE to PERSISTENT_STORAGE for consistency | https://chromium-review.googlesource.com/c/chromium/src/+/6625736

* chore: bump chromium in DEPS to 146.0.7653.0

* chore: update patches

* 7000847: add type tag to v8::External for gin_helper function templates

The upstream gin function templates now use v8::ExternalPointerTypeTag
for type safety when using v8::External. Updated Electron's forked
gin_helper function template to use the same kGinInternalCallbackHolderBaseTag
that Chromium's gin uses.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7000847

* fix(patch-update): extend V8 Object API deprecation patch for Node.js

Extended the existing patch to cover additional files that use
GetAlignedPointerFromInternalField and SetAlignedPointerInInternalField:
- src/stream_base-inl.h
- src/udp_wrap.cc
- src/js_udp_wrap.cc
- src/node_process_methods.cc
- src/node_snapshotable.cc
- src/base_object.cc

These APIs now require an EmbedderDataTypeTag parameter.

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7087956

* 7000847: add type tag to v8::External calls in shared_texture

Updated v8::External::New and v8::External::Value calls to use the
kExternalPointerTypeTagDefault tag as required by the V8 API change
that deprecates the tagless versions.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7000847

* 7508687: use ChildProcessId for file permission APIs

The ChildProcessSecurityPolicy::CanReadFile and GrantReadFile APIs
now require ChildProcessId instead of int. Updated to use GetID()
instead of GetDeprecatedID() for these specific calls.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7508687

* 7000847: add type tag to v8::External calls in callback and osr_converter

The v8::External API now requires an EmbedderPointerTypeTag parameter
for both New() and Value() methods to improve V8 sandbox type safety.

Updated calls in:
- callback.cc: TranslatorHolder constructor and CallTranslator
- osr_converter.cc: OffscreenSharedTextureValue converter

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7000847

* fixup! 7087956: [api] Promote deprecation of v8::Context and v8::Object API methods

Extended the Node.js patch to cover histogram.cc which also uses
SetAlignedPointerInInternalField and GetAlignedPointerFromInternalField
APIs that now require the EmbedderDataTypeTag parameter.

Ref: https://chromium-review.googlesource.com/c/v8/v8/+/7087956

* chore: bump chromium in DEPS to 146.0.7655.0

* chore: update patches

* 7509043: update WebSpellingMarker type for API change

The upstream Chromium API changed - WebSpellingMarker was moved from a
nested type within WebTextCheckClient to a standalone type in the blink
namespace.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7509043

* 7498491: update process_id to use OriginatingProcess type

The upstream Chromium API changed - URLLoaderFactoryParams::process_id
was changed from an integer to a union type network::OriginatingProcess
that distinguishes between browser and renderer processes.

- For browser process requests, use OriginatingProcess::browser()
- For renderer process lookups, check !is_browser() and use
  renderer_process().value() to get the child_id

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7498491

* 5710330: Add crash keys to debug NativeWidgetMacNSWindowBorderlessFrame exception | https://chromium-review.googlesource.com/c/chromium/src/+/5710330

5710330 added a new NSNextStepFrame interface extension and
implementations for NativeWidgetMacNSWindowTitledFrame and
NativeWidgetMacNSWindowBorderlessFrame. These use private macOS APIs
that are not available in Mac App Store builds.

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7661.0

* chore: bump chromium in DEPS to 146.0.7663.0

* fix(patch-conflict): update accessibility_ui for string_view API change

Upstream removed redundant std::string(default_api_type) conversion as part
of a string_view optimization cleanup. Updated patch context to match.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7514107

* fix(patch-conflict): update service process launch options for sandbox API refactor

Upstream removed content/common/sandbox_init_win.cc and
content/public/common/sandbox_init_win.h, moving the functionality directly
into ChildProcessLauncherHelper. Updated patch to call
sandbox::policy::SandboxWin::StartSandboxedProcess directly with the
LaunchOptions pointer instead of going through the removed helper.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7528253

* fix(patch-conflict): update MAS safestorage for keychain API refactor

Upstream refactored KeychainPassword::GetPassword() to use a new
GetPasswordImpl() helper function with improved error tracking via
base::expected<std::string, OSStatus>. Adapted patch to use the new
GetPasswordImpl with the suffixed account name and handle migration
from legacy accounts through the new API.

Ref: https://chromium-review.googlesource.com/c/chromium/src/+/7516438

* chore: update patches

* chore: bump chromium in DEPS to 146.0.7663.0

* fix: base::Value::Dict -> base::DictValue
https://chromium-review.googlesource.com/c/chromium/src/+/7513889

* fix: include new cookie exclusion reason
https://chromium-review.googlesource.com/c/chromium/src/+/7486527

* fix: enable libc++ ABI flag for trivially copyable std::vector<bool>

Required for changes introduced in the following CL
https://chromium-review.googlesource.com/c/chromium/src/+/7513653

* fixup! fix: base::Value::Dict -> base::DictValue https://chromium-review.googlesource.com/c/chromium/src/+/7513889

* fix: spellcheck not working in tests
https://chromium-review.googlesource.com/c/chromium/src/+/7452579

* fix: cookie test failing due to multiple rejection reasons
https://chromium-review.googlesource.com/c/chromium/src/+/7506629

* fix: macos sizing unmaximized window incorrectly
https://chromium-review.googlesource.com/c/chromium/src/+/7487666

Changes to headless mode caused the unmaximized window to subtract
the height of the menubar.

* fix: skip tests for incompatible BoringSSL ML-DSA crypto
https://boringssl-review.googlesource.com/c/boringssl/+/84929

* test: fix pseudonymization registration in utility process on Linux

Ref: 7486913: Pass pseudonymization salt via shared memory at process launch | https://chromium-review.googlesource.com/c/chromium/src/+/7486913

* fix: restore MAS patch-outs

Restores some `#if !IS_MAS_BUILD()` gates dropped in 773054ad59

* fixup! 7508687: use ChildProcessId for file permission APIs

* fixup! fix(patch-conflict): update MAS safestorage for keychain API refactor

* chore: add note about parallel upstream change

* fixup! Merge remote-tracking branch 'origin/main' into roller/chromium/main

* Revert "fixup! 7508687: use ChildProcessId for file permission APIs"

This reverts commit 05c43e4e5d.

The _impl version has the signature, but not the public interface. :oof:

* fixup! fix(patch-conflict): update MAS safestorage for keychain API refactor

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
Co-authored-by: Samuel Maddock <samuelmaddock@electronjs.org>
Co-authored-by: clavin <clavin@electronjs.org>
This commit is contained in:
electron-roller[bot]
2026-02-12 12:37:56 -05:00
committed by GitHub
parent e9faa14cc0
commit a65cfed500
180 changed files with 1195 additions and 1267 deletions

View File

@@ -510,7 +510,7 @@ int ImportIntoCertStore(CertificateManagerModel* model, base::Value options) {
net::ScopedCERTCertificateList imported_certs;
int rv = -1;
if (const base::Value::Dict* dict = options.GetIfDict(); dict != nullptr) {
if (const base::DictValue* dict = options.GetIfDict(); dict != nullptr) {
if (const std::string* str = dict->FindString("certificate"); str)
cert_path = *str;
@@ -611,7 +611,7 @@ void App::OnWillFinishLaunching() {
Emit("will-finish-launching");
}
void App::OnFinishLaunching(base::Value::Dict launch_info) {
void App::OnFinishLaunching(base::DictValue launch_info) {
#if BUILDFLAG(IS_LINUX)
// Set the application name for audio streams shown in external
// applications. Only affects pulseaudio currently.
@@ -662,8 +662,8 @@ void App::OnDidFailToContinueUserActivity(const std::string& type,
void App::OnContinueUserActivity(bool* prevent_default,
const std::string& type,
base::Value::Dict user_info,
base::Value::Dict details) {
base::DictValue user_info,
base::DictValue details) {
if (Emit("continue-activity", type, base::Value(std::move(user_info)),
base::Value(std::move(details)))) {
*prevent_default = true;
@@ -671,13 +671,13 @@ void App::OnContinueUserActivity(bool* prevent_default,
}
void App::OnUserActivityWasContinued(const std::string& type,
base::Value::Dict user_info) {
base::DictValue user_info) {
Emit("activity-was-continued", type, base::Value(std::move(user_info)));
}
void App::OnUpdateUserActivityState(bool* prevent_default,
const std::string& type,
base::Value::Dict user_info) {
base::DictValue user_info) {
if (Emit("update-activity-state", type, base::Value(std::move(user_info)))) {
*prevent_default = true;
}
@@ -1584,7 +1584,7 @@ v8::Local<v8::Promise> App::SetProxy(gin::Arguments* args) {
return handle;
}
base::Value::Dict proxy_config;
base::DictValue proxy_config;
switch (proxy_mode) {
case ProxyPrefs::MODE_DIRECT:
proxy_config = ProxyConfigDictionary::CreateDirect();

View File

@@ -106,7 +106,7 @@ class App final : public gin::Wrappable<App>,
void OnOpenURL(const std::string& url) override;
void OnActivate(bool has_visible_windows) override;
void OnWillFinishLaunching() override;
void OnFinishLaunching(base::Value::Dict launch_info) override;
void OnFinishLaunching(base::DictValue launch_info) override;
void OnAccessibilitySupportChanged() override;
void OnPreMainMessageLoopRun() override;
void OnPreCreateThreads() override;
@@ -117,13 +117,13 @@ class App final : public gin::Wrappable<App>,
const std::string& error) override;
void OnContinueUserActivity(bool* prevent_default,
const std::string& type,
base::Value::Dict user_info,
base::Value::Dict details) override;
base::DictValue user_info,
base::DictValue details) override;
void OnUserActivityWasContinued(const std::string& type,
base::Value::Dict user_info) override;
base::DictValue user_info) override;
void OnUpdateUserActivityState(bool* prevent_default,
const std::string& type,
base::Value::Dict user_info) override;
base::DictValue user_info) override;
void OnNewWindowForTab() override;
void OnDidBecomeActive() override;
void OnDidResignActive() override;

View File

@@ -333,7 +333,7 @@ void BaseWindow::OnExecuteAppCommand(const std::string_view command_name) {
}
void BaseWindow::OnTouchBarItemResult(const std::string& item_id,
const base::Value::Dict& details) {
const base::DictValue& details) {
Emit("-touch-bar-interaction", item_id, details);
}

View File

@@ -92,7 +92,7 @@ class BaseWindow : public gin_helper::TrackableObject<BaseWindow>,
void OnWindowAlwaysOnTopChanged() override;
void OnExecuteAppCommand(std::string_view command_name) override;
void OnTouchBarItemResult(const std::string& item_id,
const base::Value::Dict& details) override;
const base::DictValue& details) override;
void OnNewWindowForTab() override;
void OnSystemContextMenu(int x, int y, bool* prevent_default) override;
#if BUILDFLAG(IS_WIN)

View File

@@ -45,7 +45,7 @@ struct Converter<base::trace_event::TraceConfig> {
}
}
base::Value::Dict memory_dump_config;
base::DictValue memory_dump_config;
if (ConvertFromV8(isolate, val, &memory_dump_config)) {
*out = base::trace_event::TraceConfig(std::move(memory_dump_config));
return true;

View File

@@ -108,7 +108,7 @@ namespace electron::api {
namespace {
// Returns whether |cookie| matches |filter|.
bool MatchesCookie(const base::Value::Dict& filter,
bool MatchesCookie(const base::DictValue& filter,
const net::CanonicalCookie& cookie) {
const std::string* str;
if ((str = filter.FindString("name")) && *str != cookie.Name())
@@ -130,7 +130,7 @@ bool MatchesCookie(const base::Value::Dict& filter,
}
// Remove cookies from |list| not matching |filter|, and pass it to |callback|.
void FilterCookies(base::Value::Dict filter,
void FilterCookies(base::DictValue filter,
gin_helper::Promise<net::CookieList> promise,
const net::CookieList& cookies) {
net::CookieList result;
@@ -142,7 +142,7 @@ void FilterCookies(base::Value::Dict filter,
}
void FilterCookieWithStatuses(
base::Value::Dict filter,
base::DictValue filter,
gin_helper::Promise<net::CookieList> promise,
const net::CookieAccessResultList& list,
const net::CookieAccessResultList& excluded_list) {
@@ -236,7 +236,9 @@ const std::string InclusionStatusToString(net::CookieInclusionStatus status) {
"The cookie contains no content or only whitespace."},
{Reason::EXCLUDE_ANONYMOUS_CONTEXT,
"The cookie is unpartitioned and being accessed from an anonymous "
"context."}});
"context."},
{Reason::EXCLUDE_INVALID_PATH,
"The cookie was set with an invalid Path attribute."}});
static_assert(
Reasons.size() ==
net::CookieInclusionStatus::ExclusionReasonBitset::kValueCount,
@@ -310,7 +312,7 @@ v8::Local<v8::Promise> Cookies::Get(v8::Isolate* isolate,
auto* storage_partition = browser_context_->GetDefaultStoragePartition();
auto* manager = storage_partition->GetCookieManagerForBrowserProcess();
base::Value::Dict dict;
base::DictValue dict;
gin::ConvertFromV8(isolate, filter.GetHandle(), &dict);
std::string url;
@@ -359,7 +361,7 @@ v8::Local<v8::Promise> Cookies::Remove(v8::Isolate* isolate,
}
v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
base::Value::Dict details) {
base::DictValue details) {
gin_helper::Promise<void> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();

View File

@@ -54,7 +54,7 @@ class Cookies final : public gin_helper::DeprecatedWrappable<Cookies>,
v8::Local<v8::Promise> Get(v8::Isolate*,
const gin_helper::Dictionary& filter);
v8::Local<v8::Promise> Set(v8::Isolate*, base::Value::Dict details);
v8::Local<v8::Promise> Set(v8::Isolate*, base::DictValue details);
v8::Local<v8::Promise> Remove(v8::Isolate*,
const GURL& url,
const std::string& name);

View File

@@ -53,31 +53,31 @@ void Debugger::DispatchProtocolMessage(DevToolsAgentHost* agent_host,
message_str, base::JSON_REPLACE_INVALID_CHARACTERS);
if (!parsed_message || !parsed_message->is_dict())
return;
base::Value::Dict& dict = parsed_message->GetDict();
base::DictValue& dict = parsed_message->GetDict();
std::optional<int> id = dict.FindInt("id");
if (!id) {
std::string* method = dict.FindString("method");
if (!method)
return;
std::string* session_id = dict.FindString("sessionId");
base::Value::Dict* params = dict.FindDict("params");
Emit("message", *method, params ? std::move(*params) : base::Value::Dict(),
base::DictValue* params = dict.FindDict("params");
Emit("message", *method, params ? std::move(*params) : base::DictValue(),
session_id ? *session_id : "");
} else {
auto it = pending_requests_.find(*id);
if (it == pending_requests_.end())
return;
gin_helper::Promise<base::Value::Dict> promise = std::move(it->second);
gin_helper::Promise<base::DictValue> promise = std::move(it->second);
pending_requests_.erase(it);
base::Value::Dict* error = dict.FindDict("error");
base::DictValue* error = dict.FindDict("error");
if (error) {
std::string* error_message = error->FindString("message");
promise.RejectWithErrorMessage(error_message ? *error_message : "");
} else {
base::Value::Dict* result = dict.FindDict("result");
promise.Resolve(result ? std::move(*result) : base::Value::Dict());
base::DictValue* result = dict.FindDict("result");
promise.Resolve(result ? std::move(*result) : base::DictValue());
}
}
}
@@ -132,7 +132,7 @@ void Debugger::Detach() {
v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
v8::Isolate* isolate = args->isolate();
gin_helper::Promise<base::Value::Dict> promise(isolate);
gin_helper::Promise<base::DictValue> promise(isolate);
v8::Local<v8::Promise> handle = promise.GetHandle();
if (!agent_host_) {
@@ -146,7 +146,7 @@ v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
return handle;
}
base::Value::Dict command_params;
base::DictValue command_params;
args->GetNext(&command_params);
std::string session_id;
@@ -155,7 +155,7 @@ v8::Local<v8::Promise> Debugger::SendCommand(gin::Arguments* args) {
return handle;
}
base::Value::Dict request;
base::DictValue request;
int request_id = ++previous_request_id_;
pending_requests_.emplace(request_id, std::move(promise));
request.Set("id", request_id);

View File

@@ -68,8 +68,7 @@ class Debugger final : public gin::Wrappable<Debugger>,
content::RenderFrameHost* new_rfh) override;
private:
using PendingRequestMap =
std::map<int, gin_helper::Promise<base::Value::Dict>>;
using PendingRequestMap = std::map<int, gin_helper::Promise<base::DictValue>>;
void Attach(gin::Arguments* args);
bool IsAttached();

View File

@@ -133,7 +133,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
auto command_line_string =
base::CommandLine::ForCurrentProcess()->GetCommandLineString();
auto channel_string = std::string("Electron " ELECTRON_VERSION);
base::Value::Dict custom_constants = net_log::GetPlatformConstantsForNetLog(
base::DictValue custom_constants = net_log::GetPlatformConstantsForNetLog(
command_line_string, channel_string);
auto* network_context =
@@ -155,7 +155,7 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
void NetLog::StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode,
uint64_t max_file_size,
base::Value::Dict custom_constants,
base::DictValue custom_constants,
base::File output_file) {
if (!net_log_exporter_) {
// Theoretically the mojo pipe could have been closed by the time we get
@@ -206,7 +206,7 @@ v8::Local<v8::Promise> NetLog::StopLogging(v8::Isolate* const isolate) {
// pointer lives long enough to resolve the promise. Moving it into the
// callback will cause the instance variable to become empty.
net_log_exporter_->Stop(
base::Value::Dict(),
base::DictValue(),
base::BindOnce(
[](mojo::Remote<network::mojom::NetLogExporter>,
gin_helper::Promise<void> promise, int32_t error) {

View File

@@ -67,7 +67,7 @@ class NetLog final : public gin::Wrappable<NetLog> {
void StartNetLogAfterCreateFile(net::NetLogCaptureMode capture_mode,
uint64_t max_file_size,
base::Value::Dict custom_constants,
base::DictValue custom_constants,
base::File output_file);
void NetLogStarted(int32_t error);

View File

@@ -41,7 +41,7 @@ class PushNotifications final
PushNotifications& operator=(const PushNotifications&) = delete;
#if BUILDFLAG(IS_MAC)
void OnDidReceiveAPNSNotification(const base::Value::Dict& user_info);
void OnDidReceiveAPNSNotification(const base::DictValue& user_info);
void ResolveAPNSPromiseSetWithToken(const std::string& token_string);
void RejectAPNSPromiseSetWithError(const std::string& error_message);
#endif

View File

@@ -46,7 +46,7 @@ void PushNotifications::UnregisterForAPNSNotifications() {
}
void PushNotifications::OnDidReceiveAPNSNotification(
const base::Value::Dict& user_info) {
const base::DictValue& user_info) {
Emit("received-apns-notification", user_info);
}

View File

@@ -369,10 +369,10 @@ class ClearDataTask : public gin_helper::CleanedUpAtExit {
std::vector<std::unique_ptr<ClearDataOperation>> operations_;
};
base::Value::Dict createProxyConfig(ProxyPrefs::ProxyMode proxy_mode,
std::string const& pac_url,
std::string const& proxy_server,
std::string const& bypass_list) {
base::DictValue createProxyConfig(ProxyPrefs::ProxyMode proxy_mode,
std::string const& pac_url,
std::string const& proxy_server,
std::string const& bypass_list) {
if (proxy_mode == ProxyPrefs::MODE_DIRECT) {
return ProxyConfigDictionary::CreateDirect();
}
@@ -1579,7 +1579,7 @@ void Session::SetSpellCheckerLanguages(
gin_helper::ErrorThrower thrower,
const std::vector<std::string>& languages) {
#if !BUILDFLAG(IS_MAC)
base::Value::List language_codes;
base::ListValue language_codes;
for (const std::string& lang : languages) {
std::string code = spellcheck::GetCorrespondingSpellCheckLanguage(lang);
if (code.empty()) {
@@ -1738,7 +1738,7 @@ Session* Session::FromOrCreate(v8::Isolate* isolate,
// static
Session* Session::FromPartition(v8::Isolate* isolate,
const std::string& partition,
base::Value::Dict options) {
base::DictValue options) {
ElectronBrowserContext* browser_context;
if (partition.empty()) {
browser_context =
@@ -1757,7 +1757,7 @@ Session* Session::FromPartition(v8::Isolate* isolate,
// static
Session* Session::FromPath(gin::Arguments* args,
const base::FilePath& path,
base::Value::Dict options) {
base::DictValue options) {
ElectronBrowserContext* browser_context;
if (path.empty()) {
@@ -1902,7 +1902,7 @@ Session* FromPartition(const std::string& partition, gin::Arguments* args) {
args->ThrowTypeError("Session can only be received when app is ready");
return {};
}
base::Value::Dict options;
base::DictValue options;
args->GetNext(&options);
return Session::FromPartition(args->isolate(), partition, std::move(options));
}
@@ -1912,7 +1912,7 @@ Session* FromPath(const base::FilePath& path, gin::Arguments* args) {
args->ThrowTypeError("Session can only be received when app is ready");
return {};
}
base::Value::Dict options;
base::DictValue options;
args->GetNext(&options);
return Session::FromPath(args, path, std::move(options));
}

View File

@@ -90,12 +90,12 @@ class Session final : public gin::Wrappable<Session>,
// Gets the Session of |partition|.
static Session* FromPartition(v8::Isolate* isolate,
const std::string& partition,
base::Value::Dict options = {});
base::DictValue options = {});
// Gets the Session based on |path|.
static Session* FromPath(gin::Arguments* args,
const base::FilePath& path,
base::Value::Dict options = {});
base::DictValue options = {});
static void FillObjectTemplate(v8::Isolate*, v8::Local<v8::ObjectTemplate>);
static const char* GetClassName() { return "Session"; }

View File

@@ -77,25 +77,25 @@ class SystemPreferences final
void OnWndProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam);
// BrowserObserver:
void OnFinishLaunching(base::Value::Dict launch_info) override;
void OnFinishLaunching(base::DictValue launch_info) override;
#elif BUILDFLAG(IS_MAC)
using NotificationCallback = base::RepeatingCallback<
void(const std::string&, base::Value, const std::string&)>;
void PostNotification(const std::string& name,
base::Value::Dict user_info,
base::DictValue user_info,
gin::Arguments* args);
int SubscribeNotification(v8::Local<v8::Value> maybe_name,
const NotificationCallback& callback);
void UnsubscribeNotification(int id);
void PostLocalNotification(const std::string& name,
base::Value::Dict user_info);
base::DictValue user_info);
int SubscribeLocalNotification(v8::Local<v8::Value> maybe_name,
const NotificationCallback& callback);
void UnsubscribeLocalNotification(int request_id);
void PostWorkspaceNotification(const std::string& name,
base::Value::Dict user_info);
base::DictValue user_info);
int SubscribeWorkspaceNotification(v8::Local<v8::Value> maybe_name,
const NotificationCallback& callback);
void UnsubscribeWorkspaceNotification(int request_id);

View File

@@ -129,7 +129,7 @@ NSNotificationCenter* GetNotificationCenter(NotificationCenterKind kind) {
} // namespace
void SystemPreferences::PostNotification(const std::string& name,
base::Value::Dict user_info,
base::DictValue user_info,
gin::Arguments* args) {
bool immediate = false;
args->GetNext(&immediate);
@@ -157,7 +157,7 @@ void SystemPreferences::UnsubscribeNotification(int request_id) {
}
void SystemPreferences::PostLocalNotification(const std::string& name,
base::Value::Dict user_info) {
base::DictValue user_info) {
NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
[center
postNotificationName:base::SysUTF8ToNSString(name)
@@ -178,7 +178,7 @@ void SystemPreferences::UnsubscribeLocalNotification(int request_id) {
}
void SystemPreferences::PostWorkspaceNotification(const std::string& name,
base::Value::Dict user_info) {
base::DictValue user_info) {
NSNotificationCenter* center =
[[NSWorkspace sharedWorkspace] notificationCenter];
[center
@@ -236,7 +236,7 @@ int SystemPreferences::DoSubscribeNotification(
} else {
copied_callback.Run(
base::SysNSStringToUTF8(notification.name),
base::Value(base::Value::Dict()), object);
base::Value(base::DictValue()), object);
}
}];
return request_id;
@@ -285,7 +285,7 @@ v8::Local<v8::Value> SystemPreferences::GetUserDefault(
}
void SystemPreferences::RegisterDefaults(gin::Arguments* args) {
base::Value::Dict dict_value;
base::DictValue dict_value;
if (!args->GetNext(&dict_value)) {
args->ThrowError();

View File

@@ -221,7 +221,7 @@ void SystemPreferences::OnWndProc(HWND hwnd,
Emit("color-changed");
}
void SystemPreferences::OnFinishLaunching(base::Value::Dict launch_info) {
void SystemPreferences::OnFinishLaunching(base::DictValue launch_info) {
hwnd_subscription_ =
gfx::SingletonHwnd::GetInstance()->RegisterCallback(base::BindRepeating(
&SystemPreferences::OnWndProc, base::Unretained(this)));

View File

@@ -19,6 +19,7 @@
#include "content/public/common/result_codes.h"
#include "gin/object_template_builder.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "services/network/public/cpp/originating_process.h"
#include "shell/browser/api/message_port.h"
#include "shell/browser/browser.h"
#include "shell/browser/javascript_environment.h"
@@ -214,7 +215,7 @@ UtilityProcessWrapper::UtilityProcessWrapper(
mojo::PendingRemote<network::mojom::URLLoaderFactory> url_loader_factory;
network::mojom::URLLoaderFactoryParamsPtr loader_params =
network::mojom::URLLoaderFactoryParams::New();
loader_params->process_id = pid_;
loader_params->process_id = network::OriginatingProcess::browser();
loader_params->is_orb_enabled = false;
loader_params->is_trusted = true;
if (create_network_observer) {

View File

@@ -68,6 +68,7 @@
#include "content/public/browser/storage_partition.h"
#include "content/public/browser/visibility.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/child_process_id.h"
#include "content/public/common/referrer_type_converters.h"
#include "content/public/common/result_codes.h"
#include "content/public/common/webplugininfo.h"
@@ -642,13 +643,14 @@ std::string RegisterFileSystem(content::WebContents* web_contents,
content::ChildProcessSecurityPolicy::GetInstance();
content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
int renderer_id = render_view_host->GetProcess()->GetDeprecatedID();
content::ChildProcessId process_id = render_view_host->GetProcess()->GetID();
policy->GrantReadFileSystem(renderer_id, file_system.id());
policy->GrantWriteFileSystem(renderer_id, file_system.id());
policy->GrantCreateFileForFileSystem(renderer_id, file_system.id());
policy->GrantDeleteFromFileSystem(renderer_id, file_system.id());
if (!policy->CanReadFile(renderer_id, path))
policy->GrantReadFile(renderer_id, path);
if (!policy->CanReadFile(process_id, path))
policy->GrantReadFile(process_id, path);
return file_system.id();
}
@@ -665,8 +667,8 @@ FileSystem CreateFileSystemStruct(content::WebContents* web_contents,
return FileSystem(type, file_system_name, root_url, file_system_path);
}
base::Value::Dict CreateFileSystemValue(const FileSystem& file_system) {
base::Value::Dict value;
base::DictValue CreateFileSystemValue(const FileSystem& file_system) {
base::DictValue value;
value.Set("type", file_system.type);
value.Set("fileSystemName", file_system.file_system_name);
value.Set("rootURL", file_system.root_url);
@@ -709,7 +711,7 @@ PrefService* GetPrefService(content::WebContents* web_contents) {
}
// returns a Dict of filesystem_path -> type
[[nodiscard]] const base::Value::Dict& GetAddedFileSystems(
[[nodiscard]] const base::DictValue& GetAddedFileSystems(
content::WebContents* web_contents) {
return GetPrefService(web_contents)->GetDict(prefs::kDevToolsFileSystemPaths);
}
@@ -3024,7 +3026,7 @@ bool WebContents::IsCurrentlyAudible() {
namespace {
void OnGetDeviceNameToUse(base::WeakPtr<content::WebContents> web_contents,
base::Value::Dict print_settings,
base::DictValue print_settings,
printing::CompletionCallback print_callback,
// <error, device_name>
std::pair<std::string, std::u16string> info) {
@@ -3103,7 +3105,7 @@ void WebContents::Print(gin::Arguments* const args) {
return;
}
base::Value::Dict settings;
base::DictValue settings;
if (options.IsEmptyObject()) {
content::RenderFrameHost* rfh = GetRenderFrameHostToUse(web_contents());
if (!rfh)
@@ -3134,7 +3136,7 @@ void WebContents::Print(gin::Arguments* const args) {
if (margin_type == printing::mojom::MarginType::kCustomMargins) {
settings.Set(printing::kSettingMarginsCustom,
base::Value::Dict{}
base::DictValue{}
.Set(printing::kSettingMarginTop,
margins.ValueOrDefault("top", 0))
.Set(printing::kSettingMarginBottom,
@@ -3202,11 +3204,11 @@ void WebContents::Print(gin::Arguments* const args) {
// Set custom page ranges to print
std::vector<gin_helper::Dictionary> page_ranges;
if (options.Get("pageRanges", &page_ranges)) {
base::Value::List page_range_list;
base::ListValue page_range_list;
for (auto& range : page_ranges) {
int from, to;
if (range.Get("from", &from) && range.Get("to", &to)) {
base::Value::Dict range_dict;
base::DictValue range_dict;
// Chromium uses 1-based page ranges, so increment each by 1.
range_dict.Set(printing::kSettingPageRangeFrom, from + 1);
range_dict.Set(printing::kSettingPageRangeTo, to + 1);
@@ -3224,13 +3226,13 @@ void WebContents::Print(gin::Arguments* const args) {
"duplexMode", printing::mojom::DuplexMode::kSimplex);
settings.Set(printing::kSettingDuplexMode, static_cast<int>(duplex_mode));
base::Value::Dict media_size;
base::DictValue media_size;
if (options.Get("mediaSize", &media_size)) {
settings.Set(printing::kSettingMediaSize, std::move(media_size));
} else {
// Default to A4 paper size (210mm x 297mm)
settings.Set(printing::kSettingMediaSize,
base::Value::Dict()
base::DictValue()
.Set(printing::kSettingMediaSizeHeightMicrons, 297000)
.Set(printing::kSettingMediaSizeWidthMicrons, 210000)
.Set(printing::kSettingsImageableAreaLeftMicrons, 0)
@@ -4180,9 +4182,9 @@ void WebContents::DevToolsAppendToFile(const std::string& url,
void WebContents::DevToolsRequestFileSystems() {
const std::string empty_str;
content::WebContents* const dtwc = GetDevToolsWebContents();
const base::Value::Dict& added_paths = GetAddedFileSystems(dtwc);
const base::DictValue& added_paths = GetAddedFileSystems(dtwc);
auto filesystems = base::Value::List::with_capacity(added_paths.size());
auto filesystems = base::ListValue::with_capacity(added_paths.size());
for (const auto path_and_type : added_paths) {
const auto& [path, type_val] = path_and_type;
const auto& type = type_val.is_string() ? type_val.GetString() : empty_str;
@@ -4219,7 +4221,7 @@ void WebContents::DevToolsAddFileSystem(
FileSystem file_system = CreateFileSystemStruct(
GetDevToolsWebContents(), file_system_id, path.AsUTF8Unsafe(), type);
base::Value::Dict file_system_value = CreateFileSystemValue(file_system);
base::DictValue file_system_value = CreateFileSystemValue(file_system);
auto* pref_service = GetPrefService(GetDevToolsWebContents());
ScopedDictPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
@@ -4329,7 +4331,7 @@ void WebContents::DevToolsSetEyeDropperActive(bool active) {
}
void WebContents::ColorPickedInEyeDropper(int r, int g, int b, int a) {
base::Value::Dict color;
base::DictValue color;
color.Set("r", r);
color.Set("g", g);
color.Set("b", b);
@@ -4381,7 +4383,7 @@ void WebContents::OnDevToolsSearchCompleted(
int request_id,
const std::string& file_system_path,
const std::vector<std::string>& file_paths) {
base::Value::List file_paths_value;
base::ListValue file_paths_value;
for (const auto& file_path : file_paths)
file_paths_value.Append(file_path);
inspectable_web_contents_->CallClientFunction(

View File

@@ -90,7 +90,7 @@ extensions::WebRequestResourceType ParseResourceType(std::string_view value) {
// to pass the original keys.
v8::Local<v8::Value> HttpResponseHeadersToV8(
net::HttpResponseHeaders* headers) {
base::Value::Dict response_headers;
base::DictValue response_headers;
if (headers) {
size_t iter = 0;
std::string key;

View File

@@ -104,7 +104,7 @@ void GPUInfoEnumerator::EndOverlayInfo() {
value_stack_.pop();
}
base::Value::Dict GPUInfoEnumerator::GetDictionary() {
base::DictValue GPUInfoEnumerator::GetDictionary() {
return std::move(current_);
}

View File

@@ -47,12 +47,12 @@ class GPUInfoEnumerator final : public gpu::GPUInfo::Enumerator {
void EndAuxAttributes() override;
void BeginOverlayInfo() override;
void EndOverlayInfo() override;
base::Value::Dict GetDictionary();
base::DictValue GetDictionary();
private:
// The stack is used to manage nested values
std::stack<base::Value::Dict> value_stack_;
base::Value::Dict current_;
std::stack<base::DictValue> value_stack_;
base::DictValue current_;
};
} // namespace electron

View File

@@ -33,7 +33,7 @@ GPUInfoManager::~GPUInfoManager() {
// Should be posted to the task runner
void GPUInfoManager::ProcessCompleteInfo() {
base::Value::Dict result = EnumerateGPUInfo(gpu_data_manager_->GetGPUInfo());
base::DictValue result = EnumerateGPUInfo(gpu_data_manager_->GetGPUInfo());
// We have received the complete information, resolve all promises that
// were waiting for this info.
for (auto& promise : complete_info_promise_set_) {
@@ -76,8 +76,7 @@ void GPUInfoManager::FetchBasicInfo(gin_helper::Promise<base::Value> promise) {
promise.Resolve(base::Value(EnumerateGPUInfo(gpu_info)));
}
base::Value::Dict GPUInfoManager::EnumerateGPUInfo(
gpu::GPUInfo gpu_info) const {
base::DictValue GPUInfoManager::EnumerateGPUInfo(gpu::GPUInfo gpu_info) const {
GPUInfoEnumerator enumerator;
gpu_info.EnumerateFields(&enumerator);
return enumerator.GetDictionary();

View File

@@ -40,7 +40,7 @@ class GPUInfoManager : private content::GpuDataManagerObserver,
// content::GpuDataManagerObserver
void OnGpuInfoUpdate() override;
base::Value::Dict EnumerateGPUInfo(gpu::GPUInfo gpu_info) const;
base::DictValue EnumerateGPUInfo(gpu::GPUInfo gpu_info) const;
// These should be posted to the task queue
void CompleteInfoFetcher(gin_helper::Promise<base::Value> promise);