chore: bump chromium to 111.0.5518.0 (main) (#36575)

* chore: bump chromium in DEPS to 110.0.5461.0

* chore: update patches

* 3903024: hid: Add connection count tracking methods for HidDelegate

3903024

* 4076211: Turn FrameTreeNode::frame_tree into raw_ref.

4076211

* chore: bump chromium in DEPS to 110.0.5463.0

* chore: bump chromium in DEPS to 110.0.5465.0

* fix patches

* 3835037: Add new slides media session actions to Picture-in-Picture window

3835037

* chore: update patches

* chore: bump chromium in DEPS to 110.0.5467.0

* chore: update patches

* chore: bump chromium in DEPS to 110.0.5469.0

* chore: bump chromium in DEPS to 110.0.5471.0

* chore: bump chromium in DEPS to 110.0.5473.0

* chore: bump chromium in DEPS to 110.0.5475.0

* chore: update patches

* 4074449: Add gl::FrameData to software path

4074449

* 4065264: [Extensions] Add a new side panel view type

4065264

* 4060548: Remove base::Value::GetListDeprecated().

4060548

* chore: add missing RefCountedMemory include

* 4081108: task posting v3: remove task_runner_util{.h,_unittest.cc}

4081108

* 4072471: Rename Mixed Download Blocking to Insecure Download Blocking

4072471

* 4025927: [Code Health] Migrate e/c/manifest.cc to base::Value::Dict interface

4025927

* chore: fixup patch indices

* chore: bump chromium in DEPS to 110.0.5477.0

* chore: fixup preconnect_manager.patch

* chore: fixup patch indices

* fixup! 4074449: Add gl::FrameData to software path

* 4074449: Add gl::FrameData to software path

This commit also reformatted the two files in this patch. The only
change here is the addition of the |data| arg to |OnSwapBuffers|.

4074449

* 4081108: task posting v3: remove task_runner_util{.h,_unittest.cc}

4081108

* 4085814: [Test Automation] Move NativeWindowTracker to ui/views

4085814

* 4032656: hid: Abstract HidSystemTrayIcon class for profiles' HID connections

4032656

* chore: bump chromium in DEPS to 110.0.5479.0

* chore: fixup patches & simplify printing patch

To be specific, I replaced some combination of line removals &
commenting-out with `#if 0` blocks since they were already there for
android.

Should be functionally the same, just written differently for better
patch maintainability.

* chore: bump chromium in DEPS to 110.0.5481.0

* chore: update patch indicies

* 4098946: Migrate Extension::Create() argument to base::Value::Dict (part 4 of 4)

4098946

* chore: bump chromium in DEPS to 111.0.5482.0

* chore: bump chromium in DEPS to 111.0.5484.0

* chore: bump chromium in DEPS to 111.0.5486.0

* chore: update patch indices

* 4112903: Reland "Move gl::FrameData to gfx::FrameData"

4112903

* 4056216: Option to create a tab target with Target.createTarget in /json/new

4056216

* chore: bump chromium in DEPS to 111.0.5488.0

* chore: bump chromium in DEPS to 111.0.5490.0

* chore: bump chromium in DEPS to 111.0.5492.0

* chore: bump chromium in DEPS to 111.0.5494.0

* chore: bump chromium in DEPS to 111.0.5496.0

* chore: bump chromium in DEPS to 111.0.5498.0

* chore: bump chromium in DEPS to 111.0.5500.0

* chore: bump chromium in DEPS to 111.0.5502.0

* chore: update patch indices

+ small update to printing.patch due to:
3653941: [printing] Extract settings logic from PrintJobWorker
3653941

* 4113994: Cleanup: Rename webui_generated_resources_* to webui_resources_*.
4113994

* 4112537: Remove DictionaryPrefUpdate.
4112537

* 4072073: Remove //chrome/browser/ash dependency from pdf_extension_util.cc
4072073

* 4055223: [Remove FileSystemConnector] Remove DownloadItemRerouteInfo
4055223

* Migrate base::DictionaryValue to base::Value::Dict

This relates to multiple CLs cleaning up this class in this roll,
but the ones that are specifically relevant here:

4116096: [CodeHealth] Remove DictionaryValue::GetInteger
4116096

4113764: [CodeHealth] Remove deprecated DictionaryValue::SetInteger()
4113764

* 3653941: [printing] Extract settings logic from PrintJobWorker
3653941

* chore: bump chromium in DEPS to 111.0.5504.0

* chore: update patches

* (WIP) 4003663: Enable Microtask queues per WindowAgent.

4003663

* chore: bump chromium in DEPS to 111.0.5506.0

* chore: update patches

* fix: printing patch

It was complaining that this method isn't used on windows

* chore: bump chromium in DEPS to 111.0.5508.0

* chore: bump chromium in DEPS to 111.0.5510.0

* chore: bump chromium in DEPS to 111.0.5512.0

* chore: bump chromium in DEPS to 111.0.5514.0

* chore: bump chromium in DEPS to 111.0.5516.0

* chore: update patches

* chore: bump chromium in DEPS to 111.0.5518.0

* chore: update patches

* 4027428: [rsafor] Move rsaFor requests to a separate permission

4027428

* Revert "(WIP) 4003663: Enable Microtask queues per WindowAgent."

This reverts commit cc36d226e3f3fe5f4bea6538102d55ce3203190f.

* chore: disable Microtask queues per WindowAgent.

see 4003663

* chore: cleanup after rebase

* fixup: disable Microtask queues per WindowAgent.

* chore: cleanup password from keychain after test

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Calvin Watford <cwatford@slack-corp.com>
Co-authored-by: clavin <clavin@electronjs.org>
This commit is contained in:
electron-roller[bot] 2023-01-05 21:35:34 -05:00 committed by GitHub
parent ba962c94cc
commit 90af7d7fe2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
118 changed files with 684 additions and 738 deletions

View file

@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/task/task_runner_util.h"
#include "base/task/thread_pool.h"
#include "chrome/browser/browser_process.h"
#include "components/net_log/chrome_net_log.h"
@ -143,9 +142,8 @@ v8::Local<v8::Promise> NetLog::StartLogging(base::FilePath log_path,
net_log_exporter_.set_disconnect_handler(
base::BindOnce(&NetLog::OnConnectionError, base::Unretained(this)));
base::PostTaskAndReplyWithResult(
file_task_runner_.get(), FROM_HERE,
base::BindOnce(OpenFileForWriting, log_path),
file_task_runner_->PostTaskAndReplyWithResult(
FROM_HERE, base::BindOnce(OpenFileForWriting, log_path),
base::BindOnce(&NetLog::StartNetLogAfterCreateFile,
weak_ptr_factory_.GetWeakPtr(), capture_mode,
max_file_size, std::move(custom_constants)));

View file

@ -278,8 +278,7 @@ void DownloadIdCallback(content::DownloadManager* download_manager,
download::DownloadItem::INTERRUPTED,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DOWNLOAD_INTERRUPT_REASON_NETWORK_TIMEOUT, false, base::Time(),
false, std::vector<download::DownloadItem::ReceivedSlice>(),
download::DownloadItemRerouteInfo());
false, std::vector<download::DownloadItem::ReceivedSlice>());
}
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)

View file

@ -641,6 +641,7 @@ WebContents::Type GetTypeFromViewType(extensions::mojom::ViewType view_type) {
case extensions::mojom::ViewType::kExtensionGuest:
case extensions::mojom::ViewType::kTabContents:
case extensions::mojom::ViewType::kOffscreenDocument:
case extensions::mojom::ViewType::kExtensionSidePanel:
case extensions::mojom::ViewType::kInvalid:
return WebContents::Type::kRemote;
}
@ -3755,8 +3756,8 @@ void WebContents::DevToolsAddFileSystem(
base::Value::Dict file_system_value = CreateFileSystemValue(file_system);
auto* pref_service = GetPrefService(GetDevToolsWebContents());
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->SetKey(path.AsUTF8Unsafe(), base::Value(type));
ScopedDictPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update->Set(path.AsUTF8Unsafe(), type);
std::string error = ""; // No error
inspectable_web_contents_->CallClientFunction(
"DevToolsAPI", "fileSystemAdded", base::Value(error),
@ -3773,8 +3774,8 @@ void WebContents::DevToolsRemoveFileSystem(
file_system_path);
auto* pref_service = GetPrefService(GetDevToolsWebContents());
DictionaryPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update.Get()->RemoveKey(path);
ScopedDictPrefUpdate update(pref_service, prefs::kDevToolsFileSystemPaths);
update->Remove(path);
inspectable_web_contents_->CallClientFunction(
"DevToolsAPI", "fileSystemRemoved", base::Value(path));
@ -3794,8 +3795,7 @@ void WebContents::DevToolsIndexPath(
std::unique_ptr<base::Value> parsed_excluded_folders =
base::JSONReader::ReadDeprecated(excluded_folders_message);
if (parsed_excluded_folders && parsed_excluded_folders->is_list()) {
for (const base::Value& folder_path :
parsed_excluded_folders->GetListDeprecated()) {
for (const base::Value& folder_path : parsed_excluded_folders->GetList()) {
if (folder_path.is_string())
excluded_folders.push_back(folder_path.GetString());
}

View file

@ -27,7 +27,7 @@ void WebContents::DetachFromOuterFrame() {
if (frame_tree_node_id != content::FrameTreeNode::kFrameTreeNodeInvalidId) {
auto* node = content::FrameTreeNode::GloballyFindByID(frame_tree_node_id);
DCHECK(node->parent());
node->frame_tree()->RemoveFrame(node);
node->frame_tree().RemoveFrame(node);
}
}

View file

@ -203,9 +203,9 @@ class Browser : public WindowListObserver {
base::Value::Dict user_info);
// Bounce the dock icon.
enum class BounceType{
kCritical = 0, // NSCriticalRequest
kInformational = 10, // NSInformationalRequest
enum class BounceType {
kCritical = 0, // NSCriticalRequest
kInformational = 10, // NSInformationalRequest
};
int DockBounce(BounceType type);
void DockCancelBounce(int request_id);
@ -361,11 +361,7 @@ class Browser : public WindowListObserver {
base::Time last_dock_show_;
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_WIN)
base::Value about_panel_options_;
#elif BUILDFLAG(IS_MAC)
base::DictionaryValue about_panel_options_;
#endif
#if BUILDFLAG(IS_WIN)
void UpdateBadgeContents(HWND hwnd,

View file

@ -205,7 +205,7 @@ void Browser::ShowAboutPanel() {
if ((val = opts.FindListKey("authors"))) {
std::vector<const char*> cstrs;
for (const auto& authorVal : val->GetListDeprecated()) {
for (const auto& authorVal : val->GetList()) {
if (authorVal.is_string()) {
cstrs.push_back(authorVal.GetString().c_str());
}

View file

@ -508,8 +508,7 @@ void Browser::SetAboutPanelOptions(base::Value::Dict options) {
std::string key = pair.first;
if (!key.empty() && pair.second.is_string()) {
key[0] = base::ToUpperASCII(key[0]);
auto val = std::make_unique<base::Value>(pair.second.Clone());
about_panel_options_.Set(key, std::move(val));
about_panel_options_.GetDict().Set(key, pair.second.Clone());
}
}
}

View file

@ -12,10 +12,6 @@
#include "build/build_config.h"
#include "shell/browser/login_handler.h"
namespace base {
class DictionaryValue;
}
namespace electron {
class BrowserObserver : public base::CheckedObserver {

View file

@ -11,6 +11,7 @@
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "chrome/browser/browser_process.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
#include "components/os_crypt/os_crypt.h"
@ -290,6 +291,10 @@ HidPolicyAllowedDevices* BrowserProcessImpl::hid_policy_allowed_devices() {
return nullptr;
}
HidSystemTrayIcon* BrowserProcessImpl::hid_system_tray_icon() {
return nullptr;
}
void BrowserProcessImpl::SetSystemLocale(const std::string& locale) {
system_locale_ = locale;
}

View file

@ -95,6 +95,7 @@ class BrowserProcessImpl : public BrowserProcess {
resource_coordinator::TabManager* GetTabManager() override;
SerialPolicyAllowedPorts* serial_policy_allowed_ports() override;
HidPolicyAllowedDevices* hid_policy_allowed_devices() override;
HidSystemTrayIcon* hid_system_tray_icon() override;
void CreateDevToolsProtocolHandler() override {}
void CreateDevToolsAutoOpener() override {}
void set_background_mode_manager_for_test(

View file

@ -274,7 +274,7 @@ void ElectronDownloadManagerDelegate::OnDownloadPathGenerated(
std::move(callback).Run(
path, download::DownloadItem::TARGET_DISPOSITION_PROMPT,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
item->GetMixedContentStatus(), path, base::FilePath(),
item->GetInsecureDownloadStatus(), path, base::FilePath(),
std::string() /*mime_type*/, download::DOWNLOAD_INTERRUPT_REASON_NONE);
}
}
@ -314,7 +314,7 @@ void ElectronDownloadManagerDelegate::OnDownloadSaveDialogDone(
std::move(download_callback)
.Run(path, download::DownloadItem::TARGET_DISPOSITION_PROMPT,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
item->GetMixedContentStatus(), path, base::FilePath(),
item->GetInsecureDownloadStatus(), path, base::FilePath(),
std::string() /*mime_type*/, interrupt_reason);
}
@ -333,7 +333,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
download->GetForcedFilePath(),
download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::MixedContentStatus::UNKNOWN,
download::DownloadItem::InsecureDownloadStatus::UNKNOWN,
download->GetForcedFilePath(), base::FilePath(),
std::string() /*mime_type*/, download::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
@ -346,7 +346,7 @@ bool ElectronDownloadManagerDelegate::DetermineDownloadTarget(
std::move(*callback).Run(
save_path, download::DownloadItem::TARGET_DISPOSITION_OVERWRITE,
download::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::MixedContentStatus::UNKNOWN, save_path,
download::DownloadItem::InsecureDownloadStatus::UNKNOWN, save_path,
base::FilePath(), std::string() /*mime_type*/,
download::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;

View file

@ -26,7 +26,7 @@
// To add a new component to this API, simply:
// 1. Add your component to the Component enum in
// chrome/common/extensions/api/resources_private.idl
// 2. Create an AddStringsForMyComponent(base::DictionaryValue * dict) method.
// 2. Create an AddStringsForMyComponent(base::Value::Dict* dict) method.
// 3. Tie in that method to the switch statement in Run()
namespace extensions {

View file

@ -36,7 +36,7 @@ ElectronComponentExtensionResourceManager::
base::Value::Dict pdf_strings;
pdf_extension_util::AddStrings(
pdf_extension_util::PdfViewerContext::kPdfViewer, &pdf_strings);
pdf_extension_util::AddAdditionalData(true, &pdf_strings);
pdf_extension_util::AddAdditionalData(false, true, &pdf_strings);
ui::TemplateReplacements pdf_viewer_replacements;
ui::TemplateReplacementsFromDictionaryValue(pdf_strings,

View file

@ -14,7 +14,6 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner_util.h"
#include "base/threading/thread_restrictions.h"
#include "base/time/time.h"
#include "extensions/browser/extension_file_task_runner.h"
@ -104,9 +103,8 @@ void ElectronExtensionLoader::LoadExtension(
const base::FilePath& extension_dir,
int load_flags,
base::OnceCallback<void(const Extension*, const std::string&)> cb) {
base::PostTaskAndReplyWithResult(
GetExtensionFileTaskRunner().get(), FROM_HERE,
base::BindOnce(&LoadUnpacked, extension_dir, load_flags),
GetExtensionFileTaskRunner()->PostTaskAndReplyWithResult(
FROM_HERE, base::BindOnce(&LoadUnpacked, extension_dir, load_flags),
base::BindOnce(&ElectronExtensionLoader::FinishExtensionLoad,
weak_factory_.GetWeakPtr(), std::move(cb)));
}
@ -206,9 +204,8 @@ void ElectronExtensionLoader::LoadExtensionForReload(
// when loading this extension and retain it here. As is, reloading an
// extension will cause the file access permission to be dropped.
int load_flags = Extension::FOLLOW_SYMLINKS_ANYWHERE;
base::PostTaskAndReplyWithResult(
GetExtensionFileTaskRunner().get(), FROM_HERE,
base::BindOnce(&LoadUnpacked, path, load_flags),
GetExtensionFileTaskRunner()->PostTaskAndReplyWithResult(
FROM_HERE, base::BindOnce(&LoadUnpacked, path, load_flags),
base::BindOnce(&ElectronExtensionLoader::FinishExtensionReload,
weak_factory_.GetWeakPtr(), extension_id));
did_schedule_reload_ = true;

View file

@ -13,6 +13,7 @@
#include "base/files/file_util.h"
#include "base/json/json_string_value_serializer.h"
#include "base/path_service.h"
#include "base/values.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/grit/browser_resources.h"
#include "components/value_store/value_store_factory_impl.h"
@ -93,23 +94,23 @@ void ElectronExtensionSystem::InitForRegularProfile(bool extensions_enabled) {
management_policy_ = std::make_unique<ManagementPolicy>();
}
std::unique_ptr<base::DictionaryValue> ParseManifest(
std::unique_ptr<base::Value::Dict> ParseManifest(
base::StringPiece manifest_contents) {
JSONStringValueDeserializer deserializer(manifest_contents);
std::unique_ptr<base::Value> manifest = deserializer.Deserialize(NULL, NULL);
if (!manifest.get() || !manifest->is_dict()) {
LOG(ERROR) << "Failed to parse extension manifest.";
return std::unique_ptr<base::DictionaryValue>();
return std::unique_ptr<base::Value::Dict>();
}
return base::DictionaryValue::From(std::move(manifest));
return std::make_unique<base::Value::Dict>(std::move(manifest->GetDict()));
}
void ElectronExtensionSystem::LoadComponentExtensions() {
std::string utf8_error;
#if BUILDFLAG(ENABLE_PDF_VIEWER)
std::string pdf_manifest_string = pdf_extension_util::GetManifest();
std::unique_ptr<base::DictionaryValue> pdf_manifest =
std::unique_ptr<base::Value::Dict> pdf_manifest =
ParseManifest(pdf_manifest_string);
if (pdf_manifest) {
base::FilePath root_directory;

View file

@ -16,6 +16,7 @@
#include "media/base/media_switches.h"
#include "net/base/features.h"
#include "services/network/public/cpp/features.h"
#include "third_party/blink/renderer/platform/scheduler/common/features.h" // nogncheck
#if BUILDFLAG(IS_MAC)
#include "device/base/features.h" // nogncheck
@ -36,6 +37,12 @@ void InitializeFeatureList() {
disable_features +=
std::string(",") + features::kSpareRendererForSitePerProcess.name;
// Microtask queues per WindowAgent causes issues with Node, so disable
// this feature for now. See
// https://chromium-review.googlesource.com/c/chromium/src/+/4003663
disable_features +=
std::string(",") + blink::scheduler::kMicrotaskQueuePerWindowAgent.name;
#if BUILDFLAG(IS_MAC)
// Needed for WebUSB implementation
enable_features += std::string(",") + device::kNewUsbBackend.name;

View file

@ -61,6 +61,10 @@ class ElectronHidDelegate : public content::HidDelegate,
void OnDeviceChanged(const device::mojom::HidDeviceInfo&) override;
void OnHidManagerConnectionError() override;
void OnHidChooserContextShutdown() override;
void IncrementConnectionCount(content::BrowserContext* browser_context,
const url::Origin& origin) override {}
void DecrementConnectionCount(content::BrowserContext* browser_context,
const url::Origin& origin) override {}
void DeleteControllerForFrame(content::RenderFrameHost* render_frame_host);

View file

@ -26,10 +26,6 @@
class SkRegion;
namespace base {
class DictionaryValue;
}
namespace content {
struct NativeWebKeyboardEvent;
}

View file

@ -122,7 +122,7 @@ network::mojom::URLResponseHeadPtr ToResponseHead(
head->headers->AddHeader(iter.first, iter.second.GetString());
} else if (iter.second.is_list()) {
// key: [values...]
for (const auto& item : iter.second.GetListDeprecated()) {
for (const auto& item : iter.second.GetList()) {
if (item.is_string())
head->headers->AddHeader(iter.first, item.GetString());
}

View file

@ -208,10 +208,10 @@ void PrintPreviewMessageHandler::PrintPreviewCancelled(int32_t document_cookie,
}
void PrintPreviewMessageHandler::PrintToPDF(
base::DictionaryValue options,
base::Value::Dict options,
gin_helper::Promise<v8::Local<v8::Value>> promise) {
int request_id;
options.GetInteger(printing::kPreviewRequestID, &request_id);
options.Get(printing::kPreviewRequestID, &request_id);
promise_map_.emplace(request_id, std::move(promise));
auto* focused_frame = web_contents_->GetFocusedFrame();

View file

@ -125,7 +125,7 @@ void DevToolsManagerDelegate::HandleCommand(
}
scoped_refptr<content::DevToolsAgentHost>
DevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
DevToolsManagerDelegate::CreateNewTarget(const GURL& url, bool for_tab) {
return nullptr;
}

View file

@ -29,7 +29,8 @@ class DevToolsManagerDelegate : public content::DevToolsManagerDelegate {
base::span<const uint8_t> message,
NotHandledCallback callback) override;
scoped_refptr<content::DevToolsAgentHost> CreateNewTarget(
const GURL& url) override;
const GURL& url,
bool for_tab) override;
std::string GetDiscoveryPageHTML() override;
bool HasBundledFrontendResources() override;
};

View file

@ -290,20 +290,21 @@ class InspectableWebContents::NetworkResourceLoader
stream_id_, bindings_, resource_request_, traffic_annotation_,
std::move(url_loader_factory_), std::move(callback_), delay);
} else {
base::DictionaryValue response;
response.SetInteger("statusCode", response_headers_
? response_headers_->response_code()
: net::HTTP_OK);
base::Value response(base::Value::Type::DICT);
response.GetDict().Set(
"statusCode", response_headers_ ? response_headers_->response_code()
: net::HTTP_OK);
auto headers = std::make_unique<base::DictionaryValue>();
base::Value::Dict headers;
size_t iterator = 0;
std::string name;
std::string value;
while (response_headers_ &&
response_headers_->EnumerateHeaderLines(&iterator, &name, &value))
headers->SetString(name, value);
headers.Set(name, value);
response.GetDict().Set("headers", std::move(headers));
response.Set("headers", std::move(headers));
std::move(callback_).Run(&response);
}
@ -654,8 +655,8 @@ void InspectableWebContents::LoadNetworkResource(DispatchCallback callback,
int stream_id) {
GURL gurl(url);
if (!gurl.is_valid()) {
base::DictionaryValue response;
response.SetInteger("statusCode", net::HTTP_NOT_FOUND);
base::Value response(base::Value::Type::DICT);
response.GetDict().Set("statusCode", net::HTTP_NOT_FOUND);
std::move(callback).Run(&response);
return;
}
@ -875,18 +876,18 @@ void InspectableWebContents::GetPreference(DispatchCallback callback,
void InspectableWebContents::SetPreference(const std::string& name,
const std::string& value) {
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
update.Get()->SetKey(name, base::Value(value));
ScopedDictPrefUpdate update(pref_service_, kDevToolsPreferences);
update->Set(name, base::Value(value));
}
void InspectableWebContents::RemovePreference(const std::string& name) {
DictionaryPrefUpdate update(pref_service_, kDevToolsPreferences);
update.Get()->RemoveKey(name);
ScopedDictPrefUpdate update(pref_service_, kDevToolsPreferences);
update->Remove(name);
}
void InspectableWebContents::ClearPreferences() {
DictionaryPrefUpdate unsynced_update(pref_service_, kDevToolsPreferences);
unsynced_update->GetDict().clear();
ScopedDictPrefUpdate unsynced_update(pref_service_, kDevToolsPreferences);
unsynced_update->clear();
}
void InspectableWebContents::GetSyncInformation(DispatchCallback callback) {

View file

@ -57,8 +57,8 @@ void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) {
if (blink::PageZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel()))
return;
DictionaryPrefUpdate update(pref_service_, kPartitionDefaultZoomLevel);
update->SetDoubleKey(partition_key_, level);
ScopedDictPrefUpdate update(pref_service_, kPartitionDefaultZoomLevel);
update->Set(partition_key_, level);
host_zoom_map_->SetDefaultZoomLevel(level);
}
@ -76,10 +76,8 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
return;
double level = change.zoom_level;
DictionaryPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
base::Value* host_zoom_update = update.Get();
DCHECK(host_zoom_update);
base::Value::Dict& host_zoom_dictionaries = host_zoom_update->GetDict();
ScopedDictPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
base::Value::Dict& host_zoom_dictionaries = update.Get();
bool modification_is_removal =
blink::PageZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel());
@ -124,10 +122,8 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
// Sanitize prefs to remove entries that match the default zoom level and/or
// have an empty host.
{
DictionaryPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
base::Value* host_zoom_dictionaries = update.Get();
base::Value* sanitized_host_zoom_dictionary =
host_zoom_dictionaries->FindDictKey(partition_key_);
ScopedDictPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
base::Value* sanitized_host_zoom_dictionary = update->Find(partition_key_);
if (sanitized_host_zoom_dictionary) {
for (const std::string& s : keys_to_remove)
sanitized_host_zoom_dictionary->RemoveKey(s);

View file

@ -11,6 +11,7 @@
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/pattern.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"

View file

@ -194,6 +194,8 @@ v8::Local<v8::Value> Converter<blink::PermissionType>::ToV8(
return StringToV8(isolate, "window-management");
case blink::PermissionType::DISPLAY_CAPTURE:
return StringToV8(isolate, "display-capture");
case blink::PermissionType::TOP_LEVEL_STORAGE_ACCESS:
return StringToV8(isolate, "top-level-storage-access");
case blink::PermissionType::NUM:
break;
}

View file

@ -22,8 +22,7 @@ v8::Local<v8::Value> Converter<const extensions::Extension*>::ToV8(
dict.Set("path", extension->path());
dict.Set("url", extension->url());
dict.Set("version", extension->VersionString());
dict.Set("manifest",
*static_cast<const base::Value*>(extension->manifest()->value()));
dict.Set("manifest", extension->manifest()->value()->Clone());
return gin::ConvertToV8(isolate, dict);
}