Fix more code styles.

This commit is contained in:
Haojian Wu 2015-06-20 10:41:40 +08:00
parent c164da5a38
commit bafbee805c
5 changed files with 39 additions and 37 deletions

View file

@ -5,7 +5,7 @@
#include "atom/browser/api/atom_api_session.h"
#include "atom/browser/api/atom_api_cookies.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/browser_context.h"
#include "native_mate/callback.h"
#include "native_mate/dictionary.h"
#include "native_mate/object_template_builder.h"
@ -16,8 +16,8 @@ namespace atom {
namespace api {
Session::Session(content::WebContents* web_contents):
web_contents_(web_contents) {
Session::Session(content::BrowserContext* browser_context):
browser_context_(browser_context) {
}
Session::~Session() {
@ -25,7 +25,7 @@ Session::~Session() {
v8::Local<v8::Value> Session::Cookies(v8::Isolate* isolate) {
if (cookies_.IsEmpty()) {
auto handle = atom::api::Cookies::Create(isolate, web_contents_);
auto handle = atom::api::Cookies::Create(isolate, browser_context_);
cookies_.Reset(isolate, handle.ToV8());
}
return v8::Local<v8::Value>::New(isolate, cookies_);
@ -38,9 +38,10 @@ mate::ObjectTemplateBuilder Session::GetObjectTemplateBuilder(
}
// static
mate::Handle<Session> Session::Create(v8::Isolate* isolate,
content::WebContents* web_contents) {
return CreateHandle(isolate, new Session(web_contents));
mate::Handle<Session> Session::Create(
v8::Isolate* isolate,
content::BrowserContext* browser_context) {
return CreateHandle(isolate, new Session(browser_context));
}
} // namespace api