chore: bump chromium to 92.0.4488.0 (master) (#28676)

* chore: bump chromium in DEPS to 92.0.4478.0

* chore: update chromium patches

* chore: update v8 patches

* fix: add scale parameter to LookupIconFromFilepath

Refs: 2748317
Follow up: https://github.com/electron/electron/issues/28678

* build: depend on gtkprint config for gtk_util.h

Refs: 2824022

* build: add missing print_job_constants header

Refs: unknown

* chore: bump chromium in DEPS to 92.0.4479.0

* update patches

* chore: bump chromium in DEPS to 92.0.4480.0

* chore: bump chromium in DEPS to 92.0.4481.0

* chore: bump chromium in DEPS to 92.0.4482.2

* chore: bump chromium in DEPS to 92.0.4483.0

* chore: update patches

* chore: bump chromium in DEPS to 92.0.4484.0

* chore: bump chromium in DEPS to 92.0.4485.0

* fix patches

* update patches

* 2810414: [LSC] Add PRESUBMIT check for ASCIIToUTF16("...") and UTF8ToUTF16("...")

2810414

* 2781233: NotificationService: Plumb document_url for non-persistent notifications.

2781233

* fixup! 2810414: [LSC] Add PRESUBMIT check for ASCIIToUTF16("...") and UTF8ToUTF16("...")

* 2836669: Refactor GTK build target and dependencies

2836669

* chore: bump chromium in DEPS to 92.0.4486.0

* update patches

* fix DecrementCapturerCount patch

* explicitly include badging.mojom.h

* include ui/gtk/gtk_ui_factory.h for BuildGtkUi()

* fixup! 2810414: [LSC] Add PRESUBMIT check for ASCIIToUTF16("...") and UTF8ToUTF16("...")

* iwyu fix for base::size

* iwyu for TRACE_EVENT0

* 2799631: Use structured interface for DevTools messages

2799631

* 2801573: Convert enum to enum class for Widget::InitParams::Activatable

2801573

* 2805764: Add ContentBrowserClient support for service worker-scoped binders

2805764

* fixup! 2799631: Use structured interface for DevTools messages

* fixup! 2805764: Add ContentBrowserClient support for service worker-scoped binders

* oops, use of linux_ui after std::move

* fix devtools message handling for null params

* disable node test parallel/test-debug-args

2843348

* fix gn check

* chore: bump chromium in DEPS to 92.0.4487.0

* chore: update patches

* chore: bump chromium in DEPS to 92.0.4488.0

* update patches

* Remove vpython use from Chromium DEPS file

2810121

* Partial revert "workaround: disable CFG longjmp protection for Windows on Arm"

2788210

Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: deepak1556 <hop2deep@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
This commit is contained in:
Electron Bot 2021-04-27 14:27:34 -07:00 committed by GitHub
parent fa61e3b119
commit cdf04f3ae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
95 changed files with 496 additions and 693 deletions

View file

@ -1289,12 +1289,12 @@ v8::Local<v8::Promise> App::GetFileIcon(const base::FilePath& path,
auto* icon_manager = ElectronBrowserMainParts::Get()->GetIconManager();
gfx::Image* icon =
icon_manager->LookupIconFromFilepath(normalized_path, icon_size);
icon_manager->LookupIconFromFilepath(normalized_path, icon_size, 1.0f);
if (icon) {
promise.Resolve(*icon);
} else {
icon_manager->LoadIcon(
normalized_path, icon_size,
normalized_path, icon_size, 1.0f,
base::BindOnce(&OnIconDataAvailable, std::move(promise)),
&cancelable_task_tracker_);
}

View file

@ -74,6 +74,7 @@
#include "mojo/public/cpp/system/platform_handle.h"
#include "ppapi/buildflags/buildflags.h"
#include "printing/buildflags/buildflags.h"
#include "printing/print_job_constants.h"
#include "services/service_manager/public/cpp/interface_provider.h"
#include "shell/browser/api/electron_api_browser_window.h"
#include "shell/browser/api/electron_api_debugger.h"

View file

@ -297,7 +297,7 @@ void GetFileIcon(const base::FilePath& path,
auto* icon_manager = ElectronBrowserMainParts::Get()->GetIconManager();
gfx::Image* icon =
icon_manager->LookupIconFromFilepath(normalized_path, icon_size);
icon_manager->LookupIconFromFilepath(normalized_path, icon_size, 1.0f);
if (icon) {
gin_helper::Dictionary dict = gin::Dictionary::CreateEmpty(isolate);
dict.Set("icon", *icon);
@ -305,7 +305,7 @@ void GetFileIcon(const base::FilePath& path,
dict.Set("path", normalized_path);
promise.Resolve(dict);
} else {
icon_manager->LoadIcon(normalized_path, icon_size,
icon_manager->LoadIcon(normalized_path, icon_size, 1.0f,
base::BindOnce(&OnIconDataAvailable, normalized_path,
app_display_name, std::move(promise)),
cancelable_task_tracker_);

View file

@ -40,6 +40,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/service_worker_version_base_info.h"
#include "content/public/browser/site_instance.h"
#include "content/public/browser/tts_controller.h"
#include "content/public/browser/tts_platform.h"
@ -1571,12 +1572,25 @@ content::BluetoothDelegate* ElectronBrowserClient::GetBluetoothDelegate() {
return bluetooth_delegate_.get();
}
void ElectronBrowserClient::BindBadgeServiceReceiverFromServiceWorker(
content::RenderProcessHost* service_worker_process_host,
const GURL& service_worker_scope,
void BindBadgeServiceForServiceWorker(
const content::ServiceWorkerVersionBaseInfo& info,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
content::RenderProcessHost* render_process_host =
content::RenderProcessHost::FromID(info.process_id);
if (!render_process_host)
return;
badging::BadgeManager::BindServiceWorkerReceiver(
service_worker_process_host, service_worker_scope, std::move(receiver));
render_process_host, info.scope, std::move(receiver));
}
void ElectronBrowserClient::RegisterBrowserInterfaceBindersForServiceWorker(
mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
map) {
map->Add<blink::mojom::BadgeService>(
base::BindRepeating(&BindBadgeServiceForServiceWorker));
}
} // namespace electron

View file

@ -21,6 +21,7 @@
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "shell/browser/bluetooth/electron_bluetooth_delegate.h"
#include "shell/browser/serial/electron_serial_delegate.h"
#include "third_party/blink/public/mojom/badging/badging.mojom-forward.h"
namespace content {
class ClientCertificateDelegate;
@ -70,10 +71,9 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
void RegisterBrowserInterfaceBindersForFrame(
content::RenderFrameHost* render_frame_host,
mojo::BinderMapWithContext<content::RenderFrameHost*>* map) override;
void BindBadgeServiceReceiverFromServiceWorker(
content::RenderProcessHost* service_worker_process_host,
const GURL& service_worker_scope,
mojo::PendingReceiver<blink::mojom::BadgeService> receiver) override;
void RegisterBrowserInterfaceBindersForServiceWorker(
mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
map) override;
#if defined(OS_LINUX)
void GetAdditionalMappedFilesForChildProcess(
const base::CommandLine& command_line,

View file

@ -62,8 +62,7 @@
#include "base/environment.h"
#include "base/nix/xdg_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "ui/gtk/gtk_ui.h"
#include "ui/gtk/gtk_ui_delegate.h"
#include "ui/gtk/gtk_ui_factory.h"
#include "ui/gtk/gtk_util.h"
#include "ui/views/linux_ui/linux_ui.h"
@ -77,7 +76,6 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/xproto_util.h"
#include "ui/gtk/x/gtk_ui_delegate_x11.h"
#endif
#if defined(USE_OZONE) || defined(USE_X11)
@ -145,10 +143,10 @@ int GetMinimumFontSize() {
std::u16string MediaStringProvider(media::MessageId id) {
switch (id) {
case media::DEFAULT_AUDIO_DEVICE_NAME:
return base::ASCIIToUTF16("Default");
return u"Default";
#if defined(OS_WIN)
case media::COMMUNICATIONS_AUDIO_DEVICE_NAME:
return base::ASCIIToUTF16("Communications");
return u"Communications";
#endif
default:
return std::u16string();
@ -378,17 +376,8 @@ void ElectronBrowserMainParts::PostDestroyThreads() {
}
void ElectronBrowserMainParts::ToolkitInitialized() {
#if defined(USE_X11)
if (!features::IsUsingOzonePlatform()) {
// In Aura/X11, Gtk-based LinuxUI implementation is used.
gtk_ui_delegate_ =
std::make_unique<ui::GtkUiDelegateX11>(x11::Connection::Get());
ui::GtkUiDelegate::SetInstance(gtk_ui_delegate_.get());
}
#endif
#if defined(OS_LINUX)
views::LinuxUI* linux_ui = BuildGtkUi(ui::GtkUiDelegate::instance());
views::LinuxUI::SetInstance(linux_ui);
auto linux_ui = BuildGtkUi();
linux_ui->Initialize();
// Chromium does not respect GTK dark theme setting, but they may change
@ -400,6 +389,7 @@ void ElectronBrowserMainParts::ToolkitInitialized() {
// here returns a NativeThemeGtk, which monitors GTK settings.
dark_theme_observer_.reset(new DarkThemeObserver);
linux_ui->GetNativeTheme(nullptr)->AddObserver(dark_theme_observer_.get());
views::LinuxUI::SetInstance(std::move(linux_ui));
#endif
#if defined(USE_AURA)

View file

@ -32,7 +32,7 @@ class WMState;
#if defined(USE_X11)
namespace ui {
class GtkUiDelegate;
class GtkUiPlatform;
}
#endif
@ -128,10 +128,6 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
std::unique_ptr<wm::WMState> wm_state_;
#endif
#if defined(USE_X11)
std::unique_ptr<ui::GtkUiDelegate> gtk_ui_delegate_;
#endif
#if defined(OS_LINUX)
// Used to notify the native theme of changes to dark mode.
std::unique_ptr<DarkThemeObserver> dark_theme_observer_;

View file

@ -196,7 +196,7 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options,
bool focusable;
if (options.Get(options::kFocusable, &focusable) && !focusable)
params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
params.activatable = views::Widget::InitParams::Activatable::kNo;
#if defined(OS_WIN)
if (parent)

View file

@ -101,9 +101,9 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
}
NotifyUrgency urgency = NOTIFY_URGENCY_NORMAL;
if (options.urgency == base::ASCIIToUTF16("critical")) {
if (options.urgency == u"critical") {
urgency = NOTIFY_URGENCY_CRITICAL;
} else if (options.urgency == base::ASCIIToUTF16("low")) {
} else if (options.urgency == u"low") {
urgency = NOTIFY_URGENCY_LOW;
}
@ -118,7 +118,7 @@ void LibnotifyNotification::Show(const NotificationOptions& options) {
}
// Set the timeout duration for the notification
bool neverTimeout = options.timeout_type == base::ASCIIToUTF16("never");
bool neverTimeout = options.timeout_type == u"never";
int timeout = (neverTimeout) ? NOTIFY_EXPIRES_NEVER : NOTIFY_EXPIRES_DEFAULT;
libnotify_loader_.notify_notification_set_timeout(notification_, timeout);

View file

@ -65,7 +65,7 @@ void CocoaNotification::Show(const NotificationOptions& options) {
NSMutableArray* additionalActions =
[[[NSMutableArray alloc] init] autorelease];
for (const auto& action : options.actions) {
if (action.type == base::ASCIIToUTF16("button")) {
if (action.type == u"button") {
if (action_index_ == UINT_MAX) {
// First button observed is the displayed action
[notification_ setHasActionButton:true];

View file

@ -81,6 +81,7 @@ void PlatformNotificationService::DisplayNotification(
content::RenderProcessHost* render_process_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
const blink::PlatformNotificationData& notification_data,
const blink::NotificationResources& notification_resources) {
auto* presenter = browser_client_->GetNotificationPresenter();

View file

@ -26,6 +26,7 @@ class PlatformNotificationService
content::RenderProcessHost* render_process_host,
const std::string& notification_id,
const GURL& origin,
const GURL& document_url,
const blink::PlatformNotificationData& notification_data,
const blink::NotificationResources& notification_resources) override;
void DisplayPersistentNotification(

View file

@ -197,7 +197,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
// Locate & retain the recent documents menu item
if (!recentDocumentsMenuItem_) {
std::u16string title = base::ASCIIToUTF16("Open Recent");
std::u16string title = u"Open Recent";
NSString* openTitle = l10n_util::FixUpWindowsStyleLabel(title);
recentDocumentsMenuItem_.reset([[[[[NSApp mainMenu]
@ -339,8 +339,8 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
std::u16string role = model->GetRoleAt(index);
electron::ElectronMenuModel::ItemType type = model->GetTypeAt(index);
if (role == base::ASCIIToUTF16("services")) {
std::u16string title = base::ASCIIToUTF16("Services");
if (role == u"services") {
std::u16string title = u"Services";
NSString* label = l10n_util::FixUpWindowsStyleLabel(title);
[item setTarget:nil];
@ -348,7 +348,7 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
NSMenu* submenu = [[[NSMenu alloc] initWithTitle:label] autorelease];
[item setSubmenu:submenu];
[NSApp setServicesMenu:submenu];
} else if (role == base::ASCIIToUTF16("sharemenu")) {
} else if (role == u"sharemenu") {
SharingItem sharing_item;
model->GetSharingItemAt(index, &sharing_item);
[item setTarget:nil];
@ -374,13 +374,11 @@ static base::scoped_nsobject<NSMenu> recentDocumentsMenuSwap_;
[item setSubmenu:submenu];
// Set submenu's role.
if ((role == base::ASCIIToUTF16("window") ||
role == base::ASCIIToUTF16("windowmenu")) &&
[submenu numberOfItems])
if ((role == u"window" || role == u"windowmenu") && [submenu numberOfItems])
[NSApp setWindowsMenu:submenu];
else if (role == base::ASCIIToUTF16("help"))
else if (role == u"help")
[NSApp setHelpMenu:submenu];
else if (role == base::ASCIIToUTF16("recentdocuments"))
else if (role == u"recentdocuments")
[self replaceSubmenuShowingRecentDocuments:item];
} else {
// The MenuModel works on indexes so we can't just set the command id as the

View file

@ -880,32 +880,35 @@ void InspectableWebContents::RegisterExtensionsAPI(const std::string& origin,
}
void InspectableWebContents::HandleMessageFromDevToolsFrontend(
const std::string& message) {
base::Value message) {
// TODO(alexeykuzmin): Should we expect it to exist?
if (!embedder_message_dispatcher_) {
return;
}
std::string method;
base::ListValue empty_params;
base::ListValue* params = &empty_params;
const std::string* method = nullptr;
base::Value* params = nullptr;
base::DictionaryValue* dict = nullptr;
std::unique_ptr<base::Value> parsed_message(
base::JSONReader::ReadDeprecated(message));
if (!parsed_message || !parsed_message->GetAsDictionary(&dict) ||
!dict->GetString(kFrontendHostMethod, &method) ||
(dict->HasKey(kFrontendHostParams) &&
!dict->GetList(kFrontendHostParams, &params))) {
if (message.is_dict()) {
method = message.FindStringKey(kFrontendHostMethod);
params = message.FindKey(kFrontendHostParams);
}
if (!method || (params && !params->is_list())) {
LOG(ERROR) << "Invalid message was sent to embedder: " << message;
return;
}
int id = 0;
dict->GetInteger(kFrontendHostId, &id);
base::Value empty_params(base::Value::Type::LIST);
if (!params) {
params = &empty_params;
}
int id = message.FindIntKey(kFrontendHostId).value_or(0);
base::ListValue* params_list = nullptr;
params->GetAsList(&params_list);
embedder_message_dispatcher_->Dispatch(
base::BindRepeating(&InspectableWebContents::SendMessageAck,
weak_factory_.GetWeakPtr(), id),
method, params);
*method, params_list);
}
void InspectableWebContents::DispatchProtocolMessage(

View file

@ -156,7 +156,7 @@ class InspectableWebContents
const std::string& trigger) override {}
// content::DevToolsFrontendHostDelegate:
void HandleMessageFromDevToolsFrontend(const std::string& message);
void HandleMessageFromDevToolsFrontend(base::Value message);
// content::DevToolsAgentHostClient:
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host,

View file

@ -82,7 +82,7 @@ InspectableWebContentsViewViews::InspectableWebContentsViewViews(
InspectableWebContents* inspectable_web_contents)
: inspectable_web_contents_(inspectable_web_contents),
devtools_web_view_(new views::WebView(nullptr)),
title_(base::ASCIIToUTF16("Developer Tools")) {
title_(u"Developer Tools") {
if (!inspectable_web_contents_->IsGuest() &&
inspectable_web_contents_->GetWebContents()->GetNativeView()) {
auto* contents_web_view = new views::WebView(nullptr);
@ -90,8 +90,7 @@ InspectableWebContentsViewViews::InspectableWebContentsViewViews(
inspectable_web_contents_->GetWebContents());
contents_web_view_ = contents_web_view;
} else {
contents_web_view_ =
new views::Label(base::ASCIIToUTF16("No content under offscreen mode"));
contents_web_view_ = new views::Label(u"No content under offscreen mode");
}
devtools_web_view_->SetVisible(false);

View file

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

View file

@ -14,6 +14,7 @@
#include "base/feature_list.h"
#include "base/no_destructor.h"
#include "base/strings/string_number_conversions.h"
#include "base/trace_event/trace_event.h"
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_frame_observer.h"
#include "shell/common/api/object_life_monitor.h"

View file

@ -11,6 +11,7 @@
#include "base/environment.h"
#include "base/macros.h"
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
#include "gin/data_object_builder.h"
#include "mojo/public/cpp/system/platform_handle.h"
#include "shell/common/electron_constants.h"