refactor: consolidate WebContents::{Create,New} (#26521)

This commit is contained in:
Jeremy Rose 2020-11-17 14:14:33 -08:00 committed by GitHub
parent a303813d15
commit 92643a5a1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 5 additions and 15 deletions

View file

@ -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);
}