chore: bump chromium to 94.0.4584.0 (main) (#30030)

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com>
Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
electron-roller[bot] 2021-07-26 09:02:16 -07:00 committed by GitHub
parent a6ab702ae4
commit 64ba8feb93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
97 changed files with 531 additions and 553 deletions

View file

@ -11,6 +11,10 @@
#include <utility>
#include <vector>
#if defined(OS_POSIX)
#include <sys/stat.h>
#endif
#if defined(OS_WIN)
#include <windows.h> // windows.h must be included first

View file

@ -321,7 +321,8 @@ v8::Local<v8::Promise> Cookies::Set(v8::Isolate* isolate,
ParseTimeProperty(details.FindDoubleKey("creationDate")),
ParseTimeProperty(details.FindDoubleKey("expirationDate")),
ParseTimeProperty(details.FindDoubleKey("lastAccessDate")), secure,
http_only, same_site, net::COOKIE_PRIORITY_DEFAULT, same_party);
http_only, same_site, net::COOKIE_PRIORITY_DEFAULT, same_party,
absl::nullopt);
if (!canonical_cookie || !canonical_cookie->IsCanonical()) {
promise.RejectWithErrorMessage(
InclusionStatusToString(net::CookieInclusionStatus(

View file

@ -37,7 +37,6 @@
#include "content/browser/renderer_host/render_widget_host_impl.h" // nogncheck
#include "content/browser/renderer_host/render_widget_host_view_base.h" // nogncheck
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/color_chooser.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/favicon_status.h"
@ -174,10 +173,6 @@
#endif
#endif
#if BUILDFLAG(ENABLE_COLOR_CHOOSER)
#include "chrome/browser/ui/color_chooser.h"
#endif
#if BUILDFLAG(ENABLE_PICTURE_IN_PICTURE)
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#endif
@ -877,8 +872,14 @@ void WebContents::InitWithExtensionView(v8::Isolate* isolate,
extensions::mojom::ViewType view_type) {
// Must reassign type prior to calling `Init`.
type_ = GetTypeFromViewType(view_type);
if (GetType() == Type::kRemote)
if (type_ == Type::kRemote)
return;
if (type_ == Type::kBackgroundPage)
// non-background-page WebContents are retained by other classes. We need
// to pin here to prevent background-page WebContents from being GC'd.
// The background page api::WebContents will live until the underlying
// content::WebContents is destroyed.
Pin(isolate);
// Allow toggling DevTools for background pages
Observe(web_contents);
@ -2519,7 +2520,7 @@ void WebContents::Print(gin::Arguments* args) {
// We don't want to allow the user to enable these settings
// but we need to set them or a CHECK is hit.
settings.SetIntKey(printing::kSettingPrinterType,
static_cast<int>(printing::PrinterType::kLocal));
static_cast<int>(printing::mojom::PrinterType::kLocal));
settings.SetBoolKey(printing::kSettingShouldPrintSelectionOnly, false);
settings.SetBoolKey(printing::kSettingRasterizePdf, false);
@ -3202,17 +3203,6 @@ bool WebContents::CanOverscrollContent() {
return false;
}
std::unique_ptr<content::ColorChooser> WebContents::OpenColorChooser(
content::WebContents* web_contents,
SkColor color,
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions) {
#if BUILDFLAG(ENABLE_COLOR_CHOOSER)
return chrome::ShowColorChooser(web_contents, color);
#else
return nullptr;
#endif
}
std::unique_ptr<content::EyeDropper> WebContents::OpenEyeDropper(
content::RenderFrameHost* frame,
content::EyeDropperListener* listener) {

View file

@ -41,6 +41,7 @@
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
#include "shell/common/gin_helper/constructible.h"
#include "shell/common/gin_helper/error_thrower.h"
#include "shell/common/gin_helper/pinnable.h"
#include "ui/base/models/image_model.h"
#include "ui/gfx/image/image.h"
@ -95,6 +96,7 @@ namespace api {
class WebContents : public gin::Wrappable<WebContents>,
public gin_helper::EventEmitterMixin<WebContents>,
public gin_helper::Constructible<WebContents>,
public gin_helper::Pinnable<WebContents>,
public gin_helper::CleanedUpAtExit,
public content::WebContentsObserver,
public content::WebContentsDelegate,
@ -611,11 +613,6 @@ class WebContents : public gin::Wrappable<WebContents>,
// content::WebContentsDelegate:
bool CanOverscrollContent() override;
std::unique_ptr<content::ColorChooser> OpenColorChooser(
content::WebContents* web_contents,
SkColor color,
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions)
override;
std::unique_ptr<content::EyeDropper> OpenEyeDropper(
content::RenderFrameHost* frame,
content::EyeDropperListener* listener) override;

View file

@ -501,7 +501,7 @@ void Browser::ShowAboutPanel() {
void Browser::SetAboutPanelOptions(base::DictionaryValue options) {
about_panel_options_.Clear();
for (const auto& pair : options.DictItems()) {
for (const auto pair : options.DictItems()) {
std::string key = std::string(pair.first);
if (!key.empty() && pair.second.is_string()) {
key[0] = base::ToUpperASCII(key[0]);

1
shell/browser/browser_win.cc Executable file → Normal file
View file

@ -40,6 +40,7 @@
#include "shell/common/gin_helper/dictionary.h"
#include "shell/common/skia_util.h"
#include "skia/ext/legacy_display_globals.h"
#include "third_party/skia/include/core/SkFont.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/keycodes/keyboard_code_conversion_win.h"
#include "ui/strings/grit/ui_strings.h"

View file

@ -64,17 +64,27 @@ ExecuteCodeFunction::InitResult ExecuteCodeInTabFunction::Init() {
if (init_result_)
return init_result_.value();
// |tab_id| is optional so it's ok if it's not there.
int tab_id = -1;
if (args_->GetInteger(0, &tab_id) && tab_id < 0)
const auto& list = args_->GetList();
if (list.size() < 2)
return set_init_result(VALIDATION_FAILURE);
const auto& tab_id_value = list[0];
// |tab_id| is optional so it's ok if it's not there.
int tab_id = -1;
if (tab_id_value.is_int()) {
// But if it is present, it needs to be non-negative.
tab_id = tab_id_value.GetInt();
if (tab_id < 0) {
return set_init_result(VALIDATION_FAILURE);
}
}
// |details| are not optional.
base::DictionaryValue* details_value = NULL;
if (!args_->GetDictionary(1, &details_value))
const base::Value& details_value = list[1];
if (!details_value.is_dict())
return set_init_result(VALIDATION_FAILURE);
auto details = std::make_unique<InjectDetails>();
if (!InjectDetails::Populate(*details_value, details.get()))
std::unique_ptr<InjectDetails> details(new InjectDetails());
if (!InjectDetails::Populate(details_value, details.get()))
return set_init_result(VALIDATION_FAILURE);
if (tab_id == -1) {

View file

@ -144,7 +144,7 @@ ServiceWorkerManager* ElectronExtensionSystem::service_worker_manager() {
}
UserScriptManager* ElectronExtensionSystem::user_script_manager() {
return new UserScriptManager(browser_context_);
return user_script_manager_.get();
}
StateStore* ElectronExtensionSystem::state_store() {

View file

@ -116,7 +116,7 @@ network::mojom::URLResponseHeadPtr ToResponseHead(
base::DictionaryValue headers;
if (dict.Get("headers", &headers)) {
for (const auto& iter : headers.DictItems()) {
for (const auto iter : headers.DictItems()) {
if (iter.second.is_string()) {
// key, value
head->headers->AddHeader(iter.first, iter.second.GetString());

View file

@ -9,6 +9,7 @@
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/system/string_data_source.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
namespace electron {

View file

@ -4,6 +4,7 @@
#include "shell/browser/protocol_registry.h"
#include "base/stl_util.h"
#include "content/public/browser/web_contents.h"
#include "shell/browser/electron_browser_context.h"
#include "shell/browser/net/asar/asar_url_loader_factory.h"

View file

@ -6,6 +6,10 @@
#include <utility>
#if defined(OS_WIN)
#include <windows.h>
#endif
#include "base/files/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"

View file

@ -110,7 +110,7 @@ void RelauncherSynchronizeWithParent() {
// Notify the parent process that it can quit now.
StringType name = internal::GetWaitEventName(process.Pid());
base::win::ScopedHandle wait_event(
::CreateEventW(NULL, TRUE, FALSE, name.c_str()));
CreateEvent(NULL, TRUE, FALSE, name.c_str()));
::SetEvent(wait_event.Get());
// Wait for parent process to quit.

View file

@ -4,9 +4,9 @@
#include "shell/browser/ui/cocoa/window_buttons_view.h"
#include "base/cxx17_backports.h"
#include "base/i18n/rtl.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "ui/gfx/mac/coordinate_conversion.h"
namespace {

View file

@ -27,7 +27,6 @@
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/color_chooser.h"
#include "content/public/browser/file_select_listener.h"
#include "content/public/browser/file_url_loader.h"
#include "content/public/browser/host_zoom_map.h"
@ -908,8 +907,9 @@ void InspectableWebContents::HandleMessageFromDevToolsFrontend(
params = &empty_params;
}
int id = message.FindIntKey(kFrontendHostId).value_or(0);
base::ListValue* params_list = nullptr;
params->GetAsList(&params_list);
std::vector<base::Value> params_list;
if (params)
params_list = std::move(*params).TakeList();
embedder_message_dispatcher_->Dispatch(
base::BindRepeating(&InspectableWebContents::SendMessageAck,
weak_factory_.GetWeakPtr(), id),
@ -997,16 +997,6 @@ void InspectableWebContents::CloseContents(content::WebContents* source) {
CloseDevTools();
}
std::unique_ptr<content::ColorChooser> InspectableWebContents::OpenColorChooser(
content::WebContents* source,
SkColor color,
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions) {
auto* delegate = web_contents_->GetDelegate();
if (delegate)
return delegate->OpenColorChooser(source, color, suggestions);
return nullptr;
}
void InspectableWebContents::RunFileChooser(
content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,

View file

@ -183,11 +183,6 @@ class InspectableWebContents
bool HandleKeyboardEvent(content::WebContents*,
const content::NativeWebKeyboardEvent&) override;
void CloseContents(content::WebContents* source) override;
std::unique_ptr<content::ColorChooser> OpenColorChooser(
content::WebContents* source,
SkColor color,
const std::vector<blink::mojom::ColorSuggestionPtr>& suggestions)
override;
void RunFileChooser(content::RenderFrameHost* render_frame_host,
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;

View file

@ -74,8 +74,12 @@ std::u16string MenuDelegate::GetLabel(int id) const {
return adapter_->GetLabel(id);
}
void MenuDelegate::GetLabelStyle(int id, LabelStyle* style) const {
return adapter_->GetLabelStyle(id, style);
const gfx::FontList* MenuDelegate::GetLabelFontList(int id) const {
return adapter_->GetLabelFontList(id);
}
absl::optional<SkColor> MenuDelegate::GetLabelColor(int id) const {
return adapter_->GetLabelColor(id);
}
bool MenuDelegate::IsCommandEnabled(int id) const {

View file

@ -47,7 +47,8 @@ class MenuDelegate : public views::MenuDelegate {
const ui::Event& e) override;
bool GetAccelerator(int id, ui::Accelerator* accelerator) const override;
std::u16string GetLabel(int id) const override;
void GetLabelStyle(int id, LabelStyle* style) const override;
const gfx::FontList* GetLabelFontList(int id) const override;
absl::optional<SkColor> GetLabelColor(int id) const override;
bool IsCommandEnabled(int id) const override;
bool IsCommandVisible(int id) const override;
bool IsItemChecked(int id) const override;

View file

@ -6,8 +6,8 @@
#include <propkey.h> // for PKEY_* constants
#include "base/cxx17_backports.h"
#include "base/logging.h"
#include "base/stl_util.h"
#include "base/win/scoped_co_mem.h"
#include "base/win/scoped_propvariant.h"
#include "base/win/win_util.h"

View file

@ -5,6 +5,7 @@
#ifndef SHELL_BROWSER_WEB_CONTENTS_PERMISSION_HELPER_H_
#define SHELL_BROWSER_WEB_CONTENTS_PERMISSION_HELPER_H_
#include "base/values.h"
#include "content/public/browser/media_stream_request.h"
#include "content/public/browser/permission_type.h"
#include "content/public/browser/web_contents_user_data.h"

View file

@ -108,14 +108,14 @@ std::u16string Clipboard::ReadText(gin_helper::Arguments* args) {
std::u16string data;
ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread();
auto type = GetClipboardBuffer(args);
if (clipboard->IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(),
if (clipboard->IsFormatAvailable(ui::ClipboardFormatType::PlainTextType(),
type, /* data_dst = */ nullptr)) {
clipboard->ReadText(type, /* data_dst = */ nullptr, &data);
} else {
#if defined(OS_WIN)
if (clipboard->IsFormatAvailable(
ui::ClipboardFormatType::GetPlainTextAType(), type,
/* data_dst = */ nullptr)) {
if (clipboard->IsFormatAvailable(ui::ClipboardFormatType::PlainTextAType(),
type,
/* data_dst = */ nullptr)) {
std::string result;
clipboard->ReadAsciiText(type, /* data_dst = */ nullptr, &result);
data = base::ASCIIToUTF16(result);

View file

@ -82,7 +82,8 @@ bool IsRunningInDesktopBridgeImpl() {
initialize_get_package_family_name = false;
HMODULE kernel32_base = GetModuleHandle(L"Kernel32.dll");
if (!kernel32_base) {
NOTREACHED() << " " << __FUNCTION__ << "(): Can't open Kernel32.dll";
NOTREACHED() << std::string(" ") << std::string(__FUNCTION__)
<< std::string("(): Can't open Kernel32.dll");
return false;
}

View file

@ -4,7 +4,7 @@
#include "shell/common/gin_helper/callback.h"
#include "base/stl_util.h"
#include "base/cxx17_backports.h"
#include "content/public/browser/browser_thread.h"
#include "gin/dictionary.h"

View file

@ -132,7 +132,7 @@ RendererClientBase::RendererClientBase() {
std::vector<std::string> streaming_schemes_list =
ParseSchemesCLISwitch(command_line, switches::kStreamingSchemes);
for (const std::string& scheme : streaming_schemes_list)
media::AddStreamingScheme(scheme.c_str());
blink::AddStreamingScheme(scheme.c_str());
// Parse --secure-schemes=scheme1,scheme2
std::vector<std::string> secure_schemes_list =
ParseSchemesCLISwitch(command_line, switches::kSecureSchemes);