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: 2694187

* chore: update patches

* chore: media_internal_resources becomes resources

Refs: 2699022

* chore: update patches

* refactor: extensions::ViewType moved to mojom

Refs: 2710351

* chore: might_have_observers has been removed

Refs: 2667839

* refactor: CertVerifier is not in the network namespace anymore

Refs: 2689805

* refactor: ExtensionUserScriptManager is now UserScriptManager

Refs: 2657617

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

Refs: 2680274

* refactor: MenuItemType was moved to mojom

Refs: 2071443

* refactor: extensions::ViewType was moved to mojom

Refs: 2710351

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

Refs: 2685601

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

Refs: 2071443

* refactor: CreateDataPipe deprecated form was removed

Refs: 2698090

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

Refs: 2700637

* chore: wire up activation_time in OSR

Refs: 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

2752406

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

2752406

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

2752932

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

2651385

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

2734095

* chore: bump chromium in DEPS to 91.0.4448.0

* Update patches

* 2743594: Remove WebSize from blink.

2743594

* 2725403: Add URLLoaderClient::OnReceiveEarlyHints()

2725403

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

2651385

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

2721718

* 2733070: Rename observer to URLLoaderNetworkServiceObserver

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

2648046

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

2752406

* only include mac notifications on mac

* add additional skipping of atk toolchain check

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

2757472

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

2757472

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

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

2693008

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

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

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
233 changed files with 1586 additions and 1469 deletions

View file

@ -0,0 +1,26 @@
enum RecordingMode { "record-until-full", "record-continuously", "record-as-much-as-possible", "trace-to-console" };
dictionary TraceConfig {
Recordingmode recording_mode;
unsigned long trace_buffer_size_in_kb;
unsigned long trace_buffer_size_in_events;
boolean enable_argument_filter;
sequence<DOMString> included_categories;
sequence<DOMString> excluded_categories;
sequence<unsigned short> included_process_ids;
sequence<DOMString> histogram_names;
object memory_dump_config;
};
dictionary TraceCategoriesAndOptions {
DOMString categoryFilter;
DOMString traceOptions;
};
interface ContentTracing {
Promise<sequence<DOMString>> getCategories();
Promise<void> startRecording(TraceConfig config);
Promise<void> startRecording(TraceCategoriesAndOptions categoriesAndOptions);
Promise<DOMString> stopRecording(optional DOMString resultFilePath);
Promise<TraceBufferUsage> getTraceBufferUsage();
};

View file

@ -549,7 +549,7 @@ void OnClientCertificateSelected(
#if defined(USE_NSS_CERTS)
int ImportIntoCertStore(CertificateManagerModel* model, base::Value options) {
std::string file_data, cert_path;
base::string16 password;
std::u16string password;
net::ScopedCERTCertificateList imported_certs;
int rv = -1;
@ -1553,8 +1553,10 @@ gin::ObjectTemplateBuilder App::GetObjectTemplateBuilder(v8::Isolate* isolate) {
base::BindRepeating(&Browser::AddRecentDocument, browser))
.SetMethod("clearRecentDocuments",
base::BindRepeating(&Browser::ClearRecentDocuments, browser))
#if defined(OS_WIN)
.SetMethod("setAppUserModelId",
base::BindRepeating(&Browser::SetAppUserModelID, browser))
#endif
.SetMethod(
"isDefaultProtocolClient",
base::BindRepeating(&Browser::IsDefaultProtocolClient, browser))

View file

@ -1089,11 +1089,11 @@ bool BaseWindow::SetThumbnailToolTip(const std::string& tooltip) {
}
void BaseWindow::SetAppDetails(const gin_helper::Dictionary& options) {
base::string16 app_id;
std::wstring app_id;
base::FilePath app_icon_path;
int app_icon_index = 0;
base::string16 relaunch_command;
base::string16 relaunch_display_name;
std::wstring relaunch_command;
std::wstring relaunch_display_name;
options.Get("appId", &app_id);
options.Get("appIconPath", &app_icon_path);

View file

@ -210,7 +210,7 @@ void BrowserWindow::OnActivateContents() {
#endif
}
void BrowserWindow::OnPageTitleUpdated(const base::string16& title,
void BrowserWindow::OnPageTitleUpdated(const std::u16string& title,
bool explicit_set) {
// Change window title to page title.
auto self = GetWeakPtr();

View file

@ -62,7 +62,7 @@ class BrowserWindow : public BaseWindow,
const std::vector<mojom::DraggableRegionPtr>& regions) override;
void OnSetContentBounds(const gfx::Rect& rect) override;
void OnActivateContents() override;
void OnPageTitleUpdated(const base::string16& title,
void OnPageTitleUpdated(const std::u16string& title,
bool explicit_set) override;
#if defined(OS_MAC)
void OnDevToolsResized() override;

View file

@ -175,7 +175,7 @@ void Start(const std::string& submit_url,
base::PathService::Get(DIR_USER_DATA, &user_data_dir);
::crash_reporter::InitializeCrashpadWithEmbeddedHandler(
process_type.empty(), process_type,
base::UTF16ToUTF8(user_data_dir.value()), base::FilePath());
base::WideToUTF8(user_data_dir.value()), base::FilePath());
#endif
#endif
}

View file

@ -96,7 +96,7 @@ void DesktopCapturer::StartHandling(bool capture_window,
// Apply the new thumbnail size and restart capture.
if (capture_window) {
window_capturer_ = std::make_unique<NativeDesktopMediaList>(
content::DesktopMediaID::TYPE_WINDOW,
DesktopMediaList::Type::kWindow,
content::desktop_capture::CreateWindowCapturer());
window_capturer_->SetThumbnailSize(thumbnail_size);
window_capturer_->AddObserver(this);
@ -107,7 +107,7 @@ void DesktopCapturer::StartHandling(bool capture_window,
if (capture_screen) {
screen_capturer_ = std::make_unique<NativeDesktopMediaList>(
content::DesktopMediaID::TYPE_SCREEN,
DesktopMediaList::Type::kScreen,
content::desktop_capture::CreateScreenCapturer());
screen_capturer_->SetThumbnailSize(thumbnail_size);
screen_capturer_->AddObserver(this);
@ -124,7 +124,7 @@ void DesktopCapturer::OnSourceUnchanged(DesktopMediaList* list) {
void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
if (capture_window_ &&
list->GetMediaListType() == content::DesktopMediaID::TYPE_WINDOW) {
list->GetMediaListType() == DesktopMediaList::Type::kWindow) {
capture_window_ = false;
const auto& media_list_sources = list->GetSources();
std::vector<DesktopCapturer::Source> window_sources;
@ -138,7 +138,7 @@ void DesktopCapturer::UpdateSourcesList(DesktopMediaList* list) {
}
if (capture_screen_ &&
list->GetMediaListType() == content::DesktopMediaID::TYPE_SCREEN) {
list->GetMediaListType() == DesktopMediaList::Type::kScreen) {
capture_screen_ = false;
const auto& media_list_sources = list->GetSources();
std::vector<DesktopCapturer::Source> screen_sources;

View file

@ -163,7 +163,7 @@ base::OnceClosure Menu::BindSelfToClosure(base::OnceClosure callback) {
void Menu::InsertItemAt(int index,
int command_id,
const base::string16& label) {
const std::u16string& label) {
model_->InsertItemAt(index, command_id, label);
}
@ -173,20 +173,20 @@ void Menu::InsertSeparatorAt(int index) {
void Menu::InsertCheckItemAt(int index,
int command_id,
const base::string16& label) {
const std::u16string& label) {
model_->InsertCheckItemAt(index, command_id, label);
}
void Menu::InsertRadioItemAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
int group_id) {
model_->InsertRadioItemAt(index, command_id, label, group_id);
}
void Menu::InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
Menu* menu) {
menu->parent_ = this;
model_->InsertSubMenuAt(index, command_id, label, menu->model_.get());
@ -196,15 +196,15 @@ void Menu::SetIcon(int index, const gfx::Image& image) {
model_->SetIcon(index, ui::ImageModel::FromImage(image));
}
void Menu::SetSublabel(int index, const base::string16& sublabel) {
void Menu::SetSublabel(int index, const std::u16string& sublabel) {
model_->SetSecondaryLabel(index, sublabel);
}
void Menu::SetToolTip(int index, const base::string16& toolTip) {
void Menu::SetToolTip(int index, const std::u16string& toolTip) {
model_->SetToolTip(index, toolTip);
}
void Menu::SetRole(int index, const base::string16& role) {
void Menu::SetRole(int index, const std::u16string& role) {
model_->SetRole(index, role);
}
@ -224,19 +224,19 @@ int Menu::GetCommandIdAt(int index) const {
return model_->GetCommandIdAt(index);
}
base::string16 Menu::GetLabelAt(int index) const {
std::u16string Menu::GetLabelAt(int index) const {
return model_->GetLabelAt(index);
}
base::string16 Menu::GetSublabelAt(int index) const {
std::u16string Menu::GetSublabelAt(int index) const {
return model_->GetSecondaryLabelAt(index);
}
base::string16 Menu::GetToolTipAt(int index) const {
std::u16string Menu::GetToolTipAt(int index) const {
return model_->GetToolTipAt(index);
}
base::string16 Menu::GetAcceleratorTextAt(int index) const {
std::u16string Menu::GetAcceleratorTextAt(int index) const {
ui::Accelerator accelerator;
model_->GetAcceleratorAtWithParams(index, true, &accelerator);
return accelerator.GetShortcutText();

View file

@ -87,31 +87,31 @@ class Menu : public gin::Wrappable<Menu>,
void OnMenuWillShow() override;
private:
void InsertItemAt(int index, int command_id, const base::string16& label);
void InsertItemAt(int index, int command_id, const std::u16string& label);
void InsertSeparatorAt(int index);
void InsertCheckItemAt(int index,
int command_id,
const base::string16& label);
const std::u16string& label);
void InsertRadioItemAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
int group_id);
void InsertSubMenuAt(int index,
int command_id,
const base::string16& label,
const std::u16string& label,
Menu* menu);
void SetIcon(int index, const gfx::Image& image);
void SetSublabel(int index, const base::string16& sublabel);
void SetToolTip(int index, const base::string16& toolTip);
void SetRole(int index, const base::string16& role);
void SetSublabel(int index, const std::u16string& sublabel);
void SetToolTip(int index, const std::u16string& toolTip);
void SetRole(int index, const std::u16string& role);
void Clear();
int GetIndexOfCommandId(int command_id);
int GetItemCount() const;
int GetCommandIdAt(int index) const;
base::string16 GetLabelAt(int index) const;
base::string16 GetSublabelAt(int index) const;
base::string16 GetToolTipAt(int index) const;
base::string16 GetAcceleratorTextAt(int index) const;
std::u16string GetLabelAt(int index) const;
std::u16string GetSublabelAt(int index) const;
std::u16string GetToolTipAt(int index) const;
std::u16string GetAcceleratorTextAt(int index) const;
bool IsItemCheckedAt(int index) const;
bool IsEnabledAt(int index) const;
bool IsVisibleAt(int index) const;

View file

@ -92,15 +92,15 @@ gin::Handle<Notification> Notification::New(gin_helper::ErrorThrower thrower,
}
// Getters
base::string16 Notification::GetTitle() const {
std::u16string Notification::GetTitle() const {
return title_;
}
base::string16 Notification::GetSubtitle() const {
std::u16string Notification::GetSubtitle() const {
return subtitle_;
}
base::string16 Notification::GetBody() const {
std::u16string Notification::GetBody() const {
return body_;
}
@ -112,19 +112,19 @@ bool Notification::GetHasReply() const {
return has_reply_;
}
base::string16 Notification::GetTimeoutType() const {
std::u16string Notification::GetTimeoutType() const {
return timeout_type_;
}
base::string16 Notification::GetReplyPlaceholder() const {
std::u16string Notification::GetReplyPlaceholder() const {
return reply_placeholder_;
}
base::string16 Notification::GetSound() const {
std::u16string Notification::GetSound() const {
return sound_;
}
base::string16 Notification::GetUrgency() const {
std::u16string Notification::GetUrgency() const {
return urgency_;
}
@ -132,24 +132,24 @@ std::vector<electron::NotificationAction> Notification::GetActions() const {
return actions_;
}
base::string16 Notification::GetCloseButtonText() const {
std::u16string Notification::GetCloseButtonText() const {
return close_button_text_;
}
base::string16 Notification::GetToastXml() const {
std::u16string Notification::GetToastXml() const {
return toast_xml_;
}
// Setters
void Notification::SetTitle(const base::string16& new_title) {
void Notification::SetTitle(const std::u16string& new_title) {
title_ = new_title;
}
void Notification::SetSubtitle(const base::string16& new_subtitle) {
void Notification::SetSubtitle(const std::u16string& new_subtitle) {
subtitle_ = new_subtitle;
}
void Notification::SetBody(const base::string16& new_body) {
void Notification::SetBody(const std::u16string& new_body) {
body_ = new_body;
}
@ -161,19 +161,19 @@ void Notification::SetHasReply(bool new_has_reply) {
has_reply_ = new_has_reply;
}
void Notification::SetTimeoutType(const base::string16& new_timeout_type) {
void Notification::SetTimeoutType(const std::u16string& new_timeout_type) {
timeout_type_ = new_timeout_type;
}
void Notification::SetReplyPlaceholder(const base::string16& new_placeholder) {
void Notification::SetReplyPlaceholder(const std::u16string& new_placeholder) {
reply_placeholder_ = new_placeholder;
}
void Notification::SetSound(const base::string16& new_sound) {
void Notification::SetSound(const std::u16string& new_sound) {
sound_ = new_sound;
}
void Notification::SetUrgency(const base::string16& new_urgency) {
void Notification::SetUrgency(const std::u16string& new_urgency) {
urgency_ = new_urgency;
}
@ -182,11 +182,11 @@ void Notification::SetActions(
actions_ = actions;
}
void Notification::SetCloseButtonText(const base::string16& text) {
void Notification::SetCloseButtonText(const std::u16string& text) {
close_button_text_ = text;
}
void Notification::SetToastXml(const base::string16& new_toast_xml) {
void Notification::SetToastXml(const std::u16string& new_toast_xml) {
toast_xml_ = new_toast_xml;
}

View file

@ -65,49 +65,49 @@ class Notification : public gin::Wrappable<Notification>,
void Close();
// Prop Getters
base::string16 GetTitle() const;
base::string16 GetSubtitle() const;
base::string16 GetBody() const;
std::u16string GetTitle() const;
std::u16string GetSubtitle() const;
std::u16string GetBody() const;
bool GetSilent() const;
bool GetHasReply() const;
base::string16 GetTimeoutType() const;
base::string16 GetReplyPlaceholder() const;
base::string16 GetUrgency() const;
base::string16 GetSound() const;
std::u16string GetTimeoutType() const;
std::u16string GetReplyPlaceholder() const;
std::u16string GetUrgency() const;
std::u16string GetSound() const;
std::vector<electron::NotificationAction> GetActions() const;
base::string16 GetCloseButtonText() const;
base::string16 GetToastXml() const;
std::u16string GetCloseButtonText() const;
std::u16string GetToastXml() const;
// Prop Setters
void SetTitle(const base::string16& new_title);
void SetSubtitle(const base::string16& new_subtitle);
void SetBody(const base::string16& new_body);
void SetTitle(const std::u16string& new_title);
void SetSubtitle(const std::u16string& new_subtitle);
void SetBody(const std::u16string& new_body);
void SetSilent(bool new_silent);
void SetHasReply(bool new_has_reply);
void SetUrgency(const base::string16& new_urgency);
void SetTimeoutType(const base::string16& new_timeout_type);
void SetReplyPlaceholder(const base::string16& new_reply_placeholder);
void SetSound(const base::string16& sound);
void SetUrgency(const std::u16string& new_urgency);
void SetTimeoutType(const std::u16string& new_timeout_type);
void SetReplyPlaceholder(const std::u16string& new_reply_placeholder);
void SetSound(const std::u16string& sound);
void SetActions(const std::vector<electron::NotificationAction>& actions);
void SetCloseButtonText(const base::string16& text);
void SetToastXml(const base::string16& new_toast_xml);
void SetCloseButtonText(const std::u16string& text);
void SetToastXml(const std::u16string& new_toast_xml);
private:
base::string16 title_;
base::string16 subtitle_;
base::string16 body_;
std::u16string title_;
std::u16string subtitle_;
std::u16string body_;
gfx::Image icon_;
base::string16 icon_path_;
std::u16string icon_path_;
bool has_icon_ = false;
bool silent_ = false;
bool has_reply_ = false;
base::string16 timeout_type_;
base::string16 reply_placeholder_;
base::string16 sound_;
base::string16 urgency_;
std::u16string timeout_type_;
std::u16string reply_placeholder_;
std::u16string sound_;
std::u16string urgency_;
std::vector<electron::NotificationAction> actions_;
base::string16 close_button_text_;
base::string16 toast_xml_;
std::u16string close_button_text_;
std::u16string toast_xml_;
electron::NotificationPresenter* presenter_;

View file

@ -344,7 +344,7 @@ void SimpleURLLoaderWrapper::OnAuthRequired(
auto cb = base::BindOnce(
[](mojo::Remote<network::mojom::AuthChallengeResponder> auth_responder,
gin::Arguments* args) {
base::string16 username_str, password_str;
std::u16string username_str, password_str;
if (!args->GetNext(&username_str) || !args->GetNext(&password_str)) {
auth_responder->OnAuthCredentials(base::nullopt);
return;

View file

@ -157,6 +157,7 @@
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
#include "extensions/browser/script_executor.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/mojom/view_type.mojom.h"
#include "shell/browser/extensions/electron_extension_web_contents_observer.h"
#endif
@ -407,7 +408,7 @@ base::Optional<base::TimeDelta> GetCursorBlinkInterval() {
// This will return false if no printer with the provided device_name can be
// found on the network. We need to check this because Chromium does not do
// sanity checking of device_name validity and so will crash on invalid names.
bool IsDeviceNameValid(const base::string16& device_name) {
bool IsDeviceNameValid(const std::u16string& device_name) {
#if defined(OS_MAC)
base::ScopedCFTypeRef<CFStringRef> new_printer_id(
base::SysUTF16ToCFStringRef(device_name));
@ -417,12 +418,12 @@ bool IsDeviceNameValid(const base::string16& device_name) {
return printer_exists;
#elif defined(OS_WIN)
printing::ScopedPrinterHandle printer;
return printer.OpenPrinterWithName(device_name.c_str());
return printer.OpenPrinterWithName(base::UTF16ToWide(device_name).c_str());
#endif
return true;
}
base::string16 GetDefaultPrinterAsync() {
std::u16string GetDefaultPrinterAsync() {
#if defined(OS_WIN)
// Blocking is needed here because Windows printer drivers are oftentimes
// not thread-safe and have to be accessed on the UI thread.
@ -591,19 +592,19 @@ bool IsDevToolsFileSystemAdded(content::WebContents* web_contents,
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
WebContents::Type GetTypeFromViewType(extensions::ViewType view_type) {
WebContents::Type GetTypeFromViewType(extensions::mojom::ViewType view_type) {
switch (view_type) {
case extensions::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE:
case extensions::mojom::ViewType::kExtensionBackgroundPage:
return WebContents::Type::kBackgroundPage;
case extensions::VIEW_TYPE_APP_WINDOW:
case extensions::VIEW_TYPE_COMPONENT:
case extensions::VIEW_TYPE_EXTENSION_DIALOG:
case extensions::VIEW_TYPE_EXTENSION_POPUP:
case extensions::VIEW_TYPE_BACKGROUND_CONTENTS:
case extensions::VIEW_TYPE_EXTENSION_GUEST:
case extensions::VIEW_TYPE_TAB_CONTENTS:
case extensions::VIEW_TYPE_INVALID:
case extensions::mojom::ViewType::kAppWindow:
case extensions::mojom::ViewType::kComponent:
case extensions::mojom::ViewType::kExtensionDialog:
case extensions::mojom::ViewType::kExtensionPopup:
case extensions::mojom::ViewType::kBackgroundContents:
case extensions::mojom::ViewType::kExtensionGuest:
case extensions::mojom::ViewType::kTabContents:
case extensions::mojom::ViewType::kInvalid:
return WebContents::Type::kRemote;
}
}
@ -625,8 +626,8 @@ WebContents::WebContents(v8::Isolate* isolate,
{
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
// WebContents created by extension host will have valid ViewType set.
extensions::ViewType view_type = extensions::GetViewType(web_contents);
if (view_type != extensions::VIEW_TYPE_INVALID) {
extensions::mojom::ViewType view_type = extensions::GetViewType(web_contents);
if (view_type != extensions::mojom::ViewType::kInvalid) {
InitWithExtensionView(isolate, web_contents, view_type);
}
@ -865,7 +866,7 @@ void WebContents::InitWithSessionAndOptions(
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
void WebContents::InitWithExtensionView(v8::Isolate* isolate,
content::WebContents* web_contents,
extensions::ViewType view_type) {
extensions::mojom::ViewType view_type) {
// Must reassign type prior to calling `Init`.
type_ = GetTypeFromViewType(view_type);
if (GetType() == Type::kRemote)
@ -958,9 +959,9 @@ void WebContents::Destroy() {
bool WebContents::DidAddMessageToConsole(
content::WebContents* source,
blink::mojom::ConsoleMessageLevel level,
const base::string16& message,
const std::u16string& message,
int32_t line_no,
const base::string16& source_id) {
const std::u16string& source_id) {
return Emit("console-message", static_cast<int32_t>(level), message, line_no,
source_id);
}
@ -1036,7 +1037,7 @@ content::WebContents* WebContents::CreateCustomWebContents(
const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
const content::StoragePartitionId& partition_id,
content::SessionStorageNamespace* session_storage_namespace) {
return nullptr;
}
@ -1717,7 +1718,7 @@ void WebContents::DidFinishNavigation(
}
void WebContents::TitleWasSet(content::NavigationEntry* entry) {
base::string16 final_title;
std::u16string final_title;
bool explicit_set = true;
if (entry) {
auto title = entry->GetTitle();
@ -1984,7 +1985,7 @@ GURL WebContents::GetURL() const {
return web_contents()->GetURL();
}
base::string16 WebContents::GetTitle() const {
std::u16string WebContents::GetTitle() const {
return web_contents()->GetTitle();
}
@ -2293,9 +2294,9 @@ bool WebContents::IsCurrentlyAudible() {
void WebContents::OnGetDefaultPrinter(
base::Value print_settings,
printing::CompletionCallback print_callback,
base::string16 device_name,
std::u16string device_name,
bool silent,
base::string16 default_printer) {
std::u16string default_printer) {
// The content::WebContents might be already deleted at this point, and the
// PrintViewManagerBasic class does not do null check.
if (!web_contents()) {
@ -2304,7 +2305,7 @@ void WebContents::OnGetDefaultPrinter(
return;
}
base::string16 printer_name =
std::u16string printer_name =
device_name.empty() ? default_printer : device_name;
// If there are no valid printers available on the network, we bail.
@ -2402,7 +2403,7 @@ void WebContents::Print(gin::Arguments* args) {
// We set the default to the system's default printer and only update
// if at the Chromium level if the user overrides.
// Printer device name as opened by the OS.
base::string16 device_name;
std::u16string device_name;
options.Get("deviceName", &device_name);
if (!device_name.empty() && !IsDeviceNameValid(device_name)) {
gin_helper::ErrorThrower(args->isolate())
@ -2571,16 +2572,16 @@ void WebContents::Unselect() {
web_contents()->CollapseSelection();
}
void WebContents::Replace(const base::string16& word) {
void WebContents::Replace(const std::u16string& word) {
web_contents()->Replace(word);
}
void WebContents::ReplaceMisspelling(const base::string16& word) {
void WebContents::ReplaceMisspelling(const std::u16string& word) {
web_contents()->ReplaceMisspelling(word);
}
uint32_t WebContents::FindInPage(gin::Arguments* args) {
base::string16 search_text;
std::u16string search_text;
if (!args->GetNext(&search_text) || search_text.empty()) {
gin_helper::ErrorThrower(args->isolate())
.ThrowError("Must provide a non-empty search content");

View file

@ -48,7 +48,7 @@
#endif
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
#include "extensions/common/view_type.h"
#include "extensions/common/mojom/view_type.mojom.h"
namespace extensions {
class ScriptExecutor;
@ -156,7 +156,7 @@ class WebContents : public gin::Wrappable<WebContents>,
void LoadURL(const GURL& url, const gin_helper::Dictionary& options);
void DownloadURL(const GURL& url);
GURL GetURL() const;
base::string16 GetTitle() const;
std::u16string GetTitle() const;
bool IsLoading() const;
bool IsLoadingMainFrame() const;
bool IsWaitingForResponse() const;
@ -201,9 +201,9 @@ class WebContents : public gin::Wrappable<WebContents>,
#if BUILDFLAG(ENABLE_PRINTING)
void OnGetDefaultPrinter(base::Value print_settings,
printing::CompletionCallback print_callback,
base::string16 device_name,
std::u16string device_name,
bool silent,
base::string16 default_printer);
std::u16string default_printer);
void Print(gin::Arguments* args);
// Print current page as PDF.
v8::Local<v8::Promise> PrintToPDF(base::DictionaryValue settings);
@ -225,8 +225,8 @@ class WebContents : public gin::Wrappable<WebContents>,
void Delete();
void SelectAll();
void Unselect();
void Replace(const base::string16& word);
void ReplaceMisspelling(const base::string16& word);
void Replace(const std::u16string& word);
void ReplaceMisspelling(const std::u16string& word);
uint32_t FindInPage(gin::Arguments* args);
void StopFindInPage(content::StopFindAction action);
void ShowDefinitionForSelection();
@ -325,7 +325,7 @@ class WebContents : public gin::Wrappable<WebContents>,
}
void RemoveObserver(ExtendedWebContentsObserver* obs) {
// Trying to remove from an empty collection leads to an access violation
if (observers_.might_have_observers())
if (!observers_.empty())
observers_.RemoveObserver(obs);
}
@ -438,15 +438,15 @@ class WebContents : public gin::Wrappable<WebContents>,
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
void InitWithExtensionView(v8::Isolate* isolate,
content::WebContents* web_contents,
extensions::ViewType view_type);
extensions::mojom::ViewType view_type);
#endif
// content::WebContentsDelegate:
bool DidAddMessageToConsole(content::WebContents* source,
blink::mojom::ConsoleMessageLevel level,
const base::string16& message,
const std::u16string& message,
int32_t line_no,
const base::string16& source_id) override;
const std::u16string& source_id) override;
bool IsWebContentsCreationOverridden(
content::SiteInstance* source_site_instance,
content::mojom::WindowContainerType window_container_type,
@ -459,7 +459,7 @@ class WebContents : public gin::Wrappable<WebContents>,
const GURL& opener_url,
const std::string& frame_name,
const GURL& target_url,
const std::string& partition_id,
const content::StoragePartitionId& partition_id,
content::SessionStorageNamespace* session_storage_namespace) override;
void WebContentsCreatedWithFullParams(
content::WebContents* source_contents,

View file

@ -78,7 +78,7 @@ bool WebFrameMain::CheckRenderFrame() const {
v8::Local<v8::Promise> WebFrameMain::ExecuteJavaScript(
gin::Arguments* args,
const base::string16& code) {
const std::u16string& code) {
gin_helper::Promise<base::Value> promise(args->isolate());
v8::Local<v8::Promise> handle = promise.GetHandle();

View file

@ -78,7 +78,7 @@ class WebFrameMain : public gin::Wrappable<WebFrameMain>,
void Connect();
v8::Local<v8::Promise> ExecuteJavaScript(gin::Arguments* args,
const base::string16& code);
const std::u16string& code);
bool Reload();
void Send(v8::Isolate* isolate,
bool internal,