refactor: promisify prototype methods (#16935)
This commit is contained in:
parent
9112ad01be
commit
2492f0bcac
3 changed files with 14 additions and 19 deletions
|
@ -61,7 +61,6 @@
|
|||
|
||||
#include "atom/common/node_includes.h"
|
||||
|
||||
using atom::api::Cookies;
|
||||
using content::BrowserThread;
|
||||
using content::StoragePartition;
|
||||
|
||||
|
@ -785,6 +784,8 @@ void Session::BuildPrototype(v8::Isolate* isolate,
|
|||
|
||||
namespace {
|
||||
|
||||
using atom::api::Cookies;
|
||||
using atom::api::Protocol;
|
||||
using atom::api::Session;
|
||||
|
||||
v8::Local<v8::Value> FromPartition(const std::string& partition,
|
||||
|
@ -810,6 +811,9 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
dict.Set(
|
||||
"Cookies",
|
||||
Cookies::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
dict.Set(
|
||||
"Protocol",
|
||||
Protocol::GetConstructor(isolate)->GetFunction(context).ToLocalChecked());
|
||||
dict.SetMethod("fromPartition", &FromPartition);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue