chore: bump chromium to 91.0.4448.0 (master) (#28009)

* chore: bump chromium in DEPS to 91.0.4435.3

* build: add 'use_rts' definition

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2694187

* chore: update patches

* chore: media_internal_resources becomes resources

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2699022

* chore: update patches

* refactor: extensions::ViewType moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351

* chore: might_have_observers has been removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2667839

* refactor: CertVerifier is not in the network namespace anymore

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2689805

* refactor: ExtensionUserScriptManager is now UserScriptManager

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2657617

* refactor: content::SiteInstance::GetSiteForURL was removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2680274

* refactor: MenuItemType was moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443

* refactor: extensions::ViewType was moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2710351

* refacotr: grit::ResourceMap replaced with webui::ResourcePath

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2685601

* refactor: blink::MenuItem::Type was moved to mojom

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2071443

* refactor: CreateDataPipe deprecated form was removed

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2698090

* refactor: DesktopMediaList::Type replaces content::DesktopMediaType_*

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2700637

* chore: wire up activation_time in OSR

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2638372

* chore: remove deleted file from chromium_src list

* chore: fix lint

* update patches

* chore: bump chromium in DEPS to 91.0.4438.0

* chore: bump chromium in DEPS to 91.0.4439.0

* chore: bump chromium in DEPS to 91.0.4440.0

* chore: bump chromium in DEPS to 91.0.4441.0

* chore: bump chromium in DEPS to 91.0.4442.0

* chore: bump chromium in DEPS to 91.0.4443.0

* chore: bump chromium in DEPS to 91.0.4445.0

* chore: bump chromium in DEPS to 91.0.4446.0

* chore: update patches

* fixup gn check

* Merge branch 'master' into roller/chromium/master

* update to xcode 12.4.0

Needed because of 8008deb41c

* 2752406: [LSC] Replace base::string16 with std::u16string in //ui

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

* 2752406: [LSC] Replace base::string16 with std::u16string in //ui

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

* 2752932: Associate each AwProxyingURLLoaderFactory with a frame tree node id.

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

* 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer.

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

* 2734095: Introduce StoragePartitionId type to wrap current string representation.

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

* chore: bump chromium in DEPS to 91.0.4448.0

* Update patches

* 2743594: Remove WebSize from blink.

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

* 2725403: Add URLLoaderClient::OnReceiveEarlyHints()

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

* 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer.

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

* 2721718: Move HostID to extensions::mojom::HostID

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

* 2733070: Rename observer to URLLoaderNetworkServiceObserver

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

* Use nogncheck for content/browser/site_instance_impl.h

This is needed because  //content/browser:browser is not a visible target

* 2648046: Introduce alert notification helper .app

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

* 2752406: [LSC] Replace base::string16 with std::u16string in //ui

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

* only include mac notifications on mac

* add additional skipping of atk toolchain check

* 2757472: Reland "Reland "[LSC] Remove base::string16 alias""

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

* 2757472: Reland "Reland "[LSC] Remove base::string16 alias""

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

* 2720306: [api] Remove deprecated [Shared]ArrayBuffer API

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

* Fixup 2721718: Move HostID to extensions::mojom::HostID

* fixup 2651385: Moving Profile::shared_cors_origin_access_list_ into //content layer

* Fixup 2752406: [LSC] Replace base::string16 with std::u16string in //ui

* Fixup 2725403: Add URLLoaderClient::OnReceiveEarlyHints()

* update node headers

* chore: bump chromium in DEPS to 91.0.4449.0

* Revert "chore: bump chromium in DEPS to 91.0.4449.0"

This reverts commit bccafa0289.

* 2693008: Fix loading non-system cursors on Windows on browser_tests

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

* 2757472: Reland "Reland "[LSC] Remove base::string16 alias""

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

* undo changes to WebContentsPreferences::GetPreloadPath to fix mac build

* fix StrCat issue

* incantations for WebContentsPreferences::GetPreloadPath wide strings

* bump nan

* fix GetAsString maybe?

* windows build fixes

* more windows build fix

* SetAppUserModelID -> wstring

* upgrade nan dep in tests

* lint

* wstrings are cross-platform

* linter

* only bind setAppUserModelId on windows

* fix a messed up merge

* well that was an odyssey

* backport fcdf35e from v8 to fix nan crash

* disable typedarrays-test.js

* don't defer in NSWindow creation

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

* use PartitionAllocator for ArrayBuffers in the main process

* fix patches

* chore: omit some unnecessary conversions

* refactor: make LoginItemSettings::path a wstring

* refactor: make ShowTaskDialog take a wstr

* Revert "refactor: make LoginItemSettings::path a wstring"

This reverts commit 9127cff58b.

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
Electron Bot
2021-03-30 19:17:09 -07:00
committed by GitHub
parent 6016e244fa
commit a006cf681b
233 changed files with 1586 additions and 1469 deletions

View File

@@ -48,7 +48,7 @@ namespace electron {
namespace {
bool GetProcessExecPath(base::string16* exe) {
bool GetProcessExecPath(std::wstring* exe) {
base::FilePath path;
if (!base::PathService::Get(base::FILE_EXE, &path)) {
return false;
@@ -57,13 +57,13 @@ bool GetProcessExecPath(base::string16* exe) {
return true;
}
bool GetProtocolLaunchPath(gin::Arguments* args, base::string16* exe) {
bool GetProtocolLaunchPath(gin::Arguments* args, std::wstring* exe) {
if (!args->GetNext(exe) && !GetProcessExecPath(exe)) {
return false;
}
// Read in optional args arg
std::vector<base::string16> launch_args;
std::vector<std::wstring> launch_args;
if (args->GetNext(&launch_args) && !launch_args.empty())
*exe = base::StringPrintf(L"\"%ls\" %ls \"%%1\"", exe->c_str(),
base::JoinString(launch_args, L" ").c_str());
@@ -75,7 +75,7 @@ bool GetProtocolLaunchPath(gin::Arguments* args, base::string16* exe) {
// Windows treats a given scheme as an Internet scheme only if its registry
// entry has a "URL Protocol" key. Check this, otherwise we allow ProgIDs to be
// used as custom protocols which leads to security bugs.
bool IsValidCustomProtocol(const base::string16& scheme) {
bool IsValidCustomProtocol(const std::wstring& scheme) {
if (scheme.empty())
return false;
base::win::RegKey cmd_key(HKEY_CLASSES_ROOT, scheme.c_str(), KEY_QUERY_VALUE);
@@ -90,11 +90,10 @@ bool IsValidCustomProtocol(const base::string16& scheme) {
// Windows 8 introduced a new protocol->executable binding system which cannot
// be retrieved in the HKCR registry subkey method implemented below. We call
// AssocQueryString with the new Win8-only flag ASSOCF_IS_PROTOCOL instead.
base::string16 GetAppInfoHelperForProtocol(ASSOCSTR assoc_str,
const GURL& url) {
const base::string16 url_scheme = base::ASCIIToUTF16(url.scheme());
std::wstring GetAppInfoHelperForProtocol(ASSOCSTR assoc_str, const GURL& url) {
const std::wstring url_scheme = base::ASCIIToWide(url.scheme());
if (!IsValidCustomProtocol(url_scheme))
return base::string16();
return std::wstring();
wchar_t out_buffer[1024];
DWORD buffer_size = base::size(out_buffer);
@@ -103,13 +102,13 @@ base::string16 GetAppInfoHelperForProtocol(ASSOCSTR assoc_str,
out_buffer, &buffer_size);
if (FAILED(hr)) {
DLOG(WARNING) << "AssocQueryString failed!";
return base::string16();
return std::wstring();
}
return base::string16(out_buffer);
return std::wstring(out_buffer);
}
void OnIconDataAvailable(const base::FilePath& app_path,
const base::string16& app_display_name,
const std::wstring& app_display_name,
gin_helper::Promise<gin_helper::Dictionary> promise,
gfx::Image icon) {
if (!icon.IsEmpty()) {
@@ -126,21 +125,21 @@ void OnIconDataAvailable(const base::FilePath& app_path,
}
}
base::string16 GetAppDisplayNameForProtocol(const GURL& url) {
std::wstring GetAppDisplayNameForProtocol(const GURL& url) {
return GetAppInfoHelperForProtocol(ASSOCSTR_FRIENDLYAPPNAME, url);
}
base::string16 GetAppPathForProtocol(const GURL& url) {
std::wstring GetAppPathForProtocol(const GURL& url) {
return GetAppInfoHelperForProtocol(ASSOCSTR_EXECUTABLE, url);
}
base::string16 GetAppForProtocolUsingRegistry(const GURL& url) {
const base::string16 url_scheme = base::ASCIIToUTF16(url.scheme());
std::wstring GetAppForProtocolUsingRegistry(const GURL& url) {
const std::wstring url_scheme = base::ASCIIToWide(url.scheme());
if (!IsValidCustomProtocol(url_scheme))
return base::string16();
return std::wstring();
// First, try and extract the application's display name.
base::string16 command_to_launch;
std::wstring command_to_launch;
base::win::RegKey cmd_key_name(HKEY_CLASSES_ROOT, url_scheme.c_str(),
KEY_READ);
if (cmd_key_name.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS &&
@@ -150,7 +149,7 @@ base::string16 GetAppForProtocolUsingRegistry(const GURL& url) {
// Otherwise, parse the command line in the registry, and return the basename
// of the program path if it exists.
const base::string16 cmd_key_path = url_scheme + L"\\shell\\open\\command";
const std::wstring cmd_key_path = url_scheme + L"\\shell\\open\\command";
base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(),
KEY_READ);
if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) {
@@ -159,18 +158,20 @@ base::string16 GetAppForProtocolUsingRegistry(const GURL& url) {
return command_line.GetProgram().BaseName().value();
}
return base::string16();
return std::wstring();
}
bool FormatCommandLineString(base::string16* exe,
const std::vector<base::string16>& launch_args) {
bool FormatCommandLineString(std::wstring* exe,
const std::vector<std::u16string>& launch_args) {
if (exe->empty() && !GetProcessExecPath(exe)) {
return false;
}
if (!launch_args.empty()) {
std::u16string joined_launch_args =
base::JoinString(launch_args, base::UTF8ToUTF16(" "));
*exe = base::StringPrintf(L"%ls %ls", exe->c_str(),
base::JoinString(launch_args, L" ").c_str());
base::UTF16ToWide(joined_launch_args).c_str());
}
return true;
@@ -184,18 +185,20 @@ bool FormatCommandLineString(base::string16* exe,
std::vector<Browser::LaunchItem> GetLoginItemSettingsHelper(
base::win::RegistryValueIterator* it,
boolean* executable_will_launch_at_login,
base::string16 scope,
std::wstring scope,
const Browser::LoginItemSettings& options) {
std::vector<Browser::LaunchItem> launch_items;
base::FilePath lookup_exe_path;
if (options.path.empty()) {
base::string16 process_exe_path;
std::wstring process_exe_path;
GetProcessExecPath(&process_exe_path);
lookup_exe_path =
base::CommandLine::FromString(process_exe_path).GetProgram();
} else {
lookup_exe_path = base::CommandLine::FromString(options.path).GetProgram();
lookup_exe_path =
base::CommandLine::FromString(base::UTF16ToWide(options.path))
.GetProgram();
}
if (!lookup_exe_path.empty()) {
@@ -287,7 +290,7 @@ Browser::UserTask::~UserTask() = default;
void GetFileIcon(const base::FilePath& path,
v8::Isolate* isolate,
base::CancelableTaskTracker* cancelable_task_tracker_,
const base::string16 app_display_name,
const std::wstring app_display_name,
gin_helper::Promise<gin_helper::Dictionary> promise) {
base::FilePath normalized_path = path.NormalizePathSeparators();
IconLoader::IconSize icon_size = IconLoader::IconSize::LARGE;
@@ -316,13 +319,13 @@ void GetApplicationInfoForProtocolUsingRegistry(
base::CancelableTaskTracker* cancelable_task_tracker_) {
base::FilePath app_path;
const base::string16 url_scheme = base::ASCIIToUTF16(url.scheme());
const std::wstring url_scheme = base::ASCIIToWide(url.scheme());
if (!IsValidCustomProtocol(url_scheme)) {
promise.RejectWithErrorMessage("invalid url_scheme");
return;
}
base::string16 command_to_launch;
const base::string16 cmd_key_path = url_scheme + L"\\shell\\open\\command";
std::wstring command_to_launch;
const std::wstring cmd_key_path = url_scheme + L"\\shell\\open\\command";
base::win::RegKey cmd_key_exe(HKEY_CLASSES_ROOT, cmd_key_path.c_str(),
KEY_READ);
if (cmd_key_exe.ReadValue(NULL, &command_to_launch) == ERROR_SUCCESS) {
@@ -334,7 +337,7 @@ void GetApplicationInfoForProtocolUsingRegistry(
"Unable to retrieve installation path to app");
return;
}
const base::string16 app_display_name = GetAppForProtocolUsingRegistry(url);
const std::wstring app_display_name = GetAppForProtocolUsingRegistry(url);
if (app_display_name.empty()) {
promise.RejectWithErrorMessage(
@@ -354,7 +357,7 @@ void GetApplicationInfoForProtocolUsingAssocQuery(
const GURL& url,
gin_helper::Promise<gin_helper::Dictionary> promise,
base::CancelableTaskTracker* cancelable_task_tracker_) {
base::string16 app_path = GetAppPathForProtocol(url);
std::wstring app_path = GetAppPathForProtocol(url);
if (app_path.empty()) {
promise.RejectWithErrorMessage(
@@ -362,7 +365,7 @@ void GetApplicationInfoForProtocolUsingAssocQuery(
return;
}
base::string16 app_display_name = GetAppDisplayNameForProtocol(url);
std::wstring app_display_name = GetAppDisplayNameForProtocol(url);
if (app_display_name.empty()) {
promise.RejectWithErrorMessage("Unable to retrieve display name of app");
@@ -390,7 +393,7 @@ void Browser::ClearRecentDocuments() {
SHAddToRecentDocs(SHARD_APPIDINFO, nullptr);
}
void Browser::SetAppUserModelID(const base::string16& name) {
void Browser::SetAppUserModelID(const std::wstring& name) {
electron::SetAppUserModelID(name);
}
@@ -426,12 +429,12 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
// Main Registry Key
HKEY root = HKEY_CURRENT_USER;
base::string16 keyPath = L"Software\\Classes\\";
std::wstring keyPath = L"Software\\Classes\\";
// Command Key
base::string16 wprotocol = base::UTF8ToUTF16(protocol);
base::string16 shellPath = wprotocol + L"\\shell";
base::string16 cmdPath = keyPath + shellPath + L"\\open\\command";
std::wstring wprotocol = base::UTF8ToWide(protocol);
std::wstring shellPath = wprotocol + L"\\shell";
std::wstring cmdPath = keyPath + shellPath + L"\\open\\command";
base::win::RegKey classesKey;
base::win::RegKey commandKey;
@@ -445,12 +448,12 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
// Key doesn't even exist, we can confirm that it is not set
return true;
base::string16 keyVal;
std::wstring keyVal;
if (FAILED(commandKey.ReadValue(L"", &keyVal)))
// Default value not set, we can confirm that it is not set
return true;
base::string16 exe;
std::wstring exe;
if (!GetProtocolLaunchPath(args, &exe))
return false;
@@ -461,7 +464,7 @@ bool Browser::RemoveAsDefaultProtocolClient(const std::string& protocol,
// Let's clean up after ourselves
base::win::RegKey protocolKey;
base::string16 protocolPath = keyPath + wprotocol;
std::wstring protocolPath = keyPath + wprotocol;
if (SUCCEEDED(
protocolKey.Open(root, protocolPath.c_str(), KEY_ALL_ACCESS))) {
@@ -500,17 +503,17 @@ bool Browser::SetAsDefaultProtocolClient(const std::string& protocol,
if (protocol.empty())
return false;
base::string16 exe;
std::wstring exe;
if (!GetProtocolLaunchPath(args, &exe))
return false;
// Main Registry Key
HKEY root = HKEY_CURRENT_USER;
base::string16 keyPath = base::UTF8ToUTF16("Software\\Classes\\" + protocol);
base::string16 urlDecl = base::UTF8ToUTF16("URL:" + protocol);
std::wstring keyPath = base::UTF8ToWide("Software\\Classes\\" + protocol);
std::wstring urlDecl = base::UTF8ToWide("URL:" + protocol);
// Command Key
base::string16 cmdPath = keyPath + L"\\shell\\open\\command";
std::wstring cmdPath = keyPath + L"\\shell\\open\\command";
// Write information to registry
base::win::RegKey key(root, keyPath.c_str(), KEY_ALL_ACCESS);
@@ -530,16 +533,16 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
if (protocol.empty())
return false;
base::string16 exe;
std::wstring exe;
if (!GetProtocolLaunchPath(args, &exe))
return false;
// Main Registry Key
HKEY root = HKEY_CURRENT_USER;
base::string16 keyPath = base::UTF8ToUTF16("Software\\Classes\\" + protocol);
std::wstring keyPath = base::UTF8ToWide("Software\\Classes\\" + protocol);
// Command Key
base::string16 cmdPath = keyPath + L"\\shell\\open\\command";
std::wstring cmdPath = keyPath + L"\\shell\\open\\command";
base::win::RegKey key;
base::win::RegKey commandKey;
@@ -551,7 +554,7 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
// Key doesn't exist, we can confirm that it is not set
return false;
base::string16 keyVal;
std::wstring keyVal;
if (FAILED(commandKey.ReadValue(L"", &keyVal)))
// Default value not set, we can confirm that it is not set
return false;
@@ -560,15 +563,15 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
return keyVal == exe;
}
base::string16 Browser::GetApplicationNameForProtocol(const GURL& url) {
std::u16string Browser::GetApplicationNameForProtocol(const GURL& url) {
// Windows 8 or above has a new protocol association query.
if (base::win::GetVersion() >= base::win::Version::WIN8) {
base::string16 application_name = GetAppDisplayNameForProtocol(url);
std::wstring application_name = GetAppDisplayNameForProtocol(url);
if (!application_name.empty())
return application_name;
return base::WideToUTF16(application_name);
}
return GetAppForProtocolUsingRegistry(url);
return base::WideToUTF16(GetAppForProtocolUsingRegistry(url));
}
v8::Local<v8::Promise> Browser::GetApplicationInfoForProtocol(
@@ -686,11 +689,10 @@ void Browser::UpdateBadgeContents(
}
void Browser::SetLoginItemSettings(LoginItemSettings settings) {
base::string16 key_path =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
std::wstring key_path = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
base::win::RegKey key(HKEY_CURRENT_USER, key_path.c_str(), KEY_ALL_ACCESS);
base::string16 startup_approved_key_path =
std::wstring startup_approved_key_path =
L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\StartupApproved"
L"\\Run";
base::win::RegKey startup_approved_key(
@@ -699,7 +701,7 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
!settings.name.empty() ? settings.name.c_str() : GetAppUserModelID();
if (settings.open_at_login) {
base::string16 exe = settings.path;
std::wstring exe = base::UTF16ToWide(settings.path);
if (FormatCommandLineString(&exe, settings.args)) {
key.WriteValue(key_name, exe.c_str());
@@ -732,13 +734,13 @@ void Browser::SetLoginItemSettings(LoginItemSettings settings) {
Browser::LoginItemSettings Browser::GetLoginItemSettings(
const LoginItemSettings& options) {
LoginItemSettings settings;
base::string16 keyPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
std::wstring keyPath = L"Software\\Microsoft\\Windows\\CurrentVersion\\Run";
base::win::RegKey key(HKEY_CURRENT_USER, keyPath.c_str(), KEY_ALL_ACCESS);
base::string16 keyVal;
std::wstring keyVal;
// keep old openAtLogin behaviour
if (!FAILED(key.ReadValue(GetAppUserModelID(), &keyVal))) {
base::string16 exe = options.path;
std::wstring exe = base::UTF16ToWide(options.path);
if (FormatCommandLineString(&exe, options.args)) {
settings.open_at_login = keyVal == exe;
}