mirror of
https://github.com/electron/electron.git
synced 2026-02-19 03:14:51 -05:00
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 in773054ad59* 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 commit05c43e4e5d. 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:
committed by
GitHub
parent
e9faa14cc0
commit
a65cfed500
@@ -66,6 +66,8 @@
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
#include "base/nix/xdg_util.h"
|
||||
#include "base/posix/global_descriptors.h"
|
||||
#include "content/public/common/content_descriptors.h"
|
||||
#include "v8/include/v8-wasm-trap-handler-posix.h"
|
||||
#include "v8/include/v8.h"
|
||||
#endif
|
||||
@@ -240,6 +242,20 @@ void ElectronMainDelegate::PreSandboxStartup() {
|
||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||
std::string process_type = GetProcessType();
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
// Register the pseudonymization salt descriptor in GlobalDescriptors.
|
||||
// (see https://crbug.com/40850085) Only affects processes launched
|
||||
// without the zygote (i.e. utility processes)
|
||||
// TODO: Remove in favor of
|
||||
// https://chromium-review.googlesource.com/c/chromium/src/+/7568382
|
||||
if (!process_type.empty() && !IsZygoteProcess()) {
|
||||
base::GlobalDescriptors::GetInstance()->Set(
|
||||
kPseudonymizationSaltDescriptor,
|
||||
kPseudonymizationSaltDescriptor +
|
||||
base::GlobalDescriptors::kBaseDescriptor);
|
||||
}
|
||||
#endif
|
||||
|
||||
base::FilePath user_data_dir =
|
||||
command_line->GetSwitchValuePath(::switches::kUserDataDir);
|
||||
if (!user_data_dir.empty()) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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"; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -104,7 +104,7 @@ void GPUInfoEnumerator::EndOverlayInfo() {
|
||||
value_stack_.pop();
|
||||
}
|
||||
|
||||
base::Value::Dict GPUInfoEnumerator::GetDictionary() {
|
||||
base::DictValue GPUInfoEnumerator::GetDictionary() {
|
||||
return std::move(current_);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -191,7 +191,7 @@ void ElectronBluetoothDelegate::ShowDevicePairPrompt(
|
||||
|
||||
void ElectronBluetoothDelegate::OnDevicePairPromptResponse(
|
||||
PairPromptCallback callback,
|
||||
base::Value::Dict response) {
|
||||
base::DictValue response) {
|
||||
BluetoothDelegate::PairPromptResult result;
|
||||
if (response.FindBool("confirmed").value_or(false)) {
|
||||
result.result_code = BluetoothDelegate::PairPromptStatus::kSuccess;
|
||||
|
||||
@@ -95,7 +95,7 @@ class ElectronBluetoothDelegate : public content::BluetoothDelegate {
|
||||
|
||||
private:
|
||||
void OnDevicePairPromptResponse(PairPromptCallback callback,
|
||||
base::Value::Dict response);
|
||||
base::DictValue response);
|
||||
|
||||
base::WeakPtrFactory<ElectronBluetoothDelegate> weak_factory_{this};
|
||||
};
|
||||
|
||||
@@ -180,7 +180,7 @@ void Browser::WillFinishLaunching() {
|
||||
observers_.Notify(&BrowserObserver::OnWillFinishLaunching);
|
||||
}
|
||||
|
||||
void Browser::DidFinishLaunching(base::Value::Dict launch_info) {
|
||||
void Browser::DidFinishLaunching(base::DictValue launch_info) {
|
||||
// Make sure the userData directory is created.
|
||||
ScopedAllowBlockingForElectron allow_blocking;
|
||||
base::FilePath user_data;
|
||||
|
||||
@@ -174,7 +174,7 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Creates an activity and sets it as the one currently in use.
|
||||
void SetUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::DictValue user_info,
|
||||
gin::Arguments* args);
|
||||
|
||||
// Returns the type name of the current user activity.
|
||||
@@ -189,7 +189,7 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Updates the current user activity
|
||||
void UpdateCurrentActivity(const std::string& type,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
|
||||
// Indicates that an user activity is about to be resumed.
|
||||
bool WillContinueUserActivity(const std::string& type);
|
||||
@@ -200,16 +200,16 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Resumes an activity via hand-off.
|
||||
bool ContinueUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details);
|
||||
base::DictValue user_info,
|
||||
base::DictValue details);
|
||||
|
||||
// Indicates that an activity was continued on another device.
|
||||
void UserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
|
||||
// Gives an opportunity to update the Handoff payload.
|
||||
bool UpdateUserActivityState(const std::string& type,
|
||||
base::Value::Dict user_info);
|
||||
base::DictValue user_info);
|
||||
|
||||
void ApplyForcedRTL();
|
||||
|
||||
@@ -246,7 +246,7 @@ class Browser : private WindowListObserver {
|
||||
#endif // BUILDFLAG(IS_MAC)
|
||||
|
||||
void ShowAboutPanel();
|
||||
void SetAboutPanelOptions(base::Value::Dict options);
|
||||
void SetAboutPanelOptions(base::DictValue options);
|
||||
|
||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
|
||||
void ShowEmojiPanel();
|
||||
@@ -306,7 +306,7 @@ class Browser : private WindowListObserver {
|
||||
|
||||
// Tell the application the loading has been done.
|
||||
void WillFinishLaunching();
|
||||
void DidFinishLaunching(base::Value::Dict launch_info);
|
||||
void DidFinishLaunching(base::DictValue launch_info);
|
||||
|
||||
void OnAccessibilitySupportChanged();
|
||||
|
||||
@@ -379,7 +379,7 @@ class Browser : private WindowListObserver {
|
||||
bool was_launched_at_login_;
|
||||
#endif
|
||||
|
||||
base::Value::Dict about_panel_options_;
|
||||
base::DictValue about_panel_options_;
|
||||
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
void UpdateBadgeContents(HWND hwnd,
|
||||
|
||||
@@ -180,7 +180,7 @@ void Browser::ShowAboutPanel() {
|
||||
GtkAboutDialog* dialog = GTK_ABOUT_DIALOG(dialogWidget);
|
||||
|
||||
const std::string* str;
|
||||
const base::Value::List* list;
|
||||
const base::ListValue* list;
|
||||
|
||||
if ((str = opts.FindString("applicationName"))) {
|
||||
gtk_about_dialog_set_program_name(dialog, str->c_str());
|
||||
@@ -233,7 +233,7 @@ void Browser::ShowAboutPanel() {
|
||||
gtk_widget_show_all(dialogWidget);
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
|
||||
void Browser::SetAboutPanelOptions(base::DictValue options) {
|
||||
about_panel_options_ = std::move(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ bool Browser::SetBadgeCount(std::optional<int> count) {
|
||||
}
|
||||
|
||||
void Browser::SetUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::DictValue user_info,
|
||||
gin::Arguments* args) {
|
||||
std::string url_string;
|
||||
args->GetNext(&url_string);
|
||||
@@ -330,7 +330,7 @@ void Browser::ResignCurrentActivity() {
|
||||
}
|
||||
|
||||
void Browser::UpdateCurrentActivity(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
[[AtomApplication sharedApplication]
|
||||
updateCurrentActivity:base::SysUTF8ToNSString(type)
|
||||
withUserInfo:DictionaryValueToNSDictionary(
|
||||
@@ -351,8 +351,8 @@ void Browser::DidFailToContinueUserActivity(const std::string& type,
|
||||
}
|
||||
|
||||
bool Browser::ContinueUserActivity(const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue user_info,
|
||||
base::DictValue details) {
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnContinueUserActivity(&prevent_default, type, user_info.Clone(),
|
||||
@@ -361,13 +361,13 @@ bool Browser::ContinueUserActivity(const std::string& type,
|
||||
}
|
||||
|
||||
void Browser::UserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnUserActivityWasContinued(type, user_info.Clone());
|
||||
}
|
||||
|
||||
bool Browser::UpdateUserActivityState(const std::string& type,
|
||||
base::Value::Dict user_info) {
|
||||
base::DictValue user_info) {
|
||||
bool prevent_default = false;
|
||||
for (BrowserObserver& observer : observers_)
|
||||
observer.OnUpdateUserActivityState(&prevent_default, type,
|
||||
@@ -621,7 +621,7 @@ void Browser::ShowAboutPanel() {
|
||||
orderFrontStandardAboutPanelWithOptions:options];
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
|
||||
void Browser::SetAboutPanelOptions(base::DictValue options) {
|
||||
about_panel_options_.clear();
|
||||
|
||||
for (const auto pair : options) {
|
||||
|
||||
@@ -43,7 +43,7 @@ class BrowserObserver : public base::CheckedObserver {
|
||||
|
||||
// The browser has finished loading.
|
||||
virtual void OnWillFinishLaunching() {}
|
||||
virtual void OnFinishLaunching(base::Value::Dict launch_info) {}
|
||||
virtual void OnFinishLaunching(base::DictValue launch_info) {}
|
||||
|
||||
// The browser's accessibility support has changed.
|
||||
virtual void OnAccessibilitySupportChanged() {}
|
||||
@@ -66,15 +66,15 @@ class BrowserObserver : public base::CheckedObserver {
|
||||
// The browser wants to resume a user activity via handoff. (macOS only)
|
||||
virtual void OnContinueUserActivity(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info,
|
||||
base::Value::Dict details) {}
|
||||
base::DictValue user_info,
|
||||
base::DictValue details) {}
|
||||
// The browser wants to notify that an user activity was resumed. (macOS only)
|
||||
virtual void OnUserActivityWasContinued(const std::string& type,
|
||||
base::Value::Dict user_info) {}
|
||||
base::DictValue user_info) {}
|
||||
// The browser wants to update an user activity payload. (macOS only)
|
||||
virtual void OnUpdateUserActivityState(bool* prevent_default,
|
||||
const std::string& type,
|
||||
base::Value::Dict user_info) {}
|
||||
base::DictValue user_info) {}
|
||||
// User clicked the native macOS new tab button. (macOS only)
|
||||
virtual void OnNewWindowForTab() {}
|
||||
|
||||
|
||||
@@ -780,7 +780,7 @@ void Browser::ShowEmojiPanel() {
|
||||
}
|
||||
|
||||
void Browser::ShowAboutPanel() {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
std::string aboutMessage = "";
|
||||
gfx::ImageSkia image;
|
||||
|
||||
@@ -815,7 +815,7 @@ void Browser::ShowAboutPanel() {
|
||||
base::BindOnce([](int, bool) { /* do nothing. */ }));
|
||||
}
|
||||
|
||||
void Browser::SetAboutPanelOptions(base::Value::Dict options) {
|
||||
void Browser::SetAboutPanelOptions(base::DictValue options) {
|
||||
about_panel_options_ = std::move(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/is_potentially_trustworthy.h"
|
||||
#include "services/network/public/cpp/network_switches.h"
|
||||
#include "services/network/public/cpp/originating_process.h"
|
||||
#include "services/network/public/cpp/resource_request_body.h"
|
||||
#include "services/network/public/cpp/self_deleting_url_loader_factory.h"
|
||||
#include "services/network/public/cpp/url_loader_factory_builder.h"
|
||||
@@ -1430,11 +1431,12 @@ void ElectronBrowserClient::OverrideURLLoaderFactoryParams(
|
||||
bool is_for_isolated_world,
|
||||
bool is_for_service_worker,
|
||||
network::mojom::URLLoaderFactoryParams* factory_params) {
|
||||
if (factory_params->top_frame_id) {
|
||||
if (factory_params->top_frame_id &&
|
||||
!factory_params->process_id.is_browser()) {
|
||||
// Bypass CORB and CORS when web security is disabled.
|
||||
auto* rfh = content::RenderFrameHost::FromFrameToken(
|
||||
content::GlobalRenderFrameHostToken(
|
||||
factory_params->process_id,
|
||||
factory_params->process_id.renderer_process().value(),
|
||||
blink::LocalFrameToken(factory_params->top_frame_id.value())));
|
||||
auto* web_contents = content::WebContents::FromRenderFrameHost(rfh);
|
||||
auto* prefs = WebContentsPreferences::From(web_contents);
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "gin/arguments.h"
|
||||
#include "media/audio/audio_device_description.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/originating_process.h"
|
||||
#include "services/network/public/cpp/url_loader_factory_builder.h"
|
||||
#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
@@ -356,7 +357,7 @@ void ElectronBrowserContext::DestroyAllContexts() {
|
||||
ElectronBrowserContext::ElectronBrowserContext(
|
||||
const PartitionOrPath partition_location,
|
||||
bool in_memory,
|
||||
base::Value::Dict options)
|
||||
base::DictValue options)
|
||||
: in_memory_pref_store_(new ValueMapPrefStore),
|
||||
storage_policy_(base::MakeRefCounted<SpecialStoragePolicy>()),
|
||||
protocol_registry_(base::WrapUnique(new ProtocolRegistry)),
|
||||
@@ -481,7 +482,7 @@ void ElectronBrowserContext::InitPrefs() {
|
||||
std::string default_code = spellcheck::GetCorrespondingSpellCheckLanguage(
|
||||
base::i18n::GetConfiguredLocale());
|
||||
if (!default_code.empty()) {
|
||||
base::Value::List language_codes;
|
||||
base::ListValue language_codes;
|
||||
language_codes.Append(default_code);
|
||||
prefs()->Set(spellcheck::prefs::kSpellCheckDictionaries,
|
||||
base::Value(std::move(language_codes)));
|
||||
@@ -588,7 +589,7 @@ ElectronBrowserContext::GetURLLoaderFactory() {
|
||||
network::mojom::URLLoaderFactoryParamsPtr params =
|
||||
network::mojom::URLLoaderFactoryParams::New();
|
||||
params->header_client = std::move(header_client);
|
||||
params->process_id = network::mojom::kBrowserProcessId;
|
||||
params->process_id = network::OriginatingProcess::browser();
|
||||
params->is_trusted = true;
|
||||
params->is_orb_enabled = false;
|
||||
// The tests of net module would fail if this setting is true, it seems that
|
||||
@@ -870,7 +871,7 @@ bool ElectronBrowserContext::CheckDevicePermission(
|
||||
ElectronBrowserContext* ElectronBrowserContext::From(
|
||||
const std::string& partition,
|
||||
bool in_memory,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
auto& context = ContextMap()[PartitionKey(partition, in_memory)];
|
||||
if (!context) {
|
||||
context.reset(new ElectronBrowserContext{std::cref(partition), in_memory,
|
||||
@@ -881,13 +882,13 @@ ElectronBrowserContext* ElectronBrowserContext::From(
|
||||
|
||||
// static
|
||||
ElectronBrowserContext* ElectronBrowserContext::GetDefaultBrowserContext(
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
return ElectronBrowserContext::From("", false, std::move(options));
|
||||
}
|
||||
|
||||
ElectronBrowserContext* ElectronBrowserContext::FromPath(
|
||||
const base::FilePath& path,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
auto& context = ContextMap()[PartitionKey(path)];
|
||||
if (!context) {
|
||||
context.reset(
|
||||
|
||||
@@ -67,20 +67,20 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||
|
||||
// Get or create the default BrowserContext.
|
||||
static ElectronBrowserContext* GetDefaultBrowserContext(
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
// Get or create the BrowserContext according to its |partition| and
|
||||
// |in_memory|. The |options| will be passed to constructor when there is no
|
||||
// existing BrowserContext.
|
||||
static ElectronBrowserContext* From(const std::string& partition,
|
||||
bool in_memory,
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
// Get or create the BrowserContext using the |path|.
|
||||
// The |options| will be passed to constructor when there is no
|
||||
// existing BrowserContext.
|
||||
static ElectronBrowserContext* FromPath(const base::FilePath& path,
|
||||
base::Value::Dict options = {});
|
||||
base::DictValue options = {});
|
||||
|
||||
static void DestroyAllContexts();
|
||||
|
||||
@@ -172,9 +172,9 @@ class ElectronBrowserContext : public content::BrowserContext {
|
||||
|
||||
ElectronBrowserContext(const PartitionOrPath partition_location,
|
||||
bool in_memory,
|
||||
base::Value::Dict options);
|
||||
base::DictValue options);
|
||||
|
||||
ElectronBrowserContext(base::FilePath partition, base::Value::Dict options);
|
||||
ElectronBrowserContext(base::FilePath partition, base::DictValue options);
|
||||
|
||||
static void DisplayMediaDeviceChosen(
|
||||
const content::MediaStreamRequest& request,
|
||||
|
||||
@@ -472,7 +472,7 @@ int ElectronBrowserMainParts::PreMainMessageLoopRun() {
|
||||
#if !BUILDFLAG(IS_MAC)
|
||||
// The corresponding call in macOS is in ElectronApplicationDelegate.
|
||||
Browser::Get()->WillFinishLaunching();
|
||||
Browser::Get()->DidFinishLaunching(base::Value::Dict());
|
||||
Browser::Get()->DidFinishLaunching(base::DictValue());
|
||||
#endif
|
||||
|
||||
// Notify observers that main thread message loop was initialized.
|
||||
|
||||
@@ -174,7 +174,7 @@ void ElectronPermissionManager::RequestPermissionWithDetails(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
bool user_gesture,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusCallback response_callback) {
|
||||
if (render_frame_host->IsNestedWithinFencedFrame()) {
|
||||
std::move(response_callback)
|
||||
@@ -213,7 +213,7 @@ void ElectronPermissionManager::RequestPermissions(
|
||||
void ElectronPermissionManager::RequestPermissionsWithDetails(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const content::PermissionRequestDescription& request_description,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusesCallback response_callback) {
|
||||
if (request_description.permissions.empty()) {
|
||||
std::move(response_callback).Run({});
|
||||
@@ -315,7 +315,7 @@ blink::mojom::PermissionStatus ElectronPermissionManager::GetPermissionStatus(
|
||||
const GURL& embedding_origin) {
|
||||
const auto permission =
|
||||
blink::PermissionDescriptorToPermissionType(permission_descriptor);
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("embeddingOrigin", embedding_origin.spec());
|
||||
bool granted = CheckPermissionWithDetails(permission, {}, requesting_origin,
|
||||
std::move(details));
|
||||
@@ -338,7 +338,7 @@ void ElectronPermissionManager::CheckBluetoothDevicePair(
|
||||
gin_helper::Dictionary details,
|
||||
PairCallback pair_callback) const {
|
||||
if (bluetooth_pairing_handler_.is_null()) {
|
||||
base::Value::Dict response;
|
||||
base::DictValue response;
|
||||
response.Set("confirmed", false);
|
||||
std::move(pair_callback).Run(std::move(response));
|
||||
} else {
|
||||
@@ -350,7 +350,7 @@ bool ElectronPermissionManager::CheckPermissionWithDetails(
|
||||
blink::PermissionType permission,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
base::Value::Dict details) const {
|
||||
base::DictValue details) const {
|
||||
if (permission == blink::PermissionType::GEOLOCATION &&
|
||||
IsGeolocationDisabledViaCommandLine())
|
||||
return false;
|
||||
@@ -450,7 +450,7 @@ ElectronPermissionManager::GetPermissionResultForCurrentDocument(
|
||||
|
||||
const auto permission =
|
||||
blink::PermissionDescriptorToPermissionType(permission_descriptor);
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("embeddingOrigin",
|
||||
content::PermissionUtil::GetLastCommittedOriginAsURL(
|
||||
render_frame_host->GetMainFrame())
|
||||
|
||||
@@ -46,7 +46,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
using StatusCallback = base::OnceCallback<void(content::PermissionResult)>;
|
||||
using StatusesCallback =
|
||||
base::OnceCallback<void(const std::vector<content::PermissionResult>&)>;
|
||||
using PairCallback = base::OnceCallback<void(base::Value::Dict)>;
|
||||
using PairCallback = base::OnceCallback<void(base::DictValue)>;
|
||||
using RequestHandler = base::RepeatingCallback<void(content::WebContents*,
|
||||
blink::PermissionType,
|
||||
StatusCallback,
|
||||
@@ -73,7 +73,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
bool user_gesture,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusCallback response_callback);
|
||||
|
||||
// Handler to dispatch permission requests in JS.
|
||||
@@ -92,7 +92,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
bool CheckPermissionWithDetails(blink::PermissionType permission,
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& requesting_origin,
|
||||
base::Value::Dict details) const;
|
||||
base::DictValue details) const;
|
||||
|
||||
bool CheckDevicePermission(blink::PermissionType permission,
|
||||
const url::Origin& origin,
|
||||
@@ -158,7 +158,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
|
||||
void RequestPermissionsWithDetails(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const content::PermissionRequestDescription& request_description,
|
||||
base::Value::Dict details,
|
||||
base::DictValue details,
|
||||
StatusesCallback callback);
|
||||
|
||||
RequestHandler request_handler_;
|
||||
|
||||
@@ -157,7 +157,7 @@ ExtensionActionGetBadgeBackgroundColorFunction::RunExtensionAction() {
|
||||
LOG(INFO)
|
||||
<< "chrome.action.getBadgeBackgroundColor is not supported in Electron";
|
||||
|
||||
base::Value::List list;
|
||||
base::ListValue list;
|
||||
return RespondNow(WithArguments(std::move(list)));
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ ExtensionFunction::ResponseAction
|
||||
ActionGetBadgeTextColorFunction::RunExtensionAction() {
|
||||
LOG(INFO) << "chrome.action.getBadgeTextColor is not supported in Electron";
|
||||
|
||||
base::Value::List list;
|
||||
base::ListValue list;
|
||||
return RespondNow(WithArguments(std::move(list)));
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ ActionGetUserSettingsFunction::~ActionGetUserSettingsFunction() = default;
|
||||
ExtensionFunction::ResponseAction ActionGetUserSettingsFunction::Run() {
|
||||
LOG(INFO) << "chrome.action.getUserSettings is not supported in Electron";
|
||||
|
||||
base::Value::Dict ui_settings;
|
||||
base::DictValue ui_settings;
|
||||
return RespondNow(WithArguments(std::move(ui_settings)));
|
||||
}
|
||||
|
||||
|
||||
@@ -44,9 +44,8 @@ namespace SetPdfPluginAttributes =
|
||||
namespace SetPdfDocumentTitle = api::pdf_viewer_private::SetPdfDocumentTitle;
|
||||
|
||||
// Check if the current URL is allowed based on a list of allowlisted domains.
|
||||
bool IsUrlAllowedToEmbedLocalFiles(
|
||||
const GURL& current_url,
|
||||
const base::Value::List& allowlisted_domains) {
|
||||
bool IsUrlAllowedToEmbedLocalFiles(const GURL& current_url,
|
||||
const base::ListValue& allowlisted_domains) {
|
||||
if (!current_url.is_valid() || !current_url.SchemeIs(url::kHttpsScheme)) {
|
||||
return false;
|
||||
}
|
||||
@@ -138,7 +137,7 @@ PdfViewerPrivateIsAllowedLocalFileAccessFunction::Run() {
|
||||
EXTENSION_FUNCTION_VALIDATE(params);
|
||||
|
||||
return RespondNow(WithArguments(
|
||||
IsUrlAllowedToEmbedLocalFiles(GURL(params->url), base::Value::List())));
|
||||
IsUrlAllowedToEmbedLocalFiles(GURL(params->url), base::ListValue())));
|
||||
}
|
||||
|
||||
PdfViewerPrivateSaveToDriveFunction::PdfViewerPrivateSaveToDriveFunction() =
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
// To add a new component to this API, simply:
|
||||
// 1. Add your component to the Component enum in
|
||||
// shell/common/extensions/api/resources_private.idl
|
||||
// 2. Create an AddStringsForMyComponent(base::Value::Dict* dict) method.
|
||||
// 2. Create an AddStringsForMyComponent(base::DictValue* dict) method.
|
||||
// 3. Tie in that method to the switch statement in Run()
|
||||
|
||||
namespace extensions {
|
||||
@@ -40,7 +40,7 @@ ResourcesPrivateGetStringsFunction::~ResourcesPrivateGetStringsFunction() =
|
||||
|
||||
ExtensionFunction::ResponseAction ResourcesPrivateGetStringsFunction::Run() {
|
||||
get_strings::Params params = get_strings::Params::Create(args()).value();
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
|
||||
switch (params.component) {
|
||||
case api::resources_private::Component::kPdf:
|
||||
|
||||
@@ -266,7 +266,7 @@ ExtensionFunction::ResponseAction TabsQueryFunction::Run() {
|
||||
std::optional<bool> audible = params->query_info.audible;
|
||||
std::optional<bool> muted = params->query_info.muted;
|
||||
|
||||
base::Value::List result;
|
||||
base::ListValue result;
|
||||
|
||||
// Filter out webContents that don't belong to the current browser context.
|
||||
auto* bc = browser_context();
|
||||
|
||||
@@ -28,7 +28,7 @@ ElectronComponentExtensionResourceManager::
|
||||
AddComponentResourceEntries(kPdfResources);
|
||||
|
||||
// Register strings for the PDF viewer, so that $i18n{} replacements work.
|
||||
base::Value::Dict dict = pdf_extension_util::GetStrings(
|
||||
base::DictValue dict = pdf_extension_util::GetStrings(
|
||||
pdf_extension_util::PdfViewerContext::kPdfViewer);
|
||||
|
||||
ui::TemplateReplacements pdf_viewer_replacements;
|
||||
|
||||
@@ -41,7 +41,7 @@ class ElectronExtensionLoader : public ExtensionRegistrar::Delegate {
|
||||
void OnExtensionInstalled(const Extension* extension,
|
||||
const syncer::StringOrdinal& page_ordinal,
|
||||
int install_flags,
|
||||
base::Value::Dict ruleset_install_prefs) override {}
|
||||
base::DictValue ruleset_install_prefs) override {}
|
||||
|
||||
// Loads an unpacked extension from a directory synchronously. Returns the
|
||||
// extension on success, or nullptr otherwise.
|
||||
|
||||
@@ -90,7 +90,7 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
namespace {
|
||||
|
||||
std::unique_ptr<base::Value::Dict> ParseManifest(
|
||||
std::unique_ptr<base::DictValue> ParseManifest(
|
||||
const std::string_view manifest_contents) {
|
||||
JSONStringValueDeserializer deserializer(manifest_contents);
|
||||
std::unique_ptr<base::Value> manifest =
|
||||
@@ -100,7 +100,7 @@ std::unique_ptr<base::Value::Dict> ParseManifest(
|
||||
LOG(ERROR) << "Failed to parse extension manifest.";
|
||||
return {};
|
||||
}
|
||||
return std::make_unique<base::Value::Dict>(std::move(*manifest).TakeDict());
|
||||
return std::make_unique<base::DictValue>(std::move(*manifest).TakeDict());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
@@ -110,7 +110,7 @@ void ElectronExtensionSystem::LoadComponentExtensions() {
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
std::u16string error;
|
||||
std::string pdf_manifest_string = pdf_extension_util::GetManifest();
|
||||
std::unique_ptr<base::Value::Dict> pdf_manifest =
|
||||
std::unique_ptr<base::DictValue> pdf_manifest =
|
||||
ParseManifest(pdf_manifest_string);
|
||||
if (pdf_manifest) {
|
||||
base::FilePath root_directory;
|
||||
@@ -194,7 +194,7 @@ void ElectronExtensionSystem::InstallUpdate(
|
||||
|
||||
void ElectronExtensionSystem::PerformActionBasedOnOmahaAttributes(
|
||||
const std::string& extension_id,
|
||||
const base::Value::Dict& attributes) {
|
||||
const base::DictValue& attributes) {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class ElectronExtensionSystem : public ExtensionSystem {
|
||||
InstallUpdateCallback install_update_callback) override;
|
||||
void PerformActionBasedOnOmahaAttributes(
|
||||
const std::string& extension_id,
|
||||
const base::Value::Dict& attributes) override;
|
||||
const base::DictValue& attributes) override;
|
||||
|
||||
private:
|
||||
void OnExtensionRegisteredWithRequestContexts(
|
||||
|
||||
@@ -330,7 +330,7 @@ ElectronExtensionsBrowserClient::GetComponentExtensionResourceManager() {
|
||||
void ElectronExtensionsBrowserClient::BroadcastEventToRenderers(
|
||||
extensions::events::HistogramValue histogram_value,
|
||||
const std::string& event_name,
|
||||
base::Value::List args,
|
||||
base::ListValue args,
|
||||
bool dispatch_to_off_the_record_profiles) {
|
||||
if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) {
|
||||
content::GetUIThreadTaskRunner({})->PostTask(
|
||||
|
||||
@@ -132,7 +132,7 @@ class ElectronExtensionsBrowserClient
|
||||
void BroadcastEventToRenderers(
|
||||
extensions::events::HistogramValue histogram_value,
|
||||
const std::string& event_name,
|
||||
base::Value::List args,
|
||||
base::ListValue args,
|
||||
bool dispatch_to_off_the_record_profiles) override;
|
||||
extensions::ExtensionCache* GetExtensionCache() override;
|
||||
bool IsBackgroundUpdateAllowed() override;
|
||||
|
||||
@@ -39,7 +39,7 @@ ElectronMessagingDelegate::IsNativeMessagingHostAllowed(
|
||||
return PolicyPermission::DISALLOW;
|
||||
}
|
||||
|
||||
std::optional<base::Value::Dict> ElectronMessagingDelegate::MaybeGetTabInfo(
|
||||
std::optional<base::DictValue> ElectronMessagingDelegate::MaybeGetTabInfo(
|
||||
content::WebContents* web_contents) {
|
||||
if (web_contents) {
|
||||
auto* api_contents = electron::api::WebContents::From(web_contents);
|
||||
|
||||
@@ -27,7 +27,7 @@ class ElectronMessagingDelegate : public MessagingDelegate {
|
||||
PolicyPermission IsNativeMessagingHostAllowed(
|
||||
content::BrowserContext* browser_context,
|
||||
const std::string& native_host_name) override;
|
||||
std::optional<base::Value::Dict> MaybeGetTabInfo(
|
||||
std::optional<base::DictValue> MaybeGetTabInfo(
|
||||
content::WebContents* web_contents) override;
|
||||
content::WebContents* GetWebContentsByTabId(
|
||||
content::BrowserContext* browser_context,
|
||||
|
||||
@@ -263,7 +263,7 @@ class FileSystemAccessPermissionContext::PermissionGrantImpl
|
||||
static_cast<electron::ElectronPermissionManager*>(
|
||||
context_->browser_context()->GetPermissionControllerDelegate());
|
||||
if (permission_manager && permission_manager->HasPermissionCheckHandler()) {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("filePath", base::FilePathToValue(path_info_.path));
|
||||
details.Set("isDirectory", handle_type_ == HandleType::kDirectory);
|
||||
details.Set("fileAccessType",
|
||||
@@ -360,7 +360,7 @@ class FileSystemAccessPermissionContext::PermissionGrantImpl
|
||||
return;
|
||||
}
|
||||
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("filePath", base::FilePathToValue(path_info_.path));
|
||||
details.Set("isDirectory", handle_type_ == HandleType::kDirectory);
|
||||
details.Set("fileAccessType",
|
||||
@@ -822,7 +822,7 @@ void FileSystemAccessPermissionContext::DidCheckPathAgainstBlocklist(
|
||||
}
|
||||
|
||||
void FileSystemAccessPermissionContext::MaybeEvictEntries(
|
||||
base::Value::Dict& dict) {
|
||||
base::DictValue& dict) {
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
std::vector<std::pair<base::Time, std::string>> entries;
|
||||
@@ -861,7 +861,7 @@ void FileSystemAccessPermissionContext::SetLastPickedDirectory(
|
||||
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
|
||||
|
||||
// Create an entry into the nested dictionary.
|
||||
base::Value::Dict entry;
|
||||
base::DictValue entry;
|
||||
entry.Set(kPathKey, base::FilePathToValue(path_info.path));
|
||||
entry.Set(kPathTypeKey, static_cast<int>(path_info.type));
|
||||
entry.Set(kDisplayNameKey, path_info.display_name);
|
||||
@@ -869,11 +869,11 @@ void FileSystemAccessPermissionContext::SetLastPickedDirectory(
|
||||
|
||||
auto it = id_pathinfo_map_.find(origin);
|
||||
if (it != id_pathinfo_map_.end()) {
|
||||
base::Value::Dict& dict = it->second;
|
||||
base::DictValue& dict = it->second;
|
||||
dict.Set(GenerateLastPickedDirectoryKey(id), std::move(entry));
|
||||
MaybeEvictEntries(dict);
|
||||
} else {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
dict.Set(GenerateLastPickedDirectoryKey(id), std::move(entry));
|
||||
MaybeEvictEntries(dict);
|
||||
id_pathinfo_map_.try_emplace(origin, std::move(dict));
|
||||
|
||||
@@ -169,7 +169,7 @@ class FileSystemAccessPermissionContext
|
||||
void OnRestrictedPathResult(const base::FilePath& file_path,
|
||||
gin::Arguments* args);
|
||||
|
||||
void MaybeEvictEntries(base::Value::Dict& dict);
|
||||
void MaybeEvictEntries(base::DictValue& dict);
|
||||
|
||||
void CleanupPermissions(const url::Origin& origin);
|
||||
|
||||
@@ -194,7 +194,7 @@ class FileSystemAccessPermissionContext
|
||||
|
||||
const raw_ptr<const base::Clock> clock_;
|
||||
|
||||
std::map<url::Origin, base::Value::Dict> id_pathinfo_map_;
|
||||
std::map<url::Origin, base::DictValue> id_pathinfo_map_;
|
||||
|
||||
std::map<base::FilePath, base::OnceCallback<void(SensitiveEntryResult)>>
|
||||
callback_map_;
|
||||
|
||||
@@ -139,7 +139,7 @@ bool ElectronHidDelegate::CanRequestDevicePermission(
|
||||
if (!browser_context)
|
||||
return false;
|
||||
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", origin.GetURL().spec());
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
browser_context->GetPermissionControllerDelegate());
|
||||
|
||||
@@ -92,9 +92,8 @@ std::string UnitSystemToString(uint8_t unit) {
|
||||
}
|
||||
|
||||
// Adapted from third_party/blink/renderer/modules/hid/hid_device.cc.
|
||||
base::Value::Dict HidReportItemToValue(
|
||||
const device::mojom::HidReportItem& item) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue HidReportItemToValue(const device::mojom::HidReportItem& item) {
|
||||
base::DictValue dict;
|
||||
|
||||
dict.Set("hasNull", item.has_null_position);
|
||||
dict.Set("hasPreferredState", !item.no_preferred_state);
|
||||
@@ -131,7 +130,7 @@ base::Value::Dict HidReportItemToValue(
|
||||
dict.Set("usageMinimum", ConvertHidUsageAndPageToInt(*item.usage_minimum));
|
||||
dict.Set("usageMaximum", ConvertHidUsageAndPageToInt(*item.usage_maximum));
|
||||
} else {
|
||||
base::Value::List usages_list;
|
||||
base::ListValue usages_list;
|
||||
for (const auto& usage : item.usages) {
|
||||
usages_list.Append(ConvertHidUsageAndPageToInt(*usage));
|
||||
}
|
||||
@@ -144,12 +143,12 @@ base::Value::Dict HidReportItemToValue(
|
||||
}
|
||||
|
||||
// Adapted from third_party/blink/renderer/modules/hid/hid_device.cc.
|
||||
base::Value::Dict HidReportDescriptionToValue(
|
||||
base::DictValue HidReportDescriptionToValue(
|
||||
const device::mojom::HidReportDescription& report) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
dict.Set("reportId", static_cast<int>(report.report_id));
|
||||
|
||||
base::Value::List items_list;
|
||||
base::ListValue items_list;
|
||||
for (const auto& item : report.items) {
|
||||
items_list.Append(base::Value(HidReportItemToValue(*item)));
|
||||
}
|
||||
@@ -159,9 +158,9 @@ base::Value::Dict HidReportDescriptionToValue(
|
||||
}
|
||||
|
||||
// Adapted from third_party/blink/renderer/modules/hid/hid_device.cc.
|
||||
base::Value::Dict HidCollectionInfoToValue(
|
||||
base::DictValue HidCollectionInfoToValue(
|
||||
const device::mojom::HidCollectionInfo& collection) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
|
||||
// Usage information
|
||||
dict.Set("usage", collection.usage->usage);
|
||||
@@ -171,7 +170,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("collectionType", static_cast<int>(collection.collection_type));
|
||||
|
||||
// Input reports
|
||||
base::Value::List input_reports_list;
|
||||
base::ListValue input_reports_list;
|
||||
for (const auto& report : collection.input_reports) {
|
||||
input_reports_list.Append(
|
||||
base::Value(HidReportDescriptionToValue(*report)));
|
||||
@@ -179,7 +178,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("inputReports", std::move(input_reports_list));
|
||||
|
||||
// Output reports
|
||||
base::Value::List output_reports_list;
|
||||
base::ListValue output_reports_list;
|
||||
for (const auto& report : collection.output_reports) {
|
||||
output_reports_list.Append(
|
||||
base::Value(HidReportDescriptionToValue(*report)));
|
||||
@@ -187,7 +186,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("outputReports", std::move(output_reports_list));
|
||||
|
||||
// Feature reports
|
||||
base::Value::List feature_reports_list;
|
||||
base::ListValue feature_reports_list;
|
||||
for (const auto& report : collection.feature_reports) {
|
||||
feature_reports_list.Append(
|
||||
base::Value(HidReportDescriptionToValue(*report)));
|
||||
@@ -195,7 +194,7 @@ base::Value::Dict HidCollectionInfoToValue(
|
||||
dict.Set("featureReports", std::move(feature_reports_list));
|
||||
|
||||
// Child collections (recursive)
|
||||
base::Value::List children_list;
|
||||
base::ListValue children_list;
|
||||
for (const auto& child : collection.children) {
|
||||
children_list.Append(base::Value(HidCollectionInfoToValue(*child)));
|
||||
}
|
||||
@@ -240,7 +239,7 @@ bool HidChooserContext::CanStorePersistentEntry(
|
||||
// static
|
||||
base::Value HidChooserContext::DeviceInfoToValue(
|
||||
const device::mojom::HidDeviceInfo& device) {
|
||||
base::Value::Dict value;
|
||||
base::DictValue value;
|
||||
value.Set(
|
||||
kHidDeviceNameKey,
|
||||
base::UTF16ToUTF8(HidChooserContext::DisplayNameFromDeviceInfo(device)));
|
||||
@@ -259,7 +258,7 @@ base::Value HidChooserContext::DeviceInfoToValue(
|
||||
}
|
||||
|
||||
// Convert collections array
|
||||
base::Value::List collections_list;
|
||||
base::ListValue collections_list;
|
||||
for (const auto& collection : device.collections) {
|
||||
collections_list.Append(base::Value(HidCollectionInfoToValue(*collection)));
|
||||
}
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
NSArray* ListValueToNSArray(const base::Value::List& value);
|
||||
base::Value::List NSArrayToValue(NSArray* arr);
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::Value::Dict& value);
|
||||
base::Value::Dict NSDictionaryToValue(NSDictionary* dict);
|
||||
NSArray* ListValueToNSArray(const base::ListValue& value);
|
||||
base::ListValue NSArrayToValue(NSArray* arr);
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::DictValue& value);
|
||||
base::DictValue NSDictionaryToValue(NSDictionary* dict);
|
||||
|
||||
} // namespace electron
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
namespace electron {
|
||||
|
||||
NSArray* ListValueToNSArray(const base::Value::List& value) {
|
||||
NSArray* ListValueToNSArray(const base::ListValue& value) {
|
||||
const auto json = base::WriteJson(value);
|
||||
if (!json.has_value())
|
||||
return nil;
|
||||
@@ -26,8 +26,8 @@ NSArray* ListValueToNSArray(const base::Value::List& value) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
base::Value::List NSArrayToValue(NSArray* arr) {
|
||||
base::Value::List result;
|
||||
base::ListValue NSArrayToValue(NSArray* arr) {
|
||||
base::ListValue result;
|
||||
if (!arr)
|
||||
return result;
|
||||
|
||||
@@ -54,7 +54,7 @@ base::Value::List NSArrayToValue(NSArray* arr) {
|
||||
return result;
|
||||
}
|
||||
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::Value::Dict& value) {
|
||||
NSDictionary* DictionaryValueToNSDictionary(const base::DictValue& value) {
|
||||
const auto json = base::WriteJson(value);
|
||||
if (!json.has_value())
|
||||
return nil;
|
||||
@@ -67,8 +67,8 @@ NSDictionary* DictionaryValueToNSDictionary(const base::Value::Dict& value) {
|
||||
return obj;
|
||||
}
|
||||
|
||||
base::Value::Dict NSDictionaryToValue(NSDictionary* dict) {
|
||||
base::Value::Dict result;
|
||||
base::DictValue NSDictionaryToValue(NSDictionary* dict) {
|
||||
base::DictValue result;
|
||||
if (!dict)
|
||||
return result;
|
||||
|
||||
|
||||
@@ -163,7 +163,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
dispatch_sync_main(^{
|
||||
std::string activity_type(
|
||||
base::SysNSStringToUTF8(userActivity.activityType));
|
||||
base::Value::Dict user_info =
|
||||
base::DictValue user_info =
|
||||
electron::NSDictionaryToValue(userActivity.userInfo);
|
||||
|
||||
electron::Browser* browser = electron::Browser::Get();
|
||||
@@ -192,7 +192,7 @@ inline void dispatch_sync_main(dispatch_block_t block) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
std::string activity_type(
|
||||
base::SysNSStringToUTF8(userActivity.activityType));
|
||||
base::Value::Dict user_info =
|
||||
base::DictValue user_info =
|
||||
electron::NSDictionaryToValue(userActivity.userInfo);
|
||||
|
||||
electron::Browser* browser = electron::Browser::Get();
|
||||
|
||||
@@ -637,7 +637,7 @@ void NativeWindow::NotifyWindowExecuteAppCommand(
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyTouchBarItemInteraction(const std::string& item_id,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue details) {
|
||||
observers_.Notify(&NativeWindowObserver::OnTouchBarItemResult, item_id,
|
||||
details);
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ class NativeWindow : public views::WidgetDelegate {
|
||||
void NotifyWindowAlwaysOnTopChanged();
|
||||
void NotifyWindowExecuteAppCommand(std::string_view command_name);
|
||||
void NotifyTouchBarItemInteraction(const std::string& item_id,
|
||||
base::Value::Dict details);
|
||||
base::DictValue details);
|
||||
void NotifyNewWindowForTab();
|
||||
void NotifyWindowSystemContextMenu(int x, int y, bool* prevent_default);
|
||||
void NotifyLayoutWindowControlsOverlay();
|
||||
|
||||
@@ -96,7 +96,7 @@ class NativeWindowObserver : public base::CheckedObserver {
|
||||
virtual void OnWindowLeaveHtmlFullScreen() {}
|
||||
virtual void OnWindowAlwaysOnTopChanged() {}
|
||||
virtual void OnTouchBarItemResult(const std::string& item_id,
|
||||
const base::Value::Dict& details) {}
|
||||
const base::DictValue& details) {}
|
||||
virtual void OnNewWindowForTab() {}
|
||||
virtual void OnSystemContextMenu(int x, int y, bool* prevent_default) {}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ network::mojom::URLResponseHeadPtr ToResponseHead(
|
||||
bool has_mime_type = dict.Get("mimeType", &head->mime_type);
|
||||
bool has_content_type = false;
|
||||
|
||||
base::Value::Dict headers;
|
||||
base::DictValue headers;
|
||||
if (dict.Get("headers", &headers)) {
|
||||
for (const auto iter : headers) {
|
||||
if (iter.second.is_string()) {
|
||||
@@ -204,7 +204,7 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
||||
mojo::PendingReceiver<network::mojom::URLLoader> loader,
|
||||
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
|
||||
const net::NetworkTrafficAnnotationTag& annotation,
|
||||
base::Value::Dict upload_data)
|
||||
base::DictValue upload_data)
|
||||
: url_loader_(this, std::move(loader)), client_(std::move(client)) {
|
||||
url_loader_.set_disconnect_handler(
|
||||
base::BindOnce(&URLPipeLoader::NotifyComplete, base::Unretained(this),
|
||||
@@ -228,7 +228,7 @@ class URLPipeLoader : public network::mojom::URLLoader,
|
||||
void Start(scoped_refptr<network::SharedURLLoaderFactory> factory,
|
||||
std::unique_ptr<network::ResourceRequest> request,
|
||||
const net::NetworkTrafficAnnotationTag& annotation,
|
||||
base::Value::Dict upload_data) {
|
||||
base::DictValue upload_data) {
|
||||
loader_ = network::SimpleURLLoader::Create(std::move(request), annotation);
|
||||
loader_->SetOnResponseStartedCallback(base::BindOnce(
|
||||
&URLPipeLoader::OnResponseStarted, weak_factory_.GetWeakPtr()));
|
||||
@@ -665,7 +665,7 @@ void ElectronURLLoaderFactory::StartLoadingHttp(
|
||||
if (!dict.Get("method", &request->method))
|
||||
request->method = original_request.method;
|
||||
|
||||
base::Value::Dict upload_data;
|
||||
base::DictValue upload_data;
|
||||
if (request->method != net::HttpRequestHeaders::kGetMethod &&
|
||||
request->method != net::HttpRequestHeaders::kHeadMethod)
|
||||
dict.Get("uploadData", &upload_data);
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "services/network/network_service.h"
|
||||
#include "services/network/public/cpp/cross_thread_pending_shared_url_loader_factory.h"
|
||||
#include "services/network/public/cpp/features.h"
|
||||
#include "services/network/public/cpp/originating_process.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
#include "services/network/public/mojom/network_context.mojom.h"
|
||||
#include "services/network/public/mojom/url_response_head.mojom.h"
|
||||
@@ -164,7 +165,7 @@ SystemNetworkContextManager::GetURLLoaderFactory() {
|
||||
|
||||
network::mojom::URLLoaderFactoryParamsPtr params =
|
||||
network::mojom::URLLoaderFactoryParams::New();
|
||||
params->process_id = network::mojom::kBrowserProcessId;
|
||||
params->process_id = network::OriginatingProcess::browser();
|
||||
params->is_orb_enabled = false;
|
||||
url_loader_factory_.reset();
|
||||
GetContext()->CreateURLLoaderFactory(
|
||||
|
||||
@@ -33,7 +33,7 @@ std::string EncodeToken(const base::UnguessableToken& token) {
|
||||
}
|
||||
|
||||
base::Value PortInfoToValue(const device::mojom::SerialPortInfo& port) {
|
||||
base::Value::Dict value;
|
||||
base::DictValue value;
|
||||
if (port.display_name && !port.display_name->empty()) {
|
||||
value.Set(kPortNameKey, *port.display_name);
|
||||
} else {
|
||||
|
||||
@@ -20,7 +20,7 @@ bool SpecialStoragePolicy::IsStorageUnlimited(const GURL& origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpecialStoragePolicy::IsStorageDurable(const GURL& origin) {
|
||||
bool SpecialStoragePolicy::IsStoragePersistent(const GURL& origin) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class SpecialStoragePolicy : public storage::SpecialStoragePolicy {
|
||||
// storage::SpecialStoragePolicy implementation.
|
||||
bool IsStorageProtected(const GURL& origin) override;
|
||||
bool IsStorageUnlimited(const GURL& origin) override;
|
||||
bool IsStorageDurable(const GURL& origin) override;
|
||||
bool IsStoragePersistent(const GURL& origin) override;
|
||||
bool HasIsolatedStorage(const GURL& origin) override;
|
||||
bool IsStorageSessionOnly(const GURL& origin) override;
|
||||
bool HasSessionOnlyOrigins() override;
|
||||
|
||||
@@ -320,7 +320,7 @@ void SwizzleSwipeWithEvent(NSView* view, SEL swiz_selector) {
|
||||
}
|
||||
|
||||
- (void)disableHeadlessMode {
|
||||
if (shell_) {
|
||||
if (shell_ && self.isHeadless) {
|
||||
// We initialize the window in headless mode to allow painting before it is
|
||||
// shown, but we don't want the headless behavior of allowing the window to
|
||||
// be placed unconstrained.
|
||||
|
||||
@@ -254,7 +254,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
NSColor* color = ((NSColorPickerTouchBarItem*)sender).color;
|
||||
std::string hex_color =
|
||||
electron::ToRGBHex(skia::NSDeviceColorToSkColor(color));
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("color", hex_color);
|
||||
window_->NotifyTouchBarItemInteraction([item_id UTF8String],
|
||||
std::move(details));
|
||||
@@ -264,7 +264,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
NSString* identifier = ((NSSliderTouchBarItem*)sender).identifier;
|
||||
NSString* item_id = [self idFromIdentifier:identifier
|
||||
withPrefix:SliderIdentifier];
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("value", [((NSSliderTouchBarItem*)sender).slider intValue]);
|
||||
window_->NotifyTouchBarItemInteraction([item_id UTF8String],
|
||||
std::move(details));
|
||||
@@ -278,7 +278,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
- (void)segmentedControlAction:(id)sender {
|
||||
NSString* item_id =
|
||||
[NSString stringWithFormat:@"%ld", ((NSSegmentedControl*)sender).tag];
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("selectedIndex",
|
||||
static_cast<int>(((NSSegmentedControl*)sender).selectedSegment));
|
||||
details.Set(
|
||||
@@ -291,7 +291,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didSelectItemAtIndex:(NSInteger)selectedIndex {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("selectedIndex", static_cast<int>(selectedIndex));
|
||||
details.Set("type", "select");
|
||||
window_->NotifyTouchBarItemInteraction([scrubber.identifier UTF8String],
|
||||
@@ -300,7 +300,7 @@ static NSString* const ImageScrubberItemIdentifier = @"scrubber.image.item";
|
||||
|
||||
- (void)scrubber:(NSScrubber*)scrubber
|
||||
didHighlightItemAtIndex:(NSInteger)highlightedIndex {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("highlightedIndex", static_cast<int>(highlightedIndex));
|
||||
details.Set("type", "highlight");
|
||||
window_->NotifyTouchBarItemInteraction([scrubber.identifier UTF8String],
|
||||
|
||||
@@ -96,15 +96,15 @@ constexpr std::string_view kTitleFormat = "Developer Tools - %s";
|
||||
|
||||
const size_t kMaxMessageChunkSize = IPC::mojom::kChannelMaximumMessageSize / 4;
|
||||
|
||||
base::Value::Dict RectToDictionary(const gfx::Rect& bounds) {
|
||||
return base::Value::Dict{}
|
||||
base::DictValue RectToDictionary(const gfx::Rect& bounds) {
|
||||
return base::DictValue{}
|
||||
.Set("x", bounds.x())
|
||||
.Set("y", bounds.y())
|
||||
.Set("width", bounds.width())
|
||||
.Set("height", bounds.height());
|
||||
}
|
||||
|
||||
gfx::Rect DictionaryToRect(const base::Value::Dict& dict) {
|
||||
gfx::Rect DictionaryToRect(const base::DictValue& dict) {
|
||||
return gfx::Rect{dict.FindInt("x").value_or(0), dict.FindInt("y").value_or(0),
|
||||
dict.FindInt("width").value_or(800),
|
||||
dict.FindInt("height").value_or(600)};
|
||||
@@ -269,7 +269,7 @@ class InspectableWebContents::NetworkResourceLoader
|
||||
"statusCode", response_headers_ ? response_headers_->response_code()
|
||||
: net::HTTP_OK);
|
||||
|
||||
base::Value::Dict headers;
|
||||
base::DictValue headers;
|
||||
size_t iterator = 0;
|
||||
std::string name;
|
||||
std::string value;
|
||||
@@ -490,7 +490,7 @@ void InspectableWebContents::CallClientFunction(
|
||||
if (!GetDevToolsWebContents())
|
||||
return;
|
||||
|
||||
base::Value::List arguments;
|
||||
base::ListValue arguments;
|
||||
if (!arg1.is_none()) {
|
||||
arguments.Append(std::move(arg1));
|
||||
if (!arg2.is_none()) {
|
||||
@@ -550,7 +550,7 @@ void InspectableWebContents::LoadCompleted() {
|
||||
}
|
||||
} else {
|
||||
if (dock_state_.empty()) {
|
||||
const base::Value::Dict& prefs =
|
||||
const base::DictValue& prefs =
|
||||
pref_service_->GetDict(kDevToolsPreferences);
|
||||
const std::string* current_dock_state =
|
||||
prefs.FindString("currentDockState");
|
||||
@@ -597,7 +597,7 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() {
|
||||
if (!registry)
|
||||
return;
|
||||
|
||||
base::Value::List results;
|
||||
base::ListValue results;
|
||||
for (auto& extension : registry->enabled_extensions()) {
|
||||
auto devtools_page_url =
|
||||
extensions::chrome_manifest_urls::GetDevToolsPage(extension.get());
|
||||
@@ -611,7 +611,7 @@ void InspectableWebContents::AddDevToolsExtensionsToClient() {
|
||||
web_contents_->GetPrimaryMainFrame()->GetProcess()->GetDeprecatedID(),
|
||||
url::Origin::Create(extension->url()));
|
||||
|
||||
base::Value::Dict extension_info;
|
||||
base::DictValue extension_info;
|
||||
extension_info.Set("startPage", devtools_page_url.spec());
|
||||
extension_info.Set("name", extension->name());
|
||||
extension_info.Set("exposeExperimentalAPIs",
|
||||
@@ -864,7 +864,7 @@ void InspectableWebContents::GetSyncInformation(DispatchCallback callback) {
|
||||
}
|
||||
|
||||
void InspectableWebContents::GetHostConfig(DispatchCallback callback) {
|
||||
base::Value::Dict response_dict;
|
||||
base::DictValue response_dict;
|
||||
base::Value response = base::Value(std::move(response_dict));
|
||||
std::move(callback).Run(&response);
|
||||
}
|
||||
@@ -875,7 +875,7 @@ void InspectableWebContents::RegisterExtensionsAPI(const std::string& origin,
|
||||
}
|
||||
|
||||
void InspectableWebContents::HandleMessageFromDevToolsFrontend(
|
||||
base::Value::Dict message) {
|
||||
base::DictValue message) {
|
||||
// TODO(alexeykuzmin): Should we expect it to exist?
|
||||
if (!embedder_message_dispatcher_) {
|
||||
return;
|
||||
@@ -889,8 +889,8 @@ void InspectableWebContents::HandleMessageFromDevToolsFrontend(
|
||||
return;
|
||||
}
|
||||
|
||||
const base::Value::List no_params;
|
||||
const base::Value::List& params_list =
|
||||
const base::ListValue no_params;
|
||||
const base::ListValue& params_list =
|
||||
params != nullptr && params->is_list() ? params->GetList() : no_params;
|
||||
|
||||
const int id = message.FindInt(kFrontendHostId).value_or(0);
|
||||
|
||||
@@ -201,7 +201,7 @@ class InspectableWebContents
|
||||
const DevToolsDispatchHttpRequestParams& params) override {}
|
||||
|
||||
// content::DevToolsFrontendHostDelegate:
|
||||
void HandleMessageFromDevToolsFrontend(base::Value::Dict message);
|
||||
void HandleMessageFromDevToolsFrontend(base::DictValue message);
|
||||
|
||||
// content::DevToolsAgentHostClient:
|
||||
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,
|
||||
|
||||
@@ -94,7 +94,7 @@ constexpr std::string_view kWeb = "web";
|
||||
static const char kDetectedATName[] = "detectedATName";
|
||||
static const char kIsScreenReaderActive[] = "isScreenReaderActive";
|
||||
|
||||
base::Value::Dict BuildTargetDescriptor(
|
||||
base::DictValue BuildTargetDescriptor(
|
||||
const GURL& url,
|
||||
const std::string& name,
|
||||
const GURL& favicon_url,
|
||||
@@ -102,7 +102,7 @@ base::Value::Dict BuildTargetDescriptor(
|
||||
int routing_id,
|
||||
ui::AXMode accessibility_mode,
|
||||
base::ProcessHandle handle = base::kNullProcessHandle) {
|
||||
base::Value::Dict target_data;
|
||||
base::DictValue target_data;
|
||||
target_data.Set(kProcessIdField, process_id);
|
||||
target_data.Set(kRoutingIdField, routing_id);
|
||||
target_data.Set(kUrlField, url.spec());
|
||||
@@ -115,7 +115,7 @@ base::Value::Dict BuildTargetDescriptor(
|
||||
return target_data;
|
||||
}
|
||||
|
||||
base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
base::DictValue BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
content::WebContents* web_contents =
|
||||
content::WebContents::FromRenderViewHost(rvh);
|
||||
ui::AXMode accessibility_mode;
|
||||
@@ -143,8 +143,8 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
|
||||
rvh->GetRoutingID(), accessibility_mode);
|
||||
}
|
||||
|
||||
base::Value::Dict BuildTargetDescriptor(electron::NativeWindow* window) {
|
||||
base::Value::Dict target_data;
|
||||
base::DictValue BuildTargetDescriptor(electron::NativeWindow* window) {
|
||||
base::DictValue target_data;
|
||||
target_data.Set(kSessionIdField, window->window_id());
|
||||
target_data.Set(kNameField, window->GetTitle());
|
||||
target_data.Set(kTypeField, kBrowser);
|
||||
@@ -157,7 +157,7 @@ bool ShouldHandleAccessibilityRequestCallback(const std::string& path) {
|
||||
|
||||
// Sets boolean values in `data` for each bit in `new_ax_mode` that differs from
|
||||
// that in `last_ax_mode`. Returns `true` if `data` was modified.
|
||||
void SetProcessModeBools(ui::AXMode ax_mode, base::Value::Dict& data) {
|
||||
void SetProcessModeBools(ui::AXMode ax_mode, base::DictValue& data) {
|
||||
data.Set(kNative, ax_mode.has_mode(ui::AXMode::kNativeAPIs));
|
||||
data.Set(kWeb, ax_mode.has_mode(ui::AXMode::kWebContents));
|
||||
data.Set(kText, ax_mode.has_mode(ui::AXMode::kInlineTextBoxes));
|
||||
@@ -170,7 +170,7 @@ void SetProcessModeBools(ui::AXMode ax_mode, base::Value::Dict& data) {
|
||||
#if BUILDFLAG(IS_WIN)
|
||||
// Sets values in `data` for the platform node counts in `counts`.
|
||||
void SetNodeCounts(const ui::AXPlatformNodeWin::Counts& counts,
|
||||
base::Value::Dict& data) {
|
||||
base::DictValue& data) {
|
||||
data.Set("dormantCount", base::NumberToString(counts.dormant_nodes));
|
||||
data.Set("liveCount", base::NumberToString(counts.live_nodes));
|
||||
data.Set("ghostCount", base::NumberToString(counts.ghost_nodes));
|
||||
@@ -186,7 +186,7 @@ void HandleAccessibilityRequestCallback(
|
||||
|
||||
auto& browser_accessibility_state =
|
||||
*content::BrowserAccessibilityState::GetInstance();
|
||||
base::Value::Dict data;
|
||||
base::DictValue data;
|
||||
PrefService* pref =
|
||||
static_cast<electron::ElectronBrowserContext*>(current_context)->prefs();
|
||||
ui::AXMode mode =
|
||||
@@ -226,7 +226,7 @@ void HandleAccessibilityRequestCallback(
|
||||
// is checked.
|
||||
data.Set(
|
||||
kLockedPlatformModes,
|
||||
base::Value::Dict()
|
||||
base::DictValue()
|
||||
.Set(kNative,
|
||||
allow_platform_activation && native &&
|
||||
initial_process_mode.has_mode(ui::AXMode::kNativeAPIs))
|
||||
@@ -252,7 +252,7 @@ void HandleAccessibilityRequestCallback(
|
||||
|
||||
std::vector<ui::AXApiType::Type> supported_api_types =
|
||||
content::AXInspectFactory::SupportedApis();
|
||||
base::Value::List supported_api_list;
|
||||
base::ListValue supported_api_list;
|
||||
supported_api_list.reserve(supported_api_types.size());
|
||||
for (ui::AXApiType::Type type : supported_api_types) {
|
||||
supported_api_list.Append(std::string_view(type));
|
||||
@@ -274,7 +274,7 @@ void HandleAccessibilityRequestCallback(
|
||||
|
||||
data.Set(kLocked, !browser_accessibility_state.IsAXModeChangeAllowed());
|
||||
|
||||
base::Value::List page_list;
|
||||
base::ListValue page_list;
|
||||
std::unique_ptr<content::RenderWidgetHostIterator> widget_iter(
|
||||
content::RenderWidgetHost::GetRenderWidgetHosts());
|
||||
|
||||
@@ -305,7 +305,7 @@ void HandleAccessibilityRequestCallback(
|
||||
continue;
|
||||
}
|
||||
|
||||
base::Value::Dict descriptor = BuildTargetDescriptor(rvh);
|
||||
base::DictValue descriptor = BuildTargetDescriptor(rvh);
|
||||
descriptor.Set(kNative, native);
|
||||
descriptor.Set(kExtendedProperties, extended_properties);
|
||||
descriptor.Set(kScreenReader, screen_reader);
|
||||
@@ -314,7 +314,7 @@ void HandleAccessibilityRequestCallback(
|
||||
}
|
||||
data.Set(kPagesField, std::move(page_list));
|
||||
|
||||
base::Value::List window_list;
|
||||
base::ListValue window_list;
|
||||
for (auto* window : electron::WindowList::GetWindows()) {
|
||||
window_list.Append(BuildTargetDescriptor(window));
|
||||
}
|
||||
@@ -420,7 +420,7 @@ ElectronAccessibilityUIMessageHandler::ElectronAccessibilityUIMessageHandler()
|
||||
base::Unretained(this))) {}
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::GetRequestTypeAndFilters(
|
||||
const base::Value::Dict& data,
|
||||
const base::DictValue& data,
|
||||
std::string& request_type,
|
||||
std::string& allow,
|
||||
std::string& allow_empty,
|
||||
@@ -433,8 +433,8 @@ void ElectronAccessibilityUIMessageHandler::GetRequestTypeAndFilters(
|
||||
}
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
const base::Value::List& args) {
|
||||
const base::Value::Dict& data = args.front().GetDict();
|
||||
const base::ListValue& args) {
|
||||
const base::DictValue& data = args.front().GetDict();
|
||||
|
||||
std::string request_type, allow, allow_empty, deny;
|
||||
GetRequestTypeAndFilters(data, request_type, allow, allow_empty, deny);
|
||||
@@ -451,7 +451,7 @@ void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
|
||||
for (auto* window : electron::WindowList::GetWindows()) {
|
||||
if (window->window_id() == window_id) {
|
||||
base::Value::Dict result = BuildTargetDescriptor(window);
|
||||
base::DictValue result = BuildTargetDescriptor(window);
|
||||
gfx::NativeWindow native_window = window->GetNativeWindow();
|
||||
ui::AXPlatformNode* node =
|
||||
ui::AXPlatformNode::FromNativeWindow(native_window);
|
||||
@@ -463,7 +463,7 @@ void ElectronAccessibilityUIMessageHandler::RequestNativeUITree(
|
||||
}
|
||||
|
||||
// No browser with the specified |id| was found.
|
||||
base::Value::Dict result;
|
||||
base::DictValue result;
|
||||
result.Set(kSessionIdField, window_id);
|
||||
result.Set(kTypeField, kBrowser);
|
||||
result.Set(kErrorField, "Window no longer exists.");
|
||||
@@ -533,7 +533,7 @@ void ElectronAccessibilityUIMessageHandler::OnVisibilityChanged(
|
||||
|
||||
void ElectronAccessibilityUIMessageHandler::OnUpdateDisplayTimer() {
|
||||
// Collect the current state.
|
||||
base::Value::Dict data;
|
||||
base::DictValue data;
|
||||
|
||||
SetProcessModeBools(
|
||||
content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode(),
|
||||
|
||||
@@ -34,12 +34,13 @@ class ElectronAccessibilityUIMessageHandler
|
||||
static void RegisterPrefs(user_prefs::PrefRegistrySyncable* registry);
|
||||
|
||||
private:
|
||||
void GetRequestTypeAndFilters(const base::Value::Dict& data,
|
||||
void GetRequestTypeAndFilters(const base::DictValue& data,
|
||||
std::string& request_type,
|
||||
std::string& allow,
|
||||
std::string& allow_empty,
|
||||
std::string& deny);
|
||||
void RequestNativeUITree(const base::Value::List& args);
|
||||
|
||||
void RequestNativeUITree(const base::ListValue& args);
|
||||
|
||||
// content::WebContentsObserver:
|
||||
void OnVisibilityChanged(content::Visibility visibility) override;
|
||||
@@ -49,7 +50,7 @@ class ElectronAccessibilityUIMessageHandler
|
||||
void OnUpdateDisplayTimer();
|
||||
|
||||
// The last data for display sent to the UI by OnUpdateDisplayTimer.
|
||||
base::Value::Dict last_data_;
|
||||
base::DictValue last_data_;
|
||||
|
||||
// A timer that runs while the UI is visible to call OnUpdateDisplayTimer.
|
||||
base::RepeatingTimer update_display_timer_;
|
||||
|
||||
@@ -178,7 +178,7 @@ bool ElectronUsbDelegate::CanRequestDevicePermission(
|
||||
if (!browser_context)
|
||||
return false;
|
||||
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", origin.GetURL().spec());
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
browser_context->GetPermissionControllerDelegate());
|
||||
|
||||
@@ -70,7 +70,7 @@ UsbChooserContext::UsbChooserContext(ElectronBrowserContext* context)
|
||||
// static
|
||||
base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
const device::mojom::UsbDeviceInfo& device_info) {
|
||||
base::Value::Dict device_value;
|
||||
base::DictValue device_value;
|
||||
device_value.Set(kDeviceNameKey, device_info.product_name
|
||||
? *device_info.product_name
|
||||
: std::u16string_view());
|
||||
@@ -100,9 +100,9 @@ base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
device_info.device_version_subminor);
|
||||
|
||||
bool has_active_configuration = false;
|
||||
base::Value::List configuration_list;
|
||||
base::ListValue configuration_list;
|
||||
for (const auto& configuration : device_info.configurations) {
|
||||
base::Value::Dict configuration_value;
|
||||
base::DictValue configuration_value;
|
||||
configuration_value.Set("configurationValue",
|
||||
configuration->configuration_value);
|
||||
configuration_value.Set("configurationName",
|
||||
@@ -111,12 +111,12 @@ base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
: std::u16string_view());
|
||||
|
||||
for (const auto& interface : configuration->interfaces) {
|
||||
base::Value::Dict interface_value;
|
||||
base::DictValue interface_value;
|
||||
interface_value.Set("interfaceNumber", interface->interface_number);
|
||||
|
||||
base::Value::List alternate_list;
|
||||
base::ListValue alternate_list;
|
||||
for (const auto& alternate : interface->alternates) {
|
||||
base::Value::Dict alternate_value;
|
||||
base::DictValue alternate_value;
|
||||
alternate_value.Set("alternateSetting", alternate->alternate_setting);
|
||||
alternate_value.Set("interfaceClass", alternate->class_code);
|
||||
alternate_value.Set("interfaceSubclass", alternate->subclass_code);
|
||||
@@ -125,9 +125,9 @@ base::Value UsbChooserContext::DeviceInfoToValue(
|
||||
? *alternate->interface_name
|
||||
: std::u16string_view());
|
||||
|
||||
base::Value::List endpoint_list;
|
||||
base::ListValue endpoint_list;
|
||||
for (const auto& endpoint : alternate->endpoints) {
|
||||
base::Value::Dict endpoint_value;
|
||||
base::DictValue endpoint_value;
|
||||
endpoint_value.Set("endpointNumber", endpoint->endpoint_number);
|
||||
|
||||
bool inbound = endpoint->direction ==
|
||||
@@ -258,7 +258,7 @@ void UsbChooserContext::RevokeObjectPermissionInternal(
|
||||
const url::Origin& origin,
|
||||
const base::Value& object,
|
||||
bool revoked_by_website = false) {
|
||||
const base::Value::Dict* object_dict = object.GetIfDict();
|
||||
const base::DictValue* object_dict = object.GetIfDict();
|
||||
DCHECK(object_dict != nullptr);
|
||||
|
||||
if (object_dict->FindString(kDeviceSerialNumberKey) != nullptr) {
|
||||
|
||||
@@ -216,7 +216,7 @@ void WebContentsPermissionHelper::RequestPermission(
|
||||
blink::PermissionType permission,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
bool user_gesture,
|
||||
base::Value::Dict details) {
|
||||
base::DictValue details) {
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
web_contents_->GetBrowserContext()->GetPermissionControllerDelegate());
|
||||
auto origin = web_contents_->GetLastCommittedURL();
|
||||
@@ -229,7 +229,7 @@ void WebContentsPermissionHelper::RequestPermission(
|
||||
|
||||
bool WebContentsPermissionHelper::CheckPermission(
|
||||
blink::PermissionType permission,
|
||||
base::Value::Dict details) const {
|
||||
base::DictValue details) const {
|
||||
auto* rfh = web_contents_->GetPrimaryMainFrame();
|
||||
auto* permission_manager = static_cast<ElectronPermissionManager*>(
|
||||
web_contents_->GetBrowserContext()->GetPermissionControllerDelegate());
|
||||
@@ -252,8 +252,8 @@ void WebContentsPermissionHelper::RequestMediaAccessPermission(
|
||||
auto callback = base::BindOnce(&MediaAccessAllowed, request,
|
||||
std::move(response_callback));
|
||||
|
||||
base::Value::Dict details;
|
||||
base::Value::List media_types;
|
||||
base::DictValue details;
|
||||
base::ListValue media_types;
|
||||
if (request.audio_type ==
|
||||
blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE) {
|
||||
media_types.Append("audio");
|
||||
@@ -306,7 +306,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
bool user_gesture,
|
||||
const GURL& url) {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("externalURL", url.spec());
|
||||
RequestPermission(requesting_frame, blink::PermissionType::OPEN_EXTERNAL,
|
||||
std::move(callback), user_gesture, std::move(details));
|
||||
@@ -315,7 +315,7 @@ void WebContentsPermissionHelper::RequestOpenExternalPermission(
|
||||
bool WebContentsPermissionHelper::CheckMediaAccessPermission(
|
||||
const url::Origin& security_origin,
|
||||
blink::mojom::MediaStreamType type) const {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", security_origin.GetURL().spec());
|
||||
details.Set("mediaType", MediaStreamTypeToString(type));
|
||||
auto blink_type = type == blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE
|
||||
@@ -326,7 +326,7 @@ bool WebContentsPermissionHelper::CheckMediaAccessPermission(
|
||||
|
||||
bool WebContentsPermissionHelper::CheckSerialAccessPermission(
|
||||
const url::Origin& embedding_origin) const {
|
||||
base::Value::Dict details;
|
||||
base::DictValue details;
|
||||
details.Set("securityOrigin", embedding_origin.GetURL().spec());
|
||||
return CheckPermission(blink::PermissionType::SERIAL, std::move(details));
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ class WebContentsPermissionHelper
|
||||
blink::PermissionType permission,
|
||||
base::OnceCallback<void(bool)> callback,
|
||||
bool user_gesture = false,
|
||||
base::Value::Dict details = {});
|
||||
base::DictValue details = {});
|
||||
|
||||
bool CheckPermission(blink::PermissionType permission,
|
||||
base::Value::Dict details) const;
|
||||
base::DictValue details) const;
|
||||
|
||||
// TODO(clavin): refactor to use the WebContents provided by the
|
||||
// WebContentsUserData base class instead of storing a duplicate ref
|
||||
|
||||
@@ -361,7 +361,7 @@ void WebContentsPreferences::AppendCommandLineSwitches(
|
||||
}
|
||||
|
||||
void WebContentsPreferences::SaveLastPreferences() {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
dict.Set(options::kNodeIntegration, node_integration_);
|
||||
dict.Set(options::kNodeIntegrationInSubFrames,
|
||||
node_integration_in_sub_frames_);
|
||||
|
||||
@@ -63,7 +63,7 @@ void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) {
|
||||
}
|
||||
|
||||
double ZoomLevelDelegate::GetDefaultZoomLevelPref() const {
|
||||
const base::Value::Dict& default_zoom_level_dictionary =
|
||||
const base::DictValue& default_zoom_level_dictionary =
|
||||
pref_service_->GetDict(kPartitionDefaultZoomLevel);
|
||||
// If no default has been previously set, the default returned is the
|
||||
// value used to initialize default_zoom_level in this function.
|
||||
@@ -77,15 +77,15 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
|
||||
|
||||
double level = change.zoom_level;
|
||||
ScopedDictPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
|
||||
base::Value::Dict& host_zoom_dictionaries = update.Get();
|
||||
base::DictValue& host_zoom_dictionaries = update.Get();
|
||||
|
||||
bool modification_is_removal =
|
||||
blink::ZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel());
|
||||
|
||||
base::Value::Dict* host_zoom_dictionary =
|
||||
base::DictValue* host_zoom_dictionary =
|
||||
host_zoom_dictionaries.FindDict(partition_key_);
|
||||
if (!host_zoom_dictionary) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
host_zoom_dictionaries.Set(partition_key_, std::move(dict));
|
||||
host_zoom_dictionary = host_zoom_dictionaries.FindDict(partition_key_);
|
||||
}
|
||||
@@ -97,9 +97,9 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
|
||||
}
|
||||
|
||||
void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
||||
const base::Value::Dict& host_zoom_dictionary) {
|
||||
const base::DictValue& host_zoom_dictionary) {
|
||||
std::vector<std::string> keys_to_remove;
|
||||
base::Value::Dict host_zoom_dictionary_copy = host_zoom_dictionary.Clone();
|
||||
base::DictValue host_zoom_dictionary_copy = host_zoom_dictionary.Clone();
|
||||
for (auto [host, value] : host_zoom_dictionary_copy) {
|
||||
const std::optional<double> zoom_level = value.GetIfDouble();
|
||||
|
||||
@@ -123,7 +123,7 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
|
||||
// have an empty host.
|
||||
{
|
||||
ScopedDictPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
|
||||
base::Value::Dict* sanitized_host_zoom_dictionary =
|
||||
base::DictValue* sanitized_host_zoom_dictionary =
|
||||
update->FindDict(partition_key_);
|
||||
if (sanitized_host_zoom_dictionary) {
|
||||
for (const std::string& key : keys_to_remove)
|
||||
@@ -143,9 +143,9 @@ void ZoomLevelDelegate::InitHostZoomMap(content::HostZoomMap* host_zoom_map) {
|
||||
|
||||
// Initialize the HostZoomMap with per-host zoom levels from the persisted
|
||||
// zoom-level preference values.
|
||||
const base::Value::Dict& host_zoom_dictionaries =
|
||||
const base::DictValue& host_zoom_dictionaries =
|
||||
pref_service_->GetDict(kPartitionPerHostZoomLevels);
|
||||
const base::Value::Dict* host_zoom_dictionary =
|
||||
const base::DictValue* host_zoom_dictionary =
|
||||
host_zoom_dictionaries.FindDict(partition_key_);
|
||||
if (host_zoom_dictionary) {
|
||||
// Since we're calling this before setting up zoom_subscription_ below we
|
||||
|
||||
@@ -47,7 +47,7 @@ class ZoomLevelDelegate : public content::ZoomLevelDelegate {
|
||||
void InitHostZoomMap(content::HostZoomMap* host_zoom_map) override;
|
||||
|
||||
private:
|
||||
void ExtractPerHostZoomLevels(const base::Value::Dict& host_zoom_dictionary);
|
||||
void ExtractPerHostZoomLevels(const base::DictValue& host_zoom_dictionary);
|
||||
|
||||
// This is a callback function that receives notifications from HostZoomMap
|
||||
// when per-host zoom levels change. It is used to update the per-host
|
||||
|
||||
@@ -339,7 +339,7 @@ float NativeImage::GetAspectRatio(const std::optional<float> scale_factor) {
|
||||
}
|
||||
|
||||
gin_helper::Handle<NativeImage> NativeImage::Resize(gin::Arguments* args,
|
||||
base::Value::Dict options) {
|
||||
base::DictValue options) {
|
||||
float scale_factor = GetScaleFactorFromOptions(args);
|
||||
|
||||
gfx::Size size = GetSize(scale_factor);
|
||||
|
||||
@@ -117,7 +117,7 @@ class NativeImage final : public gin_helper::DeprecatedWrappable<NativeImage> {
|
||||
v8::Local<v8::Value> GetBitmap(gin::Arguments* args);
|
||||
v8::Local<v8::Value> GetNativeHandle(gin_helper::ErrorThrower thrower);
|
||||
gin_helper::Handle<NativeImage> Resize(gin::Arguments* args,
|
||||
base::Value::Dict options);
|
||||
base::DictValue options);
|
||||
gin_helper::Handle<NativeImage> Crop(v8::Isolate* isolate,
|
||||
const gfx::Rect& rect);
|
||||
std::string ToDataURL(gin::Arguments* args);
|
||||
|
||||
@@ -360,7 +360,8 @@ void ImportedTextureGetVideoFrame(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||
auto* isolate = info.GetIsolate();
|
||||
auto* wrapper = static_cast<ImportedSharedTextureWrapper*>(
|
||||
info.Data().As<v8::External>()->Value());
|
||||
info.Data().As<v8::External>()->Value(
|
||||
v8::kExternalPointerTypeTagDefault));
|
||||
|
||||
if (wrapper->IsReferenceReleased()) {
|
||||
gin_helper::ErrorThrower(isolate).ThrowTypeError(
|
||||
@@ -382,7 +383,8 @@ void ImportedTextureStartTransferSharedTexture(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||
auto* isolate = info.GetIsolate();
|
||||
auto* wrapper = static_cast<ImportedSharedTextureWrapper*>(
|
||||
info.Data().As<v8::External>()->Value());
|
||||
info.Data().As<v8::External>()->Value(
|
||||
v8::kExternalPointerTypeTagDefault));
|
||||
|
||||
if (wrapper->IsReferenceReleased()) {
|
||||
gin_helper::ErrorThrower(isolate).ThrowTypeError(
|
||||
@@ -396,7 +398,8 @@ void ImportedTextureStartTransferSharedTexture(
|
||||
|
||||
void ImportedTextureRelease(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||
auto* wrapper = static_cast<ImportedSharedTextureWrapper*>(
|
||||
info.Data().As<v8::External>()->Value());
|
||||
info.Data().As<v8::External>()->Value(
|
||||
v8::kExternalPointerTypeTagDefault));
|
||||
|
||||
auto cb = info[0];
|
||||
if (cb->IsFunction()) {
|
||||
@@ -415,7 +418,8 @@ void ImportedTextureGetFrameCreationSyncToken(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||
auto* isolate = info.GetIsolate();
|
||||
auto* wrapper = static_cast<ImportedSharedTextureWrapper*>(
|
||||
info.Data().As<v8::External>()->Value());
|
||||
info.Data().As<v8::External>()->Value(
|
||||
v8::kExternalPointerTypeTagDefault));
|
||||
|
||||
if (wrapper->IsReferenceReleased()) {
|
||||
gin_helper::ErrorThrower(isolate).ThrowTypeError(
|
||||
@@ -431,7 +435,8 @@ void ImportedTextureSetReleaseSyncToken(
|
||||
const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||
auto* isolate = info.GetIsolate();
|
||||
auto* wrapper = static_cast<ImportedSharedTextureWrapper*>(
|
||||
info.Data().As<v8::External>()->Value());
|
||||
info.Data().As<v8::External>()->Value(
|
||||
v8::kExternalPointerTypeTagDefault));
|
||||
|
||||
if (wrapper->IsReferenceReleased()) {
|
||||
gin_helper::ErrorThrower(isolate).ThrowTypeError(
|
||||
@@ -454,7 +459,8 @@ v8::Local<v8::Value> CreateImportedSharedTextureFromSharedImage(
|
||||
auto* wrapper = new ImportedSharedTextureWrapper();
|
||||
wrapper->ist = base::WrapRefCounted(imported);
|
||||
|
||||
auto imported_wrapped = v8::External::New(isolate, wrapper);
|
||||
auto imported_wrapped =
|
||||
v8::External::New(isolate, wrapper, v8::kExternalPointerTypeTagDefault);
|
||||
gin::Dictionary root(isolate, v8::Object::New(isolate));
|
||||
|
||||
auto releaser = v8::Function::New(isolate->GetCurrentContext(),
|
||||
|
||||
@@ -37,16 +37,16 @@ const char kSeparators[] = "\\/";
|
||||
const char kSeparators[] = "/";
|
||||
#endif
|
||||
|
||||
const base::Value::Dict* GetNodeFromPath(std::string path,
|
||||
const base::Value::Dict& root);
|
||||
const base::DictValue* GetNodeFromPath(std::string path,
|
||||
const base::DictValue& root);
|
||||
|
||||
// Gets the "files" from "dir".
|
||||
const base::Value::Dict* GetFilesNode(const base::Value::Dict& root,
|
||||
const base::Value::Dict& dir) {
|
||||
const base::DictValue* GetFilesNode(const base::DictValue& root,
|
||||
const base::DictValue& dir) {
|
||||
// Test for symbol linked directory.
|
||||
const std::string* link = dir.FindString("link");
|
||||
if (link != nullptr) {
|
||||
const base::Value::Dict* linked_node = GetNodeFromPath(*link, root);
|
||||
const base::DictValue* linked_node = GetNodeFromPath(*link, root);
|
||||
if (!linked_node)
|
||||
return nullptr;
|
||||
return linked_node->FindDict("files");
|
||||
@@ -56,27 +56,27 @@ const base::Value::Dict* GetFilesNode(const base::Value::Dict& root,
|
||||
}
|
||||
|
||||
// Gets sub-file "name" from "dir".
|
||||
const base::Value::Dict* GetChildNode(const base::Value::Dict& root,
|
||||
const std::string& name,
|
||||
const base::Value::Dict& dir) {
|
||||
const base::DictValue* GetChildNode(const base::DictValue& root,
|
||||
const std::string& name,
|
||||
const base::DictValue& dir) {
|
||||
if (name.empty())
|
||||
return &root;
|
||||
|
||||
const base::Value::Dict* files = GetFilesNode(root, dir);
|
||||
const base::DictValue* files = GetFilesNode(root, dir);
|
||||
return files ? files->FindDict(name) : nullptr;
|
||||
}
|
||||
|
||||
// Gets the node of "path" from "root".
|
||||
const base::Value::Dict* GetNodeFromPath(std::string path,
|
||||
const base::Value::Dict& root) {
|
||||
const base::DictValue* GetNodeFromPath(std::string path,
|
||||
const base::DictValue& root) {
|
||||
if (path.empty())
|
||||
return &root;
|
||||
|
||||
const base::Value::Dict* dir = &root;
|
||||
const base::DictValue* dir = &root;
|
||||
for (size_t delimiter_position = path.find_first_of(kSeparators);
|
||||
delimiter_position != std::string::npos;
|
||||
delimiter_position = path.find_first_of(kSeparators)) {
|
||||
const base::Value::Dict* child =
|
||||
const base::DictValue* child =
|
||||
GetChildNode(root, path.substr(0, delimiter_position), *dir);
|
||||
if (!child)
|
||||
return nullptr;
|
||||
@@ -91,7 +91,7 @@ const base::Value::Dict* GetNodeFromPath(std::string path,
|
||||
bool FillFileInfoWithNode(Archive::FileInfo* info,
|
||||
uint32_t header_size,
|
||||
bool load_integrity,
|
||||
const base::Value::Dict* node) {
|
||||
const base::DictValue* node) {
|
||||
if (std::optional<int> size = node->FindInt("size")) {
|
||||
info->size = static_cast<uint32_t>(*size);
|
||||
} else {
|
||||
@@ -120,11 +120,11 @@ bool FillFileInfoWithNode(Archive::FileInfo* info,
|
||||
#if BUILDFLAG(IS_MAC) || BUILDFLAG(IS_WIN)
|
||||
if (load_integrity &&
|
||||
electron::fuses::IsEmbeddedAsarIntegrityValidationEnabled()) {
|
||||
if (const base::Value::Dict* integrity = node->FindDict("integrity")) {
|
||||
if (const base::DictValue* integrity = node->FindDict("integrity")) {
|
||||
const std::string* algorithm = integrity->FindString("algorithm");
|
||||
const std::string* hash = integrity->FindString("hash");
|
||||
std::optional<int> block_size = integrity->FindInt("blockSize");
|
||||
const base::Value::List* blocks = integrity->FindList("blocks");
|
||||
const base::ListValue* blocks = integrity->FindList("blocks");
|
||||
|
||||
if (algorithm && hash && block_size && block_size > 0 && blocks) {
|
||||
IntegrityPayload integrity_payload;
|
||||
@@ -281,8 +281,7 @@ bool Archive::GetFileInfo(const base::FilePath& path, FileInfo* info) const {
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
@@ -297,8 +296,7 @@ bool Archive::Stat(const base::FilePath& path, Stats* stats) const {
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
@@ -320,12 +318,11 @@ bool Archive::Readdir(const base::FilePath& path,
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* files_node = GetFilesNode(*header_, *node);
|
||||
const base::DictValue* files_node = GetFilesNode(*header_, *node);
|
||||
if (!files_node)
|
||||
return false;
|
||||
|
||||
@@ -339,8 +336,7 @@ bool Archive::Realpath(const base::FilePath& path,
|
||||
if (!header_)
|
||||
return false;
|
||||
|
||||
const base::Value::Dict* node =
|
||||
GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
const base::DictValue* node = GetNodeFromPath(path.AsUTF8Unsafe(), *header_);
|
||||
if (!node)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ class Archive {
|
||||
base::File file_{base::File::FILE_OK};
|
||||
int fd_ = -1;
|
||||
uint32_t header_size_ = 0;
|
||||
std::optional<base::Value::Dict> header_;
|
||||
std::optional<base::DictValue> header_;
|
||||
|
||||
// Cached external temporary files.
|
||||
base::Lock external_files_lock_;
|
||||
|
||||
@@ -78,7 +78,7 @@ auto LoadIntegrityConfig() {
|
||||
LOG(FATAL) << "Invalid integrity config: NOT a valid JSON.";
|
||||
}
|
||||
|
||||
const base::Value::List* file_configs = root.value().GetIfList();
|
||||
const base::ListValue* file_configs = root.value().GetIfList();
|
||||
if (!file_configs) {
|
||||
LOG(FATAL) << "Invalid integrity config: NOT a list.";
|
||||
}
|
||||
@@ -87,7 +87,7 @@ auto LoadIntegrityConfig() {
|
||||
cache.reserve(file_configs->size());
|
||||
for (size_t i = 0; i < file_configs->size(); i++) {
|
||||
// Skip invalid file configs
|
||||
const base::Value::Dict* ele_dict = (*file_configs)[i].GetIfDict();
|
||||
const base::DictValue* ele_dict = (*file_configs)[i].GetIfDict();
|
||||
if (!ele_dict) {
|
||||
LOG(WARNING) << "Skip config " << i << ": NOT a valid dict";
|
||||
continue;
|
||||
|
||||
@@ -187,7 +187,7 @@ v8::Local<v8::Value> Converter<blink::PermissionType>::ToV8(
|
||||
return StringToV8(isolate, "payment-handler");
|
||||
case blink::PermissionType::PERIODIC_BACKGROUND_SYNC:
|
||||
return StringToV8(isolate, "periodic-background-sync");
|
||||
case blink::PermissionType::DURABLE_STORAGE:
|
||||
case blink::PermissionType::PERSISTENT_STORAGE:
|
||||
return StringToV8(isolate, "persistent-storage");
|
||||
case blink::PermissionType::GEOLOCATION:
|
||||
return StringToV8(isolate, "geolocation");
|
||||
|
||||
@@ -19,11 +19,11 @@ struct Converter<device::mojom::HidDeviceInfoPtr> {
|
||||
v8::Isolate* isolate,
|
||||
const device::mojom::HidDeviceInfoPtr& device) {
|
||||
base::Value value = electron::HidChooserContext::DeviceInfoToValue(*device);
|
||||
base::Value::Dict& dict = value.GetDict();
|
||||
base::DictValue& dict = value.GetDict();
|
||||
dict.Set("deviceId",
|
||||
electron::HidChooserController::PhysicalDeviceIdFromDeviceInfo(
|
||||
*device));
|
||||
return gin::Converter<base::Value::Dict>::ToV8(isolate, dict);
|
||||
return gin::Converter<base::DictValue>::ToV8(isolate, dict);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -164,16 +164,16 @@ v8::Local<v8::Value> Converter<net::CertPrincipal>::ToV8(
|
||||
v8::Local<v8::Value> Converter<net::HttpResponseHeaders*>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
net::HttpResponseHeaders* headers) {
|
||||
base::Value::Dict response_headers;
|
||||
base::DictValue response_headers;
|
||||
if (headers) {
|
||||
size_t iter = 0;
|
||||
std::string key;
|
||||
std::string value;
|
||||
while (headers->EnumerateHeaderLines(&iter, &key, &value)) {
|
||||
key = base::ToLowerASCII(key);
|
||||
base::Value::List* values = response_headers.FindList(key);
|
||||
base::ListValue* values = response_headers.FindList(key);
|
||||
if (!values)
|
||||
values = &response_headers.Set(key, base::Value::List())->GetList();
|
||||
values = &response_headers.Set(key, base::ListValue())->GetList();
|
||||
values->Append(value);
|
||||
}
|
||||
}
|
||||
@@ -245,7 +245,7 @@ v8::Local<v8::Value> Converter<net::HttpRequestHeaders>::ToV8(
|
||||
bool Converter<net::HttpRequestHeaders>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
net::HttpRequestHeaders* out) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
if (!ConvertFromV8(isolate, val, &dict))
|
||||
return false;
|
||||
for (const auto it : dict) {
|
||||
@@ -588,12 +588,12 @@ bool Converter<scoped_refptr<network::ResourceRequestBody>>::FromV8(
|
||||
base::Value list_value;
|
||||
if (!ConvertFromV8(isolate, val, &list_value) || !list_value.is_list())
|
||||
return false;
|
||||
base::Value::List& list = list_value.GetList();
|
||||
base::ListValue& list = list_value.GetList();
|
||||
*out = base::MakeRefCounted<network::ResourceRequestBody>();
|
||||
for (base::Value& dict_value : list) {
|
||||
if (!dict_value.is_dict())
|
||||
return false;
|
||||
base::Value::Dict& dict = dict_value.GetDict();
|
||||
base::DictValue& dict = dict_value.GetDict();
|
||||
std::string* type = dict.FindString("type");
|
||||
if (!type)
|
||||
return false;
|
||||
|
||||
@@ -87,10 +87,12 @@ v8::Local<v8::Value> Converter<electron::OffscreenSharedTextureValue>::ToV8(
|
||||
// GC collects the object.
|
||||
auto* monitor = new OffscreenReleaseHolderMonitor(val.releaser_holder);
|
||||
|
||||
auto releaserHolder = v8::External::New(isolate, monitor);
|
||||
auto releaserHolder =
|
||||
v8::External::New(isolate, monitor, v8::kExternalPointerTypeTagDefault);
|
||||
auto releaserFunc = [](const v8::FunctionCallbackInfo<v8::Value>& info) {
|
||||
auto* mon = static_cast<OffscreenReleaseHolderMonitor*>(
|
||||
info.Data().As<v8::External>()->Value());
|
||||
info.Data().As<v8::External>()->Value(
|
||||
v8::kExternalPointerTypeTagDefault));
|
||||
// Release the shared texture, so that future frames can be generated.
|
||||
mon->ReleaseTexture();
|
||||
// Release the monitor happens at GC, don't release here.
|
||||
|
||||
@@ -11,9 +11,9 @@
|
||||
|
||||
namespace gin {
|
||||
|
||||
bool Converter<base::Value::Dict>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::Dict* out) {
|
||||
bool Converter<base::DictValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::DictValue* out) {
|
||||
std::unique_ptr<base::Value> value =
|
||||
content::V8ValueConverter::Create()->FromV8Value(
|
||||
val, isolate->GetCurrentContext());
|
||||
@@ -46,9 +46,9 @@ v8::Local<v8::Value> Converter<base::ValueView>::ToV8(
|
||||
val, isolate->GetCurrentContext());
|
||||
}
|
||||
|
||||
bool Converter<base::Value::List>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::List* out) {
|
||||
bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::ListValue* out) {
|
||||
std::unique_ptr<base::Value> value =
|
||||
content::V8ValueConverter::Create()->FromV8Value(
|
||||
val, isolate->GetCurrentContext());
|
||||
|
||||
@@ -17,12 +17,12 @@ struct Converter<base::ValueView> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<base::Value::Dict> {
|
||||
struct Converter<base::DictValue> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::Dict* out);
|
||||
base::DictValue* out);
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const base::Value::Dict& val) {
|
||||
const base::DictValue& val) {
|
||||
return gin::ConvertToV8(isolate, base::ValueView{val});
|
||||
}
|
||||
};
|
||||
@@ -39,12 +39,12 @@ struct Converter<base::Value> {
|
||||
};
|
||||
|
||||
template <>
|
||||
struct Converter<base::Value::List> {
|
||||
struct Converter<base::ListValue> {
|
||||
static bool FromV8(v8::Isolate* isolate,
|
||||
v8::Local<v8::Value> val,
|
||||
base::Value::List* out);
|
||||
base::ListValue* out);
|
||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
|
||||
const base::Value::List& val) {
|
||||
const base::ListValue& val) {
|
||||
return gin::ConvertToV8(isolate, base::ValueView{val});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -14,7 +14,10 @@ namespace {
|
||||
|
||||
struct TranslatorHolder {
|
||||
explicit TranslatorHolder(v8::Isolate* isolate)
|
||||
: handle(isolate, v8::External::New(isolate, this)) {
|
||||
: handle(isolate,
|
||||
v8::External::New(isolate,
|
||||
this,
|
||||
v8::kExternalPointerTypeTagDefault)) {
|
||||
handle.SetWeak(this, &GC, v8::WeakCallbackType::kParameter);
|
||||
}
|
||||
~TranslatorHolder() {
|
||||
@@ -57,7 +60,8 @@ void CallTranslator(v8::Local<v8::External> external,
|
||||
}
|
||||
}
|
||||
|
||||
auto* holder = static_cast<TranslatorHolder*>(external->Value());
|
||||
auto* holder = static_cast<TranslatorHolder*>(
|
||||
external->Value(v8::kExternalPointerTypeTagDefault));
|
||||
holder->translator.Run(args);
|
||||
|
||||
// Free immediately for one-time callback.
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "shell/common/gin_helper/function_template.h"
|
||||
|
||||
#include "base/strings/strcat.h"
|
||||
#include "gin/public/gin_embedders.h"
|
||||
|
||||
namespace gin_helper {
|
||||
|
||||
@@ -29,7 +30,10 @@ void CallbackHolderBase::DisposeObserver::OnDisposed() {
|
||||
}
|
||||
|
||||
CallbackHolderBase::CallbackHolderBase(v8::Isolate* isolate)
|
||||
: v8_ref_(isolate, v8::External::New(isolate, this)),
|
||||
: v8_ref_(isolate,
|
||||
v8::External::New(isolate,
|
||||
this,
|
||||
gin::kGinInternalCallbackHolderBaseTag)),
|
||||
dispose_observer_(gin::PerIsolateData::From(isolate), this) {
|
||||
v8_ref_.SetWeak(this, &CallbackHolderBase::FirstWeakCallback,
|
||||
v8::WeakCallbackType::kParameter);
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "gin/arguments.h"
|
||||
#include "gin/per_isolate_data.h"
|
||||
#include "gin/public/gin_embedders.h"
|
||||
#include "shell/common/gin_helper/destroyable.h"
|
||||
#include "shell/common/gin_helper/error_thrower.h"
|
||||
#include "v8/include/v8-context.h"
|
||||
@@ -289,8 +290,8 @@ struct Dispatcher<ReturnType(ArgTypes...)> {
|
||||
static void DispatchToCallbackImpl(gin::Arguments* args) {
|
||||
v8::Local<v8::External> v8_holder;
|
||||
CHECK(args->GetData(&v8_holder));
|
||||
CallbackHolderBase* holder_base =
|
||||
reinterpret_cast<CallbackHolderBase*>(v8_holder->Value());
|
||||
CallbackHolderBase* holder_base = reinterpret_cast<CallbackHolderBase*>(
|
||||
v8_holder->Value(gin::kGinInternalCallbackHolderBaseTag));
|
||||
|
||||
typedef CallbackHolder<ReturnType(ArgTypes...)> HolderT;
|
||||
HolderT* holder = static_cast<HolderT*>(holder_base);
|
||||
|
||||
@@ -115,7 +115,7 @@ node::Environment* CreateEnvironment(v8::Isolate* isolate,
|
||||
node::Environment* env = node::CreateEnvironment(isolate_data, context, args,
|
||||
exec_args, env_flags);
|
||||
if (auto message = try_catch.Message(); !message.IsEmpty()) {
|
||||
base::Value::Dict dict;
|
||||
base::DictValue dict;
|
||||
|
||||
if (std::string str; gin::ConvertFromV8(isolate, message->Get(), &str))
|
||||
dict.Set("message", std::move(str));
|
||||
|
||||
@@ -91,8 +91,7 @@ SpellCheckClient::~SpellCheckClient() {
|
||||
|
||||
void SpellCheckClient::RequestCheckingOfText(
|
||||
const blink::WebString& text_to_check,
|
||||
const std::vector<
|
||||
WebTextCheckClient::WebSpellingMarker>& /* spelling_markers */,
|
||||
const std::vector<blink::WebSpellingMarker>& /* spelling_markers */,
|
||||
ShouldForceRefreshTextCheckService /* should_force_refresh */,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completion_callback) {
|
||||
std::u16string text(text_to_check.Utf16());
|
||||
|
||||
@@ -44,8 +44,7 @@ class SpellCheckClient : public blink::WebSpellCheckPanelHostClient,
|
||||
// blink::WebTextCheckClient:
|
||||
void RequestCheckingOfText(
|
||||
const blink::WebString& text_to_check,
|
||||
const std::vector<WebTextCheckClient::WebSpellingMarker>&
|
||||
spelling_markers,
|
||||
const std::vector<blink::WebSpellingMarker>& spelling_markers,
|
||||
ShouldForceRefreshTextCheckService should_force_refresh,
|
||||
std::unique_ptr<blink::WebTextCheckingCompletion> completion_callback)
|
||||
override;
|
||||
|
||||
@@ -51,7 +51,7 @@ bool PrintRenderFrameHelperDelegate::OverridePrint(
|
||||
// instructs the PDF plugin to print. This is to make window.print() on a
|
||||
// PDF plugin document correctly print the PDF. See
|
||||
// https://crbug.com/448720.
|
||||
base::Value::Dict message;
|
||||
base::DictValue message;
|
||||
message.Set("type", "print");
|
||||
post_message_support->PostMessageFromValue(base::Value(std::move(message)));
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user