chore: bump chromium to 140.0.7281.0 (38-x-y) (#47559)

* chore: bump chromium in DEPS to 139.0.7258.6

* chore: bump chromium in DEPS to 139.0.7258.5

* chore: bump chromium in DEPS to 140.0.7270.1

* chore: bump chromium in DEPS to 140.0.7271.1

* chore: bump chromium in DEPS to 140.0.7273.0

* chore: bump chromium in DEPS to 140.0.7273.1

* chore: bump chromium in DEPS to 140.0.7275.1

* chore: bump chromium in DEPS to 140.0.7275.4

* chore: bump chromium in DEPS to 140.0.7277.1

* chore: bump chromium in DEPS to 140.0.7279.1

* chore: bump chromium in DEPS to 140.0.7281.1

* chore: bump chromium in DEPS to 140.0.7283.1

* chore: bump chromium in DEPS to 140.0.7285.1

* chore: bump chromium in DEPS to 140.0.7287.1

* chore: bump chromium in DEPS to 140.0.7289.0

* chore: bump chromium in DEPS to 140.0.7289.1

* chore: bump chromium in DEPS to 140.0.7291.1

* chore: bump chromium in DEPS to 140.0.7293.1

* chore: bump chromium in DEPS to 140.0.7295.1

* chore: bump chromium in DEPS to 140.0.7296.0

* chore: bump chromium to 140.0.7281.0 (main) (#47616)

cherry picked from 603cafad7e

* chore: bump chromium in DEPS to 140.0.7269.2

* chore: bump chromium in DEPS to 140.0.7270.0

* chore: bump chromium in DEPS to 140.0.7271.0

* chore: bump chromium in DEPS to 140.0.7273.0

* 6516731: [ExclusiveAccessForAndroid] remove unneeded includes & deps | https://chromium-review.googlesource.com/c/chromium/src/+/6516731

* 6694809: dbus: Ensure systemd scope is started before using any portal services | https://chromium-review.googlesource.com/c/chromium/src/+/6694809

* chore: patch chromium

* chore: export patches

* chore: bump chromium in DEPS to 140.0.7275.0

* 6677511: [pepper] More pepper removal | https://chromium-review.googlesource.com/c/chromium/src/+/6677511

* 6513641: [gin] Rename gin::Wrappable to gin::DeprecatedWrappable | https://chromium-review.googlesource.com/c/chromium/src/+/6513641

* chore: export chromium patches

* 6513641: [gin] Rename gin::Wrappable to gin::DeprecatedWrappable | https://chromium-review.googlesource.com/c/chromium/src/+/6513641

* chore: bump chromium in DEPS to 140.0.7277.0

* chore: bump chromium in DEPS to 140.0.7279.0

* chore: bump chromium in DEPS to 140.0.7281.0

* 6677314: Plumb enabled client hints in the network requestion to network layer

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

* 6351556: [source-phase-imports] Support Wasm Source Phase Imports

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

* 6700077: [renderer] Avoid calls to deprecated GetIsolate methods

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

* 6692873: Reland "Reland "FSA: Only normalize the hardcoded rules once during initialization""

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

* 6686234: [gin] Cleanup NamedPropertyInterceptor for Wrappable

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

* chore: export patches

* 6667723: Remove content_enable_legacy_ipc GN arg.

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

* 6646566: ui: Move NativeWindowTracker to its own directory

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

* fix: add missing includes

* 6580522: [WAR, DNR] Fix unsafe redirect error to web accessible resource

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

* 6680477: Implement `completeCode` endpoint and expose to DevTools

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

* 6677511: [pepper] More pepper removal

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

* 6696689: Rename views::WidgetFocusManager -> NativeViewFocusManager

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

* 6702812: Move wtf/text/string_impl*.* to "blink" namespace

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

* chore: fix dialog patch

* 6702431: [animation-trigger] Parse timeline-trigger-name

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

* chore: fixup patch indices

* feat: replace webFrame.routingId with webFrame.frameToken

* feat: WebFrameMain.prototype.frameToken

* test: refactor to use replacement APIs

* chore: fixup pip patch

* test: adjust webFrame tests for frameToken changes

* 6703757: Reland "Enable -fsanitize=array-bounds in non-UBSan builds"

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

* test: switch to frameTokens

* test: routingId is fine to test in the main process

* docs: add routingId to breaking changes

* docs: update plugin-crashed event

* chore: fixup linux dialog patch

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: alice <alice@makenotion.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
(cherry picked from commit 603cafad7e)

---------

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: alice <alice@makenotion.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
This commit is contained in:
electron-roller[bot] 2025-07-15 12:05:29 -04:00 committed by GitHub
commit 2783f76f1f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
174 changed files with 873 additions and 640 deletions

View file

@ -169,7 +169,6 @@ void ElectronContentClient::AddPlugins(
content::ContentPluginInfo pdf_info;
pdf_info.is_internal = true;
pdf_info.is_out_of_process = true;
pdf_info.name = kPDFInternalPluginName;
pdf_info.description = kPDFPluginDescription;
// This isn't a real file path; it's just used as a unique identifier.

View file

@ -365,7 +365,7 @@ struct Converter<net::SecureDnsMode> {
namespace electron::api {
gin::WrapperInfo App::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo App::kWrapperInfo = {gin::kEmbedderNativeGin};
namespace {

View file

@ -57,7 +57,7 @@ enum class JumpListResult : int;
namespace api {
class App final : public ElectronBrowserClient::Delegate,
public gin::Wrappable<App>,
public gin::DeprecatedWrappable<App>,
public gin_helper::EventEmitterMixin<App>,
private BrowserObserver,
private content::GpuDataManagerObserver,
@ -67,7 +67,7 @@ class App final : public ElectronBrowserClient::Delegate,
static App* Get();
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -18,7 +18,8 @@
namespace electron::api {
gin::WrapperInfo AutoUpdater::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo AutoUpdater::kWrapperInfo = {
gin::kEmbedderNativeGin};
AutoUpdater::AutoUpdater() {
auto_updater::AutoUpdater::SetDelegate(this);

View file

@ -19,7 +19,7 @@ class Handle;
namespace electron::api {
class AutoUpdater final : public gin::Wrappable<AutoUpdater>,
class AutoUpdater final : public gin::DeprecatedWrappable<AutoUpdater>,
public gin_helper::EventEmitterMixin<AutoUpdater>,
public auto_updater::Delegate,
private WindowListObserver {
@ -27,7 +27,7 @@ class AutoUpdater final : public gin::Wrappable<AutoUpdater>,
static gin::Handle<AutoUpdater> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -274,7 +274,7 @@ std::string StringToCookieSameSite(const std::string* str_ptr,
} // namespace
gin::WrapperInfo Cookies::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Cookies::kWrapperInfo = {gin::kEmbedderNativeGin};
Cookies::Cookies(ElectronBrowserContext* browser_context)
: browser_context_{browser_context} {

View file

@ -33,14 +33,14 @@ class ElectronBrowserContext;
namespace api {
class Cookies final : public gin::Wrappable<Cookies>,
class Cookies final : public gin::DeprecatedWrappable<Cookies>,
public gin_helper::EventEmitterMixin<Cookies> {
public:
static gin::Handle<Cookies> Create(v8::Isolate* isolate,
ElectronBrowserContext* browser_context);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -143,7 +143,8 @@ class DataPipeReader {
} // namespace
gin::WrapperInfo DataPipeHolder::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo DataPipeHolder::kWrapperInfo = {
gin::kEmbedderNativeGin};
DataPipeHolder::DataPipeHolder(const network::DataElement& element)
: id_(base::NumberToString(++g_next_id)) {

View file

@ -20,10 +20,10 @@ class Handle;
namespace electron::api {
// Retains reference to the data pipe.
class DataPipeHolder final : public gin::Wrappable<DataPipeHolder> {
class DataPipeHolder final : public gin::DeprecatedWrappable<DataPipeHolder> {
public:
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
static gin::Handle<DataPipeHolder> Create(

View file

@ -24,7 +24,7 @@ using content::DevToolsAgentHost;
namespace electron::api {
gin::WrapperInfo Debugger::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Debugger::kWrapperInfo = {gin::kEmbedderNativeGin};
Debugger::Debugger(v8::Isolate* isolate, content::WebContents* web_contents)
: content::WebContentsObserver(web_contents), web_contents_(web_contents) {}

View file

@ -32,7 +32,7 @@ class Promise;
namespace electron::api {
class Debugger final : public gin::Wrappable<Debugger>,
class Debugger final : public gin::DeprecatedWrappable<Debugger>,
public gin_helper::EventEmitterMixin<Debugger>,
public content::DevToolsAgentHostClient,
private content::WebContentsObserver {
@ -41,7 +41,7 @@ class Debugger final : public gin::Wrappable<Debugger>,
content::WebContents* web_contents);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -218,7 +218,8 @@ struct Converter<electron::api::DesktopCapturer::Source> {
namespace electron::api {
gin::WrapperInfo DesktopCapturer::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo DesktopCapturer::kWrapperInfo = {
gin::kEmbedderNativeGin};
DesktopCapturer::DesktopCapturer(v8::Isolate* isolate) {}
@ -521,7 +522,8 @@ bool DesktopCapturer::IsDisplayMediaSystemPickerAvailable() {
gin::ObjectTemplateBuilder DesktopCapturer::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<DesktopCapturer>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<DesktopCapturer>::GetObjectTemplateBuilder(
isolate)
.SetMethod("startHandling", &DesktopCapturer::StartHandling);
}

View file

@ -21,7 +21,7 @@ class Handle;
namespace electron::api {
class DesktopCapturer final : public gin::Wrappable<DesktopCapturer>,
class DesktopCapturer final : public gin::DeprecatedWrappable<DesktopCapturer>,
public gin_helper::Pinnable<DesktopCapturer>,
private DesktopMediaListObserver {
public:
@ -44,7 +44,7 @@ class DesktopCapturer final : public gin::Wrappable<DesktopCapturer>,
bool fetch_window_icons);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -68,7 +68,8 @@ const void* kElectronApiDownloadItemKey = &kElectronApiDownloadItemKey;
} // namespace
gin::WrapperInfo DownloadItem::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo DownloadItem::kWrapperInfo = {
gin::kEmbedderNativeGin};
// static
DownloadItem* DownloadItem::FromDownloadItem(download::DownloadItem* item) {

View file

@ -25,7 +25,7 @@ class Handle;
namespace electron::api {
class DownloadItem final : public gin::Wrappable<DownloadItem>,
class DownloadItem final : public gin::DeprecatedWrappable<DownloadItem>,
public gin_helper::Pinnable<DownloadItem>,
public gin_helper::EventEmitterMixin<DownloadItem>,
private download::DownloadItem::Observer {
@ -36,7 +36,7 @@ class DownloadItem final : public gin::Wrappable<DownloadItem>,
static DownloadItem* FromDownloadItem(download::DownloadItem* item);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -23,7 +23,7 @@
namespace electron::api {
gin::WrapperInfo Extensions::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Extensions::kWrapperInfo = {gin::kEmbedderNativeGin};
Extensions::Extensions(v8::Isolate* isolate,
ElectronBrowserContext* browser_context)

View file

@ -22,7 +22,7 @@ class ElectronBrowserContext;
namespace api {
class Extensions final : public gin::Wrappable<Extensions>,
class Extensions final : public gin::DeprecatedWrappable<Extensions>,
public gin_helper::EventEmitterMixin<Extensions>,
private extensions::ExtensionRegistryObserver {
public:
@ -31,7 +31,7 @@ class Extensions final : public gin::Wrappable<Extensions>,
ElectronBrowserContext* browser_context);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -49,7 +49,8 @@ bool MapHasMediaKeys(
namespace electron::api {
gin::WrapperInfo GlobalShortcut::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo GlobalShortcut::kWrapperInfo = {
gin::kEmbedderNativeGin};
GlobalShortcut::GlobalShortcut() {}
@ -225,7 +226,8 @@ gin::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) {
// static
gin::ObjectTemplateBuilder GlobalShortcut::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<GlobalShortcut>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<GlobalShortcut>::GetObjectTemplateBuilder(
isolate)
.SetMethod("registerAll", &GlobalShortcut::RegisterAll)
.SetMethod("register", &GlobalShortcut::Register)
.SetMethod("isRegistered", &GlobalShortcut::IsRegistered)

View file

@ -22,12 +22,12 @@ class Handle;
namespace electron::api {
class GlobalShortcut final : private ui::GlobalAcceleratorListener::Observer,
public gin::Wrappable<GlobalShortcut> {
public gin::DeprecatedWrappable<GlobalShortcut> {
public:
static gin::Handle<GlobalShortcut> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -130,7 +130,8 @@ struct Converter<in_app_purchase::Product> {
namespace electron::api {
gin::WrapperInfo InAppPurchase::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo InAppPurchase::kWrapperInfo = {
gin::kEmbedderNativeGin};
#if BUILDFLAG(IS_MAC)
// static

View file

@ -22,14 +22,14 @@ class Handle;
namespace electron::api {
class InAppPurchase final : public gin::Wrappable<InAppPurchase>,
class InAppPurchase final : public gin::DeprecatedWrappable<InAppPurchase>,
public gin_helper::EventEmitterMixin<InAppPurchase>,
private in_app_purchase::TransactionObserver {
public:
static gin::Handle<InAppPurchase> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -50,7 +50,7 @@ struct Converter<SharingItem> {
namespace electron::api {
gin::WrapperInfo Menu::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Menu::kWrapperInfo = {gin::kEmbedderNativeGin};
Menu::Menu(gin::Arguments* args)
: model_(std::make_unique<ElectronMenuModel>(this)) {

View file

@ -24,7 +24,7 @@ namespace electron::api {
class BaseWindow;
class WebFrameMain;
class Menu : public gin::Wrappable<Menu>,
class Menu : public gin::DeprecatedWrappable<Menu>,
public gin_helper::EventEmitterMixin<Menu>,
public gin_helper::Constructible<Menu>,
public gin_helper::Pinnable<Menu>,
@ -37,7 +37,7 @@ class Menu : public gin::Wrappable<Menu>,
static const char* GetClassName() { return "Menu"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
#if BUILDFLAG(IS_MAC)

View file

@ -17,7 +17,8 @@
namespace electron::api {
gin::WrapperInfo NativeTheme::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo NativeTheme::kWrapperInfo = {
gin::kEmbedderNativeGin};
NativeTheme::NativeTheme(v8::Isolate* isolate,
ui::NativeTheme* ui_theme,

View file

@ -18,14 +18,14 @@ class handle;
namespace electron::api {
class NativeTheme final : public gin::Wrappable<NativeTheme>,
class NativeTheme final : public gin::DeprecatedWrappable<NativeTheme>,
public gin_helper::EventEmitterMixin<NativeTheme>,
private ui::NativeThemeObserver {
public:
static gin::Handle<NativeTheme> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -79,7 +79,7 @@ void ResolvePromiseWithNetError(gin_helper::Promise<void> promise,
namespace api {
gin::WrapperInfo NetLog::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo NetLog::kWrapperInfo = {gin::kEmbedderNativeGin};
NetLog::NetLog(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
: browser_context_(browser_context) {
@ -219,7 +219,7 @@ v8::Local<v8::Promise> NetLog::StopLogging(gin::Arguments* args) {
gin::ObjectTemplateBuilder NetLog::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<NetLog>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<NetLog>::GetObjectTemplateBuilder(isolate)
.SetProperty("currentlyLogging", &NetLog::IsCurrentlyLogging)
.SetMethod("startLogging", &NetLog::StartLogging)
.SetMethod("stopLogging", &NetLog::StopLogging);

View file

@ -35,7 +35,7 @@ class ElectronBrowserContext;
namespace api {
// The code is referenced from the net_log::NetExportFileWriter class.
class NetLog final : public gin::Wrappable<NetLog> {
class NetLog final : public gin::DeprecatedWrappable<NetLog> {
public:
static gin::Handle<NetLog> Create(v8::Isolate* isolate,
ElectronBrowserContext* browser_context);
@ -46,7 +46,7 @@ class NetLog final : public gin::Wrappable<NetLog> {
bool IsCurrentlyLogging() const;
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -47,7 +47,8 @@ struct Converter<electron::NotificationAction> {
namespace electron::api {
gin::WrapperInfo Notification::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Notification::kWrapperInfo = {
gin::kEmbedderNativeGin};
Notification::Notification(gin::Arguments* args) {
presenter_ = static_cast<ElectronBrowserClient*>(ElectronBrowserClient::Get())

View file

@ -30,7 +30,7 @@ class ErrorThrower;
namespace electron::api {
class Notification final : public gin::Wrappable<Notification>,
class Notification final : public gin::DeprecatedWrappable<Notification>,
public gin_helper::EventEmitterMixin<Notification>,
public gin_helper::Constructible<Notification>,
public gin_helper::CleanedUpAtExit,
@ -54,7 +54,7 @@ class Notification final : public gin::Wrappable<Notification>,
void NotificationFailed(const std::string& error) override;
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
// gin_helper::CleanedUpAtExit

View file

@ -60,7 +60,8 @@ struct Converter<base::PowerThermalObserver::DeviceThermalState> {
namespace electron::api {
gin::WrapperInfo PowerMonitor::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo PowerMonitor::kWrapperInfo = {
gin::kEmbedderNativeGin};
PowerMonitor::PowerMonitor(v8::Isolate* isolate) {
#if BUILDFLAG(IS_MAC)

View file

@ -17,7 +17,7 @@
namespace electron::api {
class PowerMonitor final : public gin::Wrappable<PowerMonitor>,
class PowerMonitor final : public gin::DeprecatedWrappable<PowerMonitor>,
public gin_helper::EventEmitterMixin<PowerMonitor>,
public gin_helper::Pinnable<PowerMonitor>,
private base::PowerStateObserver,
@ -27,7 +27,7 @@ class PowerMonitor final : public gin::Wrappable<PowerMonitor>,
static v8::Local<v8::Value> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -40,7 +40,8 @@ struct Converter<device::mojom::WakeLockType> {
namespace electron::api {
gin::WrapperInfo PowerSaveBlocker::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo PowerSaveBlocker::kWrapperInfo = {
gin::kEmbedderNativeGin};
PowerSaveBlocker::PowerSaveBlocker(v8::Isolate* isolate)
: current_lock_type_(device::mojom::WakeLockType::kPreventAppSuspension) {}
@ -119,7 +120,8 @@ gin::Handle<PowerSaveBlocker> PowerSaveBlocker::Create(v8::Isolate* isolate) {
gin::ObjectTemplateBuilder PowerSaveBlocker::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<PowerSaveBlocker>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<PowerSaveBlocker>::GetObjectTemplateBuilder(
isolate)
.SetMethod("start", &PowerSaveBlocker::Start)
.SetMethod("stop", &PowerSaveBlocker::Stop)
.SetMethod("isStarted", &PowerSaveBlocker::IsStarted);

View file

@ -19,12 +19,13 @@ class Handle;
namespace electron::api {
class PowerSaveBlocker final : public gin::Wrappable<PowerSaveBlocker> {
class PowerSaveBlocker final
: public gin::DeprecatedWrappable<PowerSaveBlocker> {
public:
static gin::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -86,7 +86,7 @@ struct Converter<CustomScheme> {
namespace electron::api {
gin::WrapperInfo Protocol::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Protocol::kWrapperInfo = {gin::kEmbedderNativeGin};
const std::vector<std::string>& GetStandardSchemes() {
return g_standard_schemes;

View file

@ -35,7 +35,7 @@ void RegisterSchemesAsPrivileged(gin_helper::ErrorThrower thrower,
v8::Local<v8::Value> val);
// Protocol implementation based on network services.
class Protocol final : public gin::Wrappable<Protocol>,
class Protocol final : public gin::DeprecatedWrappable<Protocol>,
public gin_helper::Constructible<Protocol> {
public:
static gin::Handle<Protocol> Create(v8::Isolate* isolate,
@ -49,7 +49,7 @@ class Protocol final : public gin::Wrappable<Protocol>,
static const char* GetClassName() { return "Protocol"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
private:

View file

@ -13,7 +13,8 @@ namespace electron::api {
PushNotifications* g_push_notifications = nullptr;
gin::WrapperInfo PushNotifications::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo PushNotifications::kWrapperInfo = {
gin::kEmbedderNativeGin};
PushNotifications::PushNotifications() = default;

View file

@ -23,7 +23,7 @@ namespace electron::api {
class PushNotifications final
: public ElectronBrowserClient::Delegate,
public gin::Wrappable<PushNotifications>,
public gin::DeprecatedWrappable<PushNotifications>,
public gin_helper::EventEmitterMixin<PushNotifications>,
private BrowserObserver {
public:
@ -31,7 +31,7 @@ class PushNotifications final
static gin::Handle<PushNotifications> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -38,7 +38,7 @@
namespace electron::api {
gin::WrapperInfo Screen::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Screen::kWrapperInfo = {gin::kEmbedderNativeGin};
namespace {

View file

@ -26,13 +26,13 @@ class ErrorThrower;
namespace electron::api {
class Screen final : public gin::Wrappable<Screen>,
class Screen final : public gin::DeprecatedWrappable<Screen>,
public gin_helper::EventEmitterMixin<Screen>,
private display::DisplayObserver {
public:
static v8::Local<v8::Value> Create(gin_helper::ErrorThrower error_thrower);
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -75,7 +75,8 @@ v8::Local<v8::Value> ServiceWorkerRunningInfoToDict(
} // namespace
gin::WrapperInfo ServiceWorkerContext::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo ServiceWorkerContext::kWrapperInfo = {
gin::kEmbedderNativeGin};
ServiceWorkerContext::ServiceWorkerContext(
v8::Isolate* isolate,

View file

@ -35,7 +35,7 @@ namespace api {
class ServiceWorkerMain;
class ServiceWorkerContext final
: public gin::Wrappable<ServiceWorkerContext>,
: public gin::DeprecatedWrappable<ServiceWorkerContext>,
public gin_helper::EventEmitterMixin<ServiceWorkerContext>,
private content::ServiceWorkerContextObserver {
public:
@ -80,7 +80,7 @@ class ServiceWorkerContext final
void OnDestruct(content::ServiceWorkerContext* context) override;
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -82,7 +82,8 @@ ServiceWorkerMain* ServiceWorkerMain::FromVersionID(
return FromServiceWorkerKey(key);
}
gin::WrapperInfo ServiceWorkerMain::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo ServiceWorkerMain::kWrapperInfo = {
gin::kEmbedderNativeGin};
ServiceWorkerMain::ServiceWorkerMain(content::ServiceWorkerContext* sw_context,
int64_t version_id,

View file

@ -79,7 +79,7 @@ struct ServiceWorkerKey {
// StoragePartition in which they're registered. In Electron, this is always
// the default StoragePartition for the associated BrowserContext.
class ServiceWorkerMain final
: public gin::Wrappable<ServiceWorkerMain>,
: public gin::DeprecatedWrappable<ServiceWorkerMain>,
public gin_helper::EventEmitterMixin<ServiceWorkerMain>,
public gin_helper::Pinnable<ServiceWorkerMain>,
public gin_helper::Constructible<ServiceWorkerMain> {
@ -101,7 +101,7 @@ class ServiceWorkerMain final
static const char* GetClassName() { return "ServiceWorkerMain"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
// disable copy

View file

@ -552,7 +552,7 @@ const void* kElectronApiSessionKey = &kElectronApiSessionKey;
} // namespace
gin::WrapperInfo Session::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Session::kWrapperInfo = {gin::kEmbedderNativeGin};
Session::Session(v8::Isolate* isolate, ElectronBrowserContext* browser_context)
: isolate_(isolate),

View file

@ -57,7 +57,7 @@ struct PreloadScript;
namespace api {
class Session final : public gin::Wrappable<Session>,
class Session final : public gin::DeprecatedWrappable<Session>,
public gin_helper::Pinnable<Session>,
public gin_helper::Constructible<Session>,
public gin_helper::EventEmitterMixin<Session>,
@ -92,7 +92,7 @@ class Session final : public gin::Wrappable<Session>,
}
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
static void FillObjectTemplate(v8::Isolate*, v8::Local<v8::ObjectTemplate>);
static const char* GetClassName() { return "Session"; }
const char* GetTypeName() override;

View file

@ -14,7 +14,8 @@
namespace electron::api {
gin::WrapperInfo SystemPreferences::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo SystemPreferences::kWrapperInfo = {
gin::kEmbedderNativeGin};
#if BUILDFLAG(IS_WIN)
SystemPreferences::SystemPreferences() {

View file

@ -38,7 +38,7 @@ enum class NotificationCenterKind {
#endif
class SystemPreferences final
: public gin::Wrappable<SystemPreferences>,
: public gin::DeprecatedWrappable<SystemPreferences>,
public gin_helper::EventEmitterMixin<SystemPreferences>
#if BUILDFLAG(IS_WIN)
,
@ -50,7 +50,7 @@ class SystemPreferences final
static gin::Handle<SystemPreferences> Create(v8::Isolate* isolate);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -48,7 +48,7 @@ struct Converter<electron::TrayIcon::IconType> {
namespace electron::api {
gin::WrapperInfo Tray::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Tray::kWrapperInfo = {gin::kEmbedderNativeGin};
Tray::Tray(v8::Isolate* isolate,
v8::Local<v8::Value> image,

View file

@ -38,7 +38,7 @@ namespace electron::api {
class Menu;
class Tray final : public gin::Wrappable<Tray>,
class Tray final : public gin::DeprecatedWrappable<Tray>,
public gin_helper::EventEmitterMixin<Tray>,
public gin_helper::Constructible<Tray>,
public gin_helper::CleanedUpAtExit,
@ -55,7 +55,7 @@ class Tray final : public gin::Wrappable<Tray>,
static const char* GetClassName() { return "Tray"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
// gin_helper::CleanedUpAtExit

View file

@ -60,7 +60,7 @@ GetAllUtilityProcessWrappers() {
namespace api {
gin::WrapperInfo UtilityProcessWrapper::kWrapperInfo = {
gin::DeprecatedWrapperInfo UtilityProcessWrapper::kWrapperInfo = {
gin::kEmbedderNativeGin};
UtilityProcessWrapper::UtilityProcessWrapper(

View file

@ -40,7 +40,7 @@ class Connector;
namespace electron::api {
class UtilityProcessWrapper final
: public gin::Wrappable<UtilityProcessWrapper>,
: public gin::DeprecatedWrappable<UtilityProcessWrapper>,
public gin_helper::Pinnable<UtilityProcessWrapper>,
public gin_helper::EventEmitterMixin<UtilityProcessWrapper>,
private mojo::MessageReceiver,
@ -57,7 +57,7 @@ class UtilityProcessWrapper final
void Shutdown(uint64_t exit_code);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -26,6 +26,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/current_thread.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/unguessable_token.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/devtools/devtools_eye_dropper.h"
@ -147,6 +148,7 @@
#include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
#include "third_party/blink/public/common/page/page_zoom.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
#include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
#include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h"
@ -1820,16 +1822,6 @@ void WebContents::PrimaryMainFrameRenderProcessGone(
Emit("render-process-gone", details);
}
void WebContents::PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) {
#if BUILDFLAG(ENABLE_PLUGINS)
content::WebPluginInfo info;
auto* plugin_service = content::PluginService::GetInstance();
plugin_service->GetPluginInfoByPath(plugin_path, &info);
Emit("plugin-crashed", info.name, info.version);
#endif // BUILDFLAG(ENABLE_PLUGINS)
}
void WebContents::MediaStartedPlaying(const MediaPlayerInfo& video_type,
const content::MediaPlayerId& id) {
Emit("media-started-playing");
@ -3568,10 +3560,20 @@ void WebContents::OnCursorChanged(const ui::Cursor& cursor) {
}
void WebContents::AttachToIframe(content::WebContents* embedder_web_contents,
int embedder_frame_id) {
std::string embedder_frame_token) {
auto token = base::Token::FromString(embedder_frame_token);
if (!token)
return;
auto unguessable_token =
base::UnguessableToken::Deserialize(token->high(), token->low());
if (!unguessable_token)
return;
auto frame_token = blink::LocalFrameToken(unguessable_token.value());
attached_ = true;
if (guest_delegate_)
guest_delegate_->AttachToIframe(embedder_web_contents, embedder_frame_id);
if (guest_delegate_) {
guest_delegate_->AttachToIframe(embedder_web_contents, frame_token);
}
}
bool WebContents::IsOffScreen() const {
@ -4601,7 +4603,8 @@ void WebContents::SetDisableDraggableRegions(bool disable) {
}
// static
gin::WrapperInfo WebContents::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo WebContents::kWrapperInfo = {
gin::kEmbedderNativeGin};
} // namespace electron::api

View file

@ -28,6 +28,7 @@
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/common/stop_find_action.h"
#include "electron/buildflags/buildflags.h"
#include "gin/handle.h"
#include "gin/wrappable.h"
@ -109,7 +110,7 @@ class FrameSubscriber;
// Wrapper around the content::WebContents.
class WebContents final : public ExclusiveAccessContext,
public gin::Wrappable<WebContents>,
public gin::DeprecatedWrappable<WebContents>,
public gin_helper::EventEmitterMixin<WebContents>,
public gin_helper::Constructible<WebContents>,
public gin_helper::Pinnable<WebContents>,
@ -172,7 +173,7 @@ class WebContents final : public ExclusiveAccessContext,
static const char* GetClassName() { return "WebContents"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
// gin_helper::CleanedUpAtExit
@ -307,7 +308,7 @@ class WebContents final : public ExclusiveAccessContext,
// Methods for creating <webview>.
[[nodiscard]] bool is_guest() const { return type_ == Type::kWebView; }
void AttachToIframe(content::WebContents* embedder_web_contents,
int embedder_frame_id);
std::string embedder_frame_token);
void DetachFromOuterFrame();
// Methods for offscreen rendering
@ -629,8 +630,6 @@ class WebContents final : public ExclusiveAccessContext,
void DidUpdateFaviconURL(
content::RenderFrameHost* render_frame_host,
const std::vector<blink::mojom::FaviconURLPtr>& urls) override;
void PluginCrashed(const base::FilePath& plugin_path,
base::ProcessId plugin_pid) override;
void MediaStartedPlaying(const MediaPlayerInfo& video_type,
const content::MediaPlayerId& id) override;
void MediaStoppedPlaying(

View file

@ -144,7 +144,8 @@ content::RenderFrameHost* WebFrameMain::render_frame_host() const {
: content::RenderFrameHost::FromFrameToken(frame_token_);
}
gin::WrapperInfo WebFrameMain::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo WebFrameMain::kWrapperInfo = {
gin::kEmbedderNativeGin};
WebFrameMain::WebFrameMain(content::RenderFrameHost* rfh)
: frame_tree_node_id_(rfh->GetFrameTreeNodeId()),
@ -382,6 +383,14 @@ std::string WebFrameMain::Name() const {
return render_frame_host()->GetFrameName();
}
std::string WebFrameMain::FrameToken() const {
if (!CheckRenderFrame())
return "";
const blink::LocalFrameToken& frame_token =
render_frame_host()->GetFrameToken();
return frame_token.ToString();
}
base::ProcessId WebFrameMain::OSProcessID() const {
if (!CheckRenderFrame())
return -1;
@ -591,6 +600,7 @@ void WebFrameMain::FillObjectTemplate(v8::Isolate* isolate,
.SetProperty("detached", &WebFrameMain::Detached)
.SetProperty("frameTreeNodeId", &WebFrameMain::FrameTreeNodeID)
.SetProperty("name", &WebFrameMain::Name)
.SetProperty("frameToken", &WebFrameMain::FrameToken)
.SetProperty("osProcessId", &WebFrameMain::OSProcessID)
.SetProperty("processId", &WebFrameMain::ProcessID)
.SetProperty("routingId", &WebFrameMain::RoutingID)

View file

@ -45,7 +45,7 @@ namespace electron::api {
class WebContents;
// Bindings for accessing frames from the main process.
class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
class WebFrameMain final : public gin::DeprecatedWrappable<WebFrameMain>,
public gin_helper::EventEmitterMixin<WebFrameMain>,
public gin_helper::Pinnable<WebFrameMain>,
public gin_helper::Constructible<WebFrameMain> {
@ -68,7 +68,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
static const char* GetClassName() { return "WebFrameMain"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
content::RenderFrameHost* render_frame_host() const;
@ -128,6 +128,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
bool Detached() const;
content::FrameTreeNodeId FrameTreeNodeID() const;
std::string Name() const;
std::string FrameToken() const;
base::ProcessId OSProcessID() const;
int32_t ProcessID() const;
int RoutingID() const;

View file

@ -13,6 +13,7 @@
#include "base/memory/raw_ptr.h"
#include "base/task/sequenced_task_runner.h"
#include "base/values.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/api/web_request/web_request_info.h"
#include "extensions/browser/api/web_request/web_request_resource_type.h"
#include "extensions/common/url_pattern.h"
@ -208,7 +209,7 @@ CalculateOnBeforeSendHeadersDelta(const net::HttpRequestHeaders* old_headers,
} // namespace
gin::WrapperInfo WebRequest::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo WebRequest::kWrapperInfo = {gin::kEmbedderNativeGin};
WebRequest::RequestFilter::RequestFilter(
std::set<URLPattern> include_url_patterns,
@ -323,7 +324,7 @@ WebRequest::~WebRequest() {
gin::ObjectTemplateBuilder WebRequest::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<WebRequest>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<WebRequest>::GetObjectTemplateBuilder(isolate)
.SetMethod(
"onBeforeRequest",
&WebRequest::SetResponseListener<ResponseEvent::kOnBeforeRequest>)

View file

@ -31,7 +31,7 @@ class Handle;
namespace electron::api {
class WebRequest final : public gin::Wrappable<WebRequest>,
class WebRequest final : public gin::DeprecatedWrappable<WebRequest>,
public WebRequestAPI {
public:
// Return the WebRequest object attached to |browser_context|, create if there
@ -54,7 +54,7 @@ class WebRequest final : public gin::Wrappable<WebRequest>,
static const char* GetClassName() { return "WebRequest"; }
// gin::Wrappable:
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -28,7 +28,8 @@
namespace electron {
gin::WrapperInfo MessagePort::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo MessagePort::kWrapperInfo = {
gin::kEmbedderNativeGin};
MessagePort::MessagePort() = default;
MessagePort::~MessagePort() {
@ -278,7 +279,8 @@ bool MessagePort::Accept(mojo::Message* mojo_message) {
gin::ObjectTemplateBuilder MessagePort::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<MessagePort>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<MessagePort>::GetObjectTemplateBuilder(
isolate)
.SetMethod("postMessage", &MessagePort::PostMessage)
.SetMethod("start", &MessagePort::Start)
.SetMethod("close", &MessagePort::Close);

View file

@ -27,7 +27,7 @@ class Connector;
namespace electron {
// A non-blink version of blink::MessagePort.
class MessagePort final : public gin::Wrappable<MessagePort>,
class MessagePort final : public gin::DeprecatedWrappable<MessagePort>,
public gin_helper::CleanedUpAtExit,
private mojo::MessageReceiver {
public:
@ -56,7 +56,7 @@ class MessagePort final : public gin::Wrappable<MessagePort>,
bool* threw_exception);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -8,6 +8,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "gin/handle.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "shell/browser/api/electron_api_session.h"

View file

@ -6,6 +6,7 @@
#include "content/browser/renderer_host/render_frame_host_impl.h" // nogncheck
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "shell/browser/api/electron_api_web_contents.h"
#include "shell/browser/javascript_environment.h"
#include "ui/base/page_transition_types.h"

View file

@ -15,6 +15,7 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_api_frame_id_map.h"
#include "extensions/browser/extension_file_task_runner.h"
#include "extensions/browser/extension_registry.h"

View file

@ -496,8 +496,8 @@ void ElectronURLLoaderFactory::StartLoading(
net::RedirectInfo redirect_info = net::RedirectInfo::ComputeRedirectInfo(
request.method, request.url, request.site_for_cookies,
first_party_url_policy, request.referrer_policy,
request.referrer.GetAsReferrer().spec(), head->headers->response_code(),
request.url.Resolve(location),
request.referrer.GetAsReferrer().spec(), request.request_initiator,
head->headers->response_code(), request.url.Resolve(location),
net::RedirectUtil::GetReferrerPolicyHeader(head->headers.get()), false);
DCHECK(client.is_valid());

View file

@ -190,6 +190,9 @@ class InspectableWebContents
void DoAidaConversation(DispatchCallback callback,
const std::string& request,
int stream_id) override {}
void AidaCodeComplete(DispatchCallback callback,
const std::string& request,
int stream_id) override {}
void RegisterAidaClientEvent(DispatchCallback callback,
const std::string& request) override {}

View file

@ -10,6 +10,7 @@
#include "base/memory/raw_ptr.h"
#include "base/strings/utf_string_conversions.h"
#include "content/public/browser/web_contents.h"
#include "shell/browser/ui/drag_util.h"
#include "shell/browser/ui/inspectable_web_contents.h"
#include "shell/browser/ui/inspectable_web_contents_delegate.h"

View file

@ -99,7 +99,7 @@ void AutofillPopupView::Show() {
GetWidget()->Show();
if (initialize_widget)
views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this);
views::NativeViewFocusManager::GetInstance()->AddFocusChangeListener(this);
keypress_callback_ = base::BindRepeating(
&AutofillPopupView::HandleKeyPressEvent, base::Unretained(this));
@ -487,7 +487,7 @@ void AutofillPopupView::ClearSelection() {
void AutofillPopupView::RemoveObserver() {
parent_widget_->RemoveObserver(this);
views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
views::NativeViewFocusManager::GetInstance()->RemoveFocusChangeListener(this);
}
} // namespace electron

View file

@ -15,7 +15,7 @@
#include "ui/base/metadata/metadata_header_macros.h"
#include "ui/base/metadata/metadata_impl_macros.h"
#include "ui/views/drag_controller.h"
#include "ui/views/focus/widget_focus_manager.h"
#include "ui/views/focus/native_view_focus_manager.h"
#include "ui/views/widget/widget_delegate.h"
#include "ui/views/widget/widget_observer.h"
@ -57,7 +57,7 @@ class AutofillPopupChildView : public views::View {
};
class AutofillPopupView : public views::WidgetDelegateView,
private views::WidgetFocusChangeListener,
private views::NativeViewFocusChangeListener,
private views::WidgetObserver,
public views::DragController {
public:

View file

@ -29,14 +29,15 @@ WebViewGuestDelegate::~WebViewGuestDelegate() {
void WebViewGuestDelegate::AttachToIframe(
content::WebContents* embedder_web_contents,
int embedder_frame_id) {
blink::LocalFrameToken& embedder_frame_token) {
embedder_web_contents_ = embedder_web_contents;
int embedder_process_id = embedder_web_contents_->GetPrimaryMainFrame()
->GetProcess()
->GetDeprecatedID();
auto* embedder_frame =
content::RenderFrameHost::FromID(embedder_process_id, embedder_frame_id);
auto* embedder_frame = content::RenderFrameHost::FromFrameToken(
content::GlobalRenderFrameHostToken(embedder_process_id,
embedder_frame_token));
DCHECK_EQ(embedder_web_contents_,
content::WebContents::FromRenderFrameHost(embedder_frame));

View file

@ -11,6 +11,7 @@
#include "content/public/browser/browser_plugin_guest_delegate.h"
#include "shell/browser/web_contents_zoom_controller.h"
#include "shell/browser/web_contents_zoom_observer.h"
#include "third_party/blink/public/common/tokens/tokens.h"
namespace electron {
@ -31,7 +32,7 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
// Attach to the iframe.
void AttachToIframe(content::WebContents* embedder_web_contents,
int embedder_frame_id);
blink::LocalFrameToken& embedder_frame_token);
void WillDestroy();
protected:

View file

@ -606,7 +606,8 @@ const char* NativeImage::GetTypeName() {
}
// static
gin::WrapperInfo NativeImage::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo NativeImage::kWrapperInfo = {
gin::kEmbedderNativeGin};
} // namespace electron::api

View file

@ -46,7 +46,7 @@ class ErrorThrower;
namespace electron::api {
class NativeImage final : public gin::Wrappable<NativeImage> {
class NativeImage final : public gin::DeprecatedWrappable<NativeImage> {
public:
NativeImage(v8::Isolate* isolate, const gfx::Image& image);
#if BUILDFLAG(IS_WIN)
@ -96,7 +96,7 @@ class NativeImage final : public gin::Wrappable<NativeImage> {
OnConvertError on_error = OnConvertError::kThrow);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -165,7 +165,7 @@ class BufferDataSource : public mojo::DataPipeProducer::DataSource {
};
class JSChunkedDataPipeGetter final
: public gin::Wrappable<JSChunkedDataPipeGetter>,
: public gin::DeprecatedWrappable<JSChunkedDataPipeGetter>,
public network::mojom::ChunkedDataPipeGetter {
public:
static gin::Handle<JSChunkedDataPipeGetter> Create(
@ -181,15 +181,15 @@ class JSChunkedDataPipeGetter final
// gin::Wrappable
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override {
return gin::Wrappable<JSChunkedDataPipeGetter>::GetObjectTemplateBuilder(
isolate)
return gin::DeprecatedWrappable<
JSChunkedDataPipeGetter>::GetObjectTemplateBuilder(isolate)
.SetMethod("write", &JSChunkedDataPipeGetter::WriteChunk)
.SetMethod("done", &JSChunkedDataPipeGetter::Done);
}
const char* GetTypeName() override { return "JSChunkedDataPipeGetter"; }
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
~JSChunkedDataPipeGetter() override = default;
private:
@ -298,7 +298,7 @@ class JSChunkedDataPipeGetter final
v8::Global<v8::Function> body_func_;
};
gin::WrapperInfo JSChunkedDataPipeGetter::kWrapperInfo = {
gin::DeprecatedWrapperInfo JSChunkedDataPipeGetter::kWrapperInfo = {
gin::kEmbedderNativeGin};
const net::NetworkTrafficAnnotationTag kTrafficAnnotation =
@ -320,7 +320,7 @@ const net::NetworkTrafficAnnotationTag kTrafficAnnotation =
} // namespace
gin::WrapperInfo SimpleURLLoaderWrapper::kWrapperInfo = {
gin::DeprecatedWrapperInfo SimpleURLLoaderWrapper::kWrapperInfo = {
gin::kEmbedderNativeGin};
SimpleURLLoaderWrapper::SimpleURLLoaderWrapper(

View file

@ -49,7 +49,7 @@ namespace electron::api {
/** Wraps a SimpleURLLoader to make it usable from JavaScript */
class SimpleURLLoaderWrapper final
: public gin::Wrappable<SimpleURLLoaderWrapper>,
: public gin::DeprecatedWrappable<SimpleURLLoaderWrapper>,
public gin_helper::EventEmitterMixin<SimpleURLLoaderWrapper>,
public gin_helper::CleanedUpAtExit,
private network::SimpleURLLoaderStreamConsumer,
@ -61,7 +61,7 @@ class SimpleURLLoaderWrapper final
void Cancel();
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -257,7 +257,7 @@ bool Converter<net::HttpRequestHeaders>::FromV8(v8::Isolate* isolate,
namespace {
class ChunkedDataPipeReadableStream final
: public gin::Wrappable<ChunkedDataPipeReadableStream> {
: public gin::DeprecatedWrappable<ChunkedDataPipeReadableStream> {
public:
static gin::Handle<ChunkedDataPipeReadableStream> Create(
v8::Isolate* isolate,
@ -270,14 +270,14 @@ class ChunkedDataPipeReadableStream final
// gin::Wrappable
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override {
return gin::Wrappable<
return gin::DeprecatedWrappable<
ChunkedDataPipeReadableStream>::GetObjectTemplateBuilder(isolate)
.SetMethod("read", &ChunkedDataPipeReadableStream::Read);
}
const char* GetTypeName() override { return "ChunkedDataPipeReadableStream"; }
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
private:
ChunkedDataPipeReadableStream(
@ -495,7 +495,7 @@ class ChunkedDataPipeReadableStream final
gin_helper::Promise<int> promise_;
};
gin::WrapperInfo ChunkedDataPipeReadableStream::kWrapperInfo = {
gin::DeprecatedWrapperInfo ChunkedDataPipeReadableStream::kWrapperInfo = {
gin::kEmbedderNativeGin};
} // namespace

View file

@ -20,7 +20,7 @@ class EventEmitterMixin;
// To use, inherit from gin::Wrappable and gin_helper::Constructible, and
// define the static methods New and FillObjectTemplate:
//
// class Example : public gin::Wrappable<Example>,
// class Example : public gin::DeprecatedWrappable<Example>,
// public gin_helper::Constructible<Example> {
// public:
// static gin::Handle<Example> New(...usual gin method arguments...);
@ -57,7 +57,8 @@ class Constructible {
gin::kNumberOfInternalFields);
constructor->SetClassName(gin::StringToV8(isolate, T::GetClassName()));
T::FillObjectTemplate(isolate, constructor->PrototypeTemplate());
data->SetObjectTemplate(wrapper_info, constructor->InstanceTemplate());
data->DeprecatedSetObjectTemplate(wrapper_info,
constructor->InstanceTemplate());
data->SetFunctionTemplate(wrapper_info, constructor);
}
return constructor->GetFunction(context).ToLocalChecked();

View file

@ -27,7 +27,7 @@ Event::Event() = default;
Event::~Event() = default;
gin::WrapperInfo Event::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Event::kWrapperInfo = {gin::kEmbedderNativeGin};
const char* Event::GetTypeName() {
return GetClassName();

View file

@ -23,7 +23,7 @@ class ObjectTemplate;
namespace gin_helper::internal {
class Event final : public gin::Wrappable<Event>,
class Event final : public gin::DeprecatedWrappable<Event>,
public gin_helper::Constructible<Event> {
public:
// gin_helper::Constructible
@ -34,7 +34,7 @@ class Event final : public gin::Wrappable<Event>,
static const char* GetClassName() { return "Event"; }
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
const char* GetTypeName() override;
~Event() override;

View file

@ -56,7 +56,7 @@ v8::Local<v8::Value> CustomEmit(v8::Isolate* isolate,
template <typename T, typename... Args>
v8::Local<v8::Value> CallMethod(v8::Isolate* isolate,
gin::Wrappable<T>* object,
gin::DeprecatedWrappable<T>* object,
const char* method_name,
Args&&... args) {
v8::EscapableHandleScope scope(isolate);
@ -69,7 +69,7 @@ v8::Local<v8::Value> CallMethod(v8::Isolate* isolate,
}
template <typename T, typename... Args>
v8::Local<v8::Value> CallMethod(gin::Wrappable<T>* object,
v8::Local<v8::Value> CallMethod(gin::DeprecatedWrappable<T>* object,
const char* method_name,
Args&&... args) {
v8::Isolate* isolate = v8::Isolate::GetCurrent();

View file

@ -12,7 +12,7 @@
namespace gin_helper::internal {
gin::WrapperInfo kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo kWrapperInfo = {gin::kEmbedderNativeGin};
v8::Local<v8::FunctionTemplate> GetEventEmitterTemplate(v8::Isolate* isolate) {
gin::PerIsolateData* data = gin::PerIsolateData::From(isolate);

View file

@ -22,7 +22,8 @@ gin::Handle<ReplyChannel> ReplyChannel::Create(v8::Isolate* isolate,
gin::ObjectTemplateBuilder ReplyChannel::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<ReplyChannel>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<ReplyChannel>::GetObjectTemplateBuilder(
isolate)
.SetMethod("sendReply", &ReplyChannel::SendReply);
}
@ -61,6 +62,7 @@ bool ReplyChannel::SendReply(v8::Isolate* isolate, v8::Local<v8::Value> arg) {
return true;
}
gin::WrapperInfo ReplyChannel::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo ReplyChannel::kWrapperInfo = {
gin::kEmbedderNativeGin};
} // namespace gin_helper::internal

View file

@ -26,14 +26,14 @@ namespace gin_helper::internal {
// This object wraps the InvokeCallback so that if it gets GC'd by V8, we can
// still call the callback and send an error. Not doing so causes a Mojo DCHECK,
// since Mojo requires callbacks to be called before they are destroyed.
class ReplyChannel : public gin::Wrappable<ReplyChannel> {
class ReplyChannel : public gin::DeprecatedWrappable<ReplyChannel> {
public:
using InvokeCallback = electron::mojom::ElectronApiIPC::InvokeCallback;
static gin::Handle<ReplyChannel> Create(v8::Isolate* isolate,
InvokeCallback callback);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;

View file

@ -11,7 +11,7 @@
namespace gin_helper {
bool IsValidWrappable(const v8::Local<v8::Value>& val,
const gin::WrapperInfo* wrapper_info) {
const gin::DeprecatedWrapperInfo* wrapper_info) {
if (!val->IsObject())
return false;
@ -19,8 +19,9 @@ bool IsValidWrappable(const v8::Local<v8::Value>& val,
if (port->InternalFieldCount() != gin::kNumberOfInternalFields)
return false;
const gin::WrapperInfo* info = static_cast<gin::WrapperInfo*>(
port->GetAlignedPointerFromInternalField(gin::kWrapperInfoIndex));
const gin::DeprecatedWrapperInfo* info =
static_cast<gin::DeprecatedWrapperInfo*>(
port->GetAlignedPointerFromInternalField(gin::kWrapperInfoIndex));
if (info != wrapper_info)
return false;

View file

@ -12,7 +12,7 @@
namespace gin_helper {
bool IsValidWrappable(const v8::Local<v8::Value>& obj,
const gin::WrapperInfo* wrapper_info);
const gin::DeprecatedWrapperInfo* wrapper_info);
namespace internal {
@ -69,12 +69,13 @@ class Wrappable : public WrappableBase {
}
private:
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
};
// static
template <typename T>
gin::WrapperInfo Wrappable<T>::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo Wrappable<T>::kWrapperInfo = {
gin::kEmbedderNativeGin};
} // namespace gin_helper

View file

@ -55,9 +55,9 @@ bool IsWorkerThread() {
}
template <typename T>
class IPCBase : public gin::Wrappable<T> {
class IPCBase : public gin::DeprecatedWrappable<T> {
public:
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
static gin::Handle<T> Create(v8::Isolate* isolate) {
return gin::CreateHandle(isolate, new T(isolate));
@ -184,7 +184,7 @@ class IPCBase : public gin::Wrappable<T> {
// gin::Wrappable:
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override {
return gin::Wrappable<T>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<T>::GetObjectTemplateBuilder(isolate)
.SetMethod("send", &T::SendMessage)
.SetMethod("sendSync", &T::SendSync)
.SetMethod("sendToHost", &T::SendToHost)
@ -236,7 +236,7 @@ class IPCRenderFrame : public IPCBase<IPCRenderFrame>,
};
template <>
gin::WrapperInfo IPCBase<IPCRenderFrame>::kWrapperInfo = {
gin::DeprecatedWrapperInfo IPCBase<IPCRenderFrame>::kWrapperInfo = {
gin::kEmbedderNativeGin};
class IPCServiceWorker : public IPCBase<IPCServiceWorker>,
@ -260,7 +260,7 @@ class IPCServiceWorker : public IPCBase<IPCServiceWorker>,
};
template <>
gin::WrapperInfo IPCBase<IPCServiceWorker>::kWrapperInfo = {
gin::DeprecatedWrapperInfo IPCBase<IPCServiceWorker>::kWrapperInfo = {
gin::kEmbedderNativeGin};
void Initialize(v8::Local<v8::Object> exports,

View file

@ -31,6 +31,7 @@
#include "shell/common/gin_helper/function_template_extensions.h"
#include "shell/common/gin_helper/promise.h"
#include "shell/common/node_includes.h"
#include "shell/common/node_util.h"
#include "shell/common/options_switches.h"
#include "shell/common/web_contents_utility.mojom.h"
#include "shell/renderer/api/context_bridge/object_cache.h"
@ -328,10 +329,11 @@ class SpellCheckerHolder final : private content::RenderFrameObserver {
std::unique_ptr<SpellCheckClient> spell_check_client_;
};
class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
private content::RenderFrameObserver {
class WebFrameRenderer final
: public gin::DeprecatedWrappable<WebFrameRenderer>,
private content::RenderFrameObserver {
public:
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
static gin::Handle<WebFrameRenderer> Create(
v8::Isolate* isolate,
@ -347,8 +349,8 @@ class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
// gin::Wrappable:
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override {
return gin::Wrappable<WebFrameRenderer>::GetObjectTemplateBuilder(isolate)
.SetMethod("getWebFrameId", &WebFrameRenderer::GetWebFrameId)
return gin::DeprecatedWrappable<WebFrameRenderer>::GetObjectTemplateBuilder(
isolate)
.SetMethod("setName", &WebFrameRenderer::SetName)
.SetMethod("setZoomLevel", &WebFrameRenderer::SetZoomLevel)
.SetMethod("getZoomLevel", &WebFrameRenderer::GetZoomLevel)
@ -379,9 +381,12 @@ class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
// Frame navigators
.SetMethod("findFrameByRoutingId",
&WebFrameRenderer::FindFrameByRoutingId)
.SetMethod("findFrameByToken", &WebFrameRenderer::FindFrameByToken)
.SetMethod("getFrameForSelector",
&WebFrameRenderer::GetFrameForSelector)
.SetMethod("findFrameByName", &WebFrameRenderer::FindFrameByName)
.SetMethod("_findFrameByWindow", &WebFrameRenderer::FindFrameByWindow)
.SetProperty("frameToken", &WebFrameRenderer::GetFrameToken)
.SetProperty("opener", &WebFrameRenderer::GetOpener)
.SetProperty("parent", &WebFrameRenderer::GetFrameParent)
.SetProperty("top", &WebFrameRenderer::GetTop)
@ -528,23 +533,6 @@ class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
web_frame->View()->SetDefaultPageScaleLimits(min_level, max_level);
}
static int GetWebFrameId(v8::Local<v8::Object> content_window) {
// Get the WebLocalFrame before (possibly) executing any user-space JS while
// getting the |params|. We track the status of the RenderFrame via an
// observer in case it is deleted during user code execution.
content::RenderFrame* render_frame = GetRenderFrame(content_window);
if (!render_frame)
return -1;
blink::WebLocalFrame* frame = render_frame->GetWebFrame();
// Parent must exist.
blink::WebFrame* parent_frame = frame->Parent();
DCHECK(parent_frame);
DCHECK(parent_frame->IsWebLocalFrame());
return render_frame->GetRoutingID();
}
void SetSpellCheckProvider(gin_helper::ErrorThrower thrower,
v8::Isolate* isolate,
const std::string& language,
@ -819,14 +807,63 @@ class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
v8::Local<v8::Value> FindFrameByRoutingId(v8::Isolate* isolate,
int routing_id) {
util::EmitDeprecationWarning(isolate,
"findFrameByRoutingId() is deprecated, use "
"findFrameByToken() instead.");
return v8::Null(isolate);
}
v8::Local<v8::Value> FindFrameByToken(v8::Isolate* isolate,
std::string frame_token) {
auto token = base::Token::FromString(frame_token);
if (!token) {
return v8::Null(isolate);
}
auto unguessable_token =
base::UnguessableToken::Deserialize(token->high(), token->low());
if (!unguessable_token) {
return v8::Null(isolate);
}
auto* web_frame = blink::WebLocalFrame::FromFrameToken(
blink::LocalFrameToken(unguessable_token.value()));
content::RenderFrame* render_frame =
content::RenderFrame::FromRoutingID(routing_id);
content::RenderFrame::FromWebFrame(web_frame);
if (render_frame)
return WebFrameRenderer::Create(isolate, render_frame).ToV8();
else
return v8::Null(isolate);
}
v8::Local<v8::Value> FindFrameByWindow(v8::Isolate* isolate,
v8::Local<v8::Object> content_window) {
// Get the WebLocalFrame before (possibly) executing any user-space JS while
// getting the |params|. We track the status of the RenderFrame via an
// observer in case it is deleted during user code execution.
content::RenderFrame* render_frame = GetRenderFrame(content_window);
if (!render_frame)
return v8::Null(isolate);
blink::WebLocalFrame* frame = render_frame->GetWebFrame();
// Parent must exist.
blink::WebFrame* parent_frame = frame->Parent();
DCHECK(parent_frame);
DCHECK(parent_frame->IsWebLocalFrame());
return WebFrameRenderer::Create(isolate, render_frame).ToV8();
}
std::string GetFrameToken(v8::Isolate* isolate) {
content::RenderFrame* render_frame;
if (!MaybeGetRenderFrame(isolate, "frameToken", &render_frame))
return "";
blink::WebLocalFrame* frame = render_frame->GetWebFrame();
DCHECK(frame);
// TODO: use gin serializer?
return frame->GetLocalFrameToken().ToString();
}
v8::Local<v8::Value> GetOpener(v8::Isolate* isolate) {
content::RenderFrame* render_frame;
if (!MaybeGetRenderFrame(isolate, "opener", &render_frame))
@ -901,16 +938,15 @@ class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
}
int GetRoutingId(v8::Isolate* isolate) {
content::RenderFrame* render_frame;
if (!MaybeGetRenderFrame(isolate, "routingId", &render_frame))
return 0;
return render_frame->GetRoutingID();
util::EmitDeprecationWarning(
isolate, "routingId is deprecated, use frameToken instead.");
return -1;
}
};
} // namespace
gin::WrapperInfo WebFrameRenderer::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo WebFrameRenderer::kWrapperInfo = {
gin::kEmbedderNativeGin};
// static
std::set<SpellCheckerHolder*> SpellCheckerHolder::instances_;

View file

@ -20,7 +20,7 @@
namespace electron {
gin::WrapperInfo ParentPort::kWrapperInfo = {gin::kEmbedderNativeGin};
gin::DeprecatedWrapperInfo ParentPort::kWrapperInfo = {gin::kEmbedderNativeGin};
ParentPort* ParentPort::GetInstance() {
static ParentPort* instance = new ParentPort();
@ -113,7 +113,7 @@ gin::Handle<ParentPort> ParentPort::Create(v8::Isolate* isolate) {
// static
gin::ObjectTemplateBuilder ParentPort::GetObjectTemplateBuilder(
v8::Isolate* isolate) {
return gin::Wrappable<ParentPort>::GetObjectTemplateBuilder(isolate)
return gin::DeprecatedWrappable<ParentPort>::GetObjectTemplateBuilder(isolate)
.SetMethod("postMessage", &ParentPort::PostMessage)
.SetMethod("start", &ParentPort::Start)
.SetMethod("pause", &ParentPort::Pause);

View file

@ -31,7 +31,7 @@ namespace electron {
// There is only a single instance of this class
// for the lifetime of a Utility Process which
// also means that GC lifecycle is ignored by this class.
class ParentPort final : public gin::Wrappable<ParentPort>,
class ParentPort final : public gin::DeprecatedWrappable<ParentPort>,
public gin_helper::CleanedUpAtExit,
private mojo::MessageReceiver {
public:
@ -46,7 +46,7 @@ class ParentPort final : public gin::Wrappable<ParentPort>,
void Initialize(blink::MessagePortDescriptor port);
// gin::Wrappable
static gin::WrapperInfo kWrapperInfo;
static gin::DeprecatedWrapperInfo kWrapperInfo;
gin::ObjectTemplateBuilder GetObjectTemplateBuilder(
v8::Isolate* isolate) override;
const char* GetTypeName() override;