2015-06-16 09:23:29 +00:00
|
|
|
// Copyright (c) 2015 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
|
|
|
#ifndef ATOM_BROWSER_API_ATOM_API_SESSION_H_
|
|
|
|
#define ATOM_BROWSER_API_ATOM_API_SESSION_H_
|
|
|
|
|
|
|
|
#include "native_mate/handle.h"
|
|
|
|
#include "native_mate/wrappable.h"
|
|
|
|
|
2015-06-18 10:38:32 +00:00
|
|
|
namespace content {
|
|
|
|
class WebContents;
|
|
|
|
}
|
|
|
|
|
2015-06-16 09:23:29 +00:00
|
|
|
namespace atom {
|
|
|
|
|
|
|
|
namespace api {
|
|
|
|
|
|
|
|
class Session: public mate::Wrappable {
|
|
|
|
public:
|
2015-06-18 10:38:32 +00:00
|
|
|
static mate::Handle<Session> Create(v8::Isolate* isolate,
|
|
|
|
content::WebContents* web_contents);
|
2015-06-16 09:23:29 +00:00
|
|
|
|
|
|
|
protected:
|
2015-06-18 10:38:32 +00:00
|
|
|
explicit Session(content::WebContents* web_contents);
|
2015-06-16 09:23:29 +00:00
|
|
|
~Session();
|
|
|
|
|
|
|
|
// mate::Wrappable implementations:
|
|
|
|
mate::ObjectTemplateBuilder GetObjectTemplateBuilder(
|
|
|
|
v8::Isolate* isolate) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
v8::Local<v8::Value> Cookies(v8::Isolate* isolate);
|
|
|
|
|
|
|
|
v8::Global<v8::Value> cookies_;
|
|
|
|
|
2015-06-18 10:38:32 +00:00
|
|
|
// The webContents which owns the Sesssion.
|
|
|
|
content::WebContents* web_contents_;
|
|
|
|
|
2015-06-16 09:23:29 +00:00
|
|
|
DISALLOW_COPY_AND_ASSIGN(Session);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace api
|
|
|
|
|
|
|
|
} // namespace atom
|
|
|
|
|
|
|
|
#endif // ATOM_BROWSER_API_ATOM_API_SESSION_H_
|