Add app.defaultSession

This commit is contained in:
Cheng Zhao 2015-06-23 23:40:41 +08:00
parent 4359eb4472
commit 33c2768a77
5 changed files with 28 additions and 14 deletions

View file

@ -608,7 +608,9 @@ void WebContents::InspectServiceWorker() {
v8::Local<v8::Value> WebContents::Session(v8::Isolate* isolate) {
if (session_.IsEmpty()) {
auto handle = Session::Create(isolate, web_contents()->GetBrowserContext());
mate::Handle<api::Session> handle = Session::Create(
isolate,
static_cast<AtomBrowserContext*>(web_contents()->GetBrowserContext()));
session_.Reset(isolate, handle.ToV8());
}
return v8::Local<v8::Value>::New(isolate, session_);