refactor: always initialize api::Protocol (#21009)

This commit is contained in:
Jeremy Apthorp 2019-11-07 15:35:12 -08:00 committed by GitHub
parent b06a479240
commit fd70ac1173
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -226,6 +226,8 @@ Session::Session(v8::Isolate* isolate, AtomBrowserContext* browser_context)
new SessionPreferences(browser_context);
protocol_.Reset(isolate, Protocol::Create(isolate, browser_context).ToV8());
Init(isolate);
AttachAsUserData(browser_context);
}
@ -609,11 +611,6 @@ v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
}
v8::Local<v8::Value> Session::Protocol(v8::Isolate* isolate) {
if (protocol_.IsEmpty()) {
v8::Local<v8::Value> handle;
handle = Protocol::Create(isolate, browser_context()).ToV8();
protocol_.Reset(isolate, handle);
}
return v8::Local<v8::Value>::New(isolate, protocol_);
}