refactor: consolidate WebContents::{Create,New} (#26521)
This commit is contained in:
parent
a303813d15
commit
92643a5a1c
5 changed files with 5 additions and 15 deletions
|
@ -3727,7 +3727,7 @@ ElectronBrowserContext* WebContents::GetBrowserContext() const {
|
|||
}
|
||||
|
||||
// static
|
||||
gin::Handle<WebContents> WebContents::Create(
|
||||
gin::Handle<WebContents> WebContents::New(
|
||||
v8::Isolate* isolate,
|
||||
const gin_helper::Dictionary& options) {
|
||||
gin::Handle<WebContents> handle =
|
||||
|
@ -3736,13 +3736,6 @@ gin::Handle<WebContents> WebContents::Create(
|
|||
return handle;
|
||||
}
|
||||
|
||||
// static
|
||||
gin::Handle<WebContents> WebContents::New(
|
||||
v8::Isolate* isolate,
|
||||
const gin_helper::Dictionary& options) {
|
||||
return Create(isolate, options);
|
||||
}
|
||||
|
||||
// static
|
||||
gin::Handle<WebContents> WebContents::CreateAndTake(
|
||||
v8::Isolate* isolate,
|
||||
|
@ -3809,7 +3802,6 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
v8::Isolate* isolate = context->GetIsolate();
|
||||
gin_helper::Dictionary dict(isolate, exports);
|
||||
dict.Set("WebContents", WebContents::GetConstructor(context));
|
||||
dict.SetMethod("create", &WebContents::Create);
|
||||
dict.SetMethod("fromId", &WebContents::FromID);
|
||||
dict.SetMethod("getAllWebContents", &GetAllWebContentsAsV8);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue