Pass FunctionTemplate in BuildPrototype

This commit is contained in:
Cheng Zhao 2016-08-02 18:08:12 +09:00
parent 895b8b47ee
commit cb19efe49c
47 changed files with 71 additions and 71 deletions

View file

@ -531,9 +531,9 @@ mate::Handle<App> App::Create(v8::Isolate* isolate) {
// static // static
void App::BuildPrototype( void App::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
auto browser = base::Unretained(Browser::Get()); auto browser = base::Unretained(Browser::Get());
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("quit", base::Bind(&Browser::Quit, browser)) .SetMethod("quit", base::Bind(&Browser::Quit, browser))
.SetMethod("exit", base::Bind(&Browser::Exit, browser)) .SetMethod("exit", base::Bind(&Browser::Exit, browser))
.SetMethod("focus", base::Bind(&Browser::Focus, browser)) .SetMethod("focus", base::Bind(&Browser::Focus, browser))

View file

@ -40,7 +40,7 @@ class App : public AtomBrowserClient::Delegate,
static mate::Handle<App> Create(v8::Isolate* isolate); static mate::Handle<App> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
// Called when window with disposition needs to be created. // Called when window with disposition needs to be created.
void OnCreateWindow(const GURL& target_url, void OnCreateWindow(const GURL& target_url,

View file

@ -106,8 +106,8 @@ mate::Handle<AutoUpdater> AutoUpdater::Create(v8::Isolate* isolate) {
// static // static
void AutoUpdater::BuildPrototype( void AutoUpdater::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates) .SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
.SetMethod("getFeedURL", &auto_updater::AutoUpdater::GetFeedURL) .SetMethod("getFeedURL", &auto_updater::AutoUpdater::GetFeedURL)
.SetMethod("setFeedURL", &AutoUpdater::SetFeedURL) .SetMethod("setFeedURL", &AutoUpdater::SetFeedURL)

View file

@ -24,7 +24,7 @@ class AutoUpdater : public mate::EventEmitter<AutoUpdater>,
static mate::Handle<AutoUpdater> Create(v8::Isolate* isolate); static mate::Handle<AutoUpdater> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
explicit AutoUpdater(v8::Isolate* isolate); explicit AutoUpdater(v8::Isolate* isolate);

View file

@ -248,8 +248,8 @@ mate::Handle<Cookies> Cookies::Create(
// static // static
void Cookies::BuildPrototype(v8::Isolate* isolate, void Cookies::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("get", &Cookies::Get) .SetMethod("get", &Cookies::Get)
.SetMethod("remove", &Cookies::Remove) .SetMethod("remove", &Cookies::Remove)
.SetMethod("set", &Cookies::Set); .SetMethod("set", &Cookies::Set);

View file

@ -41,7 +41,7 @@ class Cookies : public mate::TrackableObject<Cookies> {
// mate::TrackableObject: // mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context); Cookies(v8::Isolate* isolate, AtomBrowserContext* browser_context);

View file

@ -159,8 +159,8 @@ mate::Handle<Debugger> Debugger::Create(
// static // static
void Debugger::BuildPrototype(v8::Isolate* isolate, void Debugger::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("attach", &Debugger::Attach) .SetMethod("attach", &Debugger::Attach)
.SetMethod("isAttached", &Debugger::IsAttached) .SetMethod("isAttached", &Debugger::IsAttached)
.SetMethod("detach", &Debugger::Detach) .SetMethod("detach", &Debugger::Detach)

View file

@ -39,7 +39,7 @@ class Debugger: public mate::TrackableObject<Debugger>,
// mate::TrackableObject: // mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
Debugger(v8::Isolate* isolate, content::WebContents* web_contents); Debugger(v8::Isolate* isolate, content::WebContents* web_contents);

View file

@ -99,8 +99,8 @@ mate::Handle<DesktopCapturer> DesktopCapturer::Create(v8::Isolate* isolate) {
// static // static
void DesktopCapturer::BuildPrototype( void DesktopCapturer::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("startHandling", &DesktopCapturer::StartHandling); .SetMethod("startHandling", &DesktopCapturer::StartHandling);
} }

View file

@ -20,7 +20,7 @@ class DesktopCapturer: public mate::EventEmitter<DesktopCapturer>,
static mate::Handle<DesktopCapturer> Create(v8::Isolate* isolate); static mate::Handle<DesktopCapturer> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
void StartHandling(bool capture_window, void StartHandling(bool capture_window,
bool capture_screen, bool capture_screen,

View file

@ -167,8 +167,8 @@ base::FilePath DownloadItem::GetSavePath() const {
// static // static
void DownloadItem::BuildPrototype(v8::Isolate* isolate, void DownloadItem::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable() .MakeDestroyable()
.SetMethod("pause", &DownloadItem::Pause) .SetMethod("pause", &DownloadItem::Pause)
.SetMethod("isPaused", &DownloadItem::IsPaused) .SetMethod("isPaused", &DownloadItem::IsPaused)

View file

@ -24,7 +24,7 @@ class DownloadItem : public mate::TrackableObject<DownloadItem>,
content::DownloadItem* item); content::DownloadItem* item);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
void Pause(); void Pause();
bool IsPaused() const; bool IsPaused() const;

View file

@ -74,8 +74,8 @@ mate::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) {
// static // static
void GlobalShortcut::BuildPrototype( void GlobalShortcut::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("register", &GlobalShortcut::Register) .SetMethod("register", &GlobalShortcut::Register)
.SetMethod("isRegistered", &GlobalShortcut::IsRegistered) .SetMethod("isRegistered", &GlobalShortcut::IsRegistered)
.SetMethod("unregister", &GlobalShortcut::Unregister) .SetMethod("unregister", &GlobalShortcut::Unregister)

View file

@ -24,7 +24,7 @@ class GlobalShortcut : public extensions::GlobalShortcutListener::Observer,
static mate::Handle<GlobalShortcut> Create(v8::Isolate* isolate); static mate::Handle<GlobalShortcut> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
explicit GlobalShortcut(v8::Isolate* isolate); explicit GlobalShortcut(v8::Isolate* isolate);

View file

@ -155,8 +155,8 @@ bool Menu::IsVisibleAt(int index) const {
// static // static
void Menu::BuildPrototype(v8::Isolate* isolate, void Menu::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable() .MakeDestroyable()
.SetMethod("insertItem", &Menu::InsertItemAt) .SetMethod("insertItem", &Menu::InsertItemAt)
.SetMethod("insertCheckItem", &Menu::InsertCheckItemAt) .SetMethod("insertCheckItem", &Menu::InsertCheckItemAt)

View file

@ -23,7 +23,7 @@ class Menu : public mate::TrackableObject<Menu>,
static mate::WrappableBase* New(mate::Arguments* args); static mate::WrappableBase* New(mate::Arguments* args);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
#if defined(OS_MACOSX) #if defined(OS_MACOSX)
// Set the global menubar. // Set the global menubar.

View file

@ -52,8 +52,8 @@ v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
// static // static
void PowerMonitor::BuildPrototype( void PowerMonitor::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype); mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate());
} }
} // namespace api } // namespace api

View file

@ -20,7 +20,7 @@ class PowerMonitor : public mate::TrackableObject<PowerMonitor>,
static v8::Local<v8::Value> Create(v8::Isolate* isolate); static v8::Local<v8::Value> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
explicit PowerMonitor(v8::Isolate* isolate); explicit PowerMonitor(v8::Isolate* isolate);

View file

@ -105,8 +105,8 @@ mate::Handle<PowerSaveBlocker> PowerSaveBlocker::Create(v8::Isolate* isolate) {
// static // static
void PowerSaveBlocker::BuildPrototype( void PowerSaveBlocker::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("start", &PowerSaveBlocker::Start) .SetMethod("start", &PowerSaveBlocker::Start)
.SetMethod("stop", &PowerSaveBlocker::Stop) .SetMethod("stop", &PowerSaveBlocker::Stop)
.SetMethod("isStarted", &PowerSaveBlocker::IsStarted); .SetMethod("isStarted", &PowerSaveBlocker::IsStarted);

View file

@ -25,7 +25,7 @@ class PowerSaveBlocker : public mate::TrackableObject<PowerSaveBlocker> {
static mate::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate); static mate::Handle<PowerSaveBlocker> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
explicit PowerSaveBlocker(v8::Isolate* isolate); explicit PowerSaveBlocker(v8::Isolate* isolate);

View file

@ -160,8 +160,8 @@ mate::Handle<Protocol> Protocol::Create(
// static // static
void Protocol::BuildPrototype( void Protocol::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("registerServiceWorkerSchemes", .SetMethod("registerServiceWorkerSchemes",
&Protocol::RegisterServiceWorkerSchemes) &Protocol::RegisterServiceWorkerSchemes)
.SetMethod("registerStringProtocol", .SetMethod("registerStringProtocol",

View file

@ -39,7 +39,7 @@ class Protocol : public mate::TrackableObject<Protocol> {
v8::Isolate* isolate, AtomBrowserContext* browser_context); v8::Isolate* isolate, AtomBrowserContext* browser_context);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context); Protocol(v8::Isolate* isolate, AtomBrowserContext* browser_context);

View file

@ -53,8 +53,8 @@ void RenderProcessPreferences::RemoveEntry(int id) {
// static // static
void RenderProcessPreferences::BuildPrototype( void RenderProcessPreferences::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("addEntry", &RenderProcessPreferences::AddEntry) .SetMethod("addEntry", &RenderProcessPreferences::AddEntry)
.SetMethod("removeEntry", &RenderProcessPreferences::RemoveEntry); .SetMethod("removeEntry", &RenderProcessPreferences::RemoveEntry);
} }

View file

@ -20,7 +20,7 @@ class RenderProcessPreferences
ForAllWebContents(v8::Isolate* isolate); ForAllWebContents(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
int AddEntry(const base::DictionaryValue& entry); int AddEntry(const base::DictionaryValue& entry);
void RemoveEntry(int id); void RemoveEntry(int id);

View file

@ -113,8 +113,8 @@ v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
// static // static
void Screen::BuildPrototype( void Screen::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("getCursorScreenPoint", &Screen::GetCursorScreenPoint) .SetMethod("getCursorScreenPoint", &Screen::GetCursorScreenPoint)
.SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay) .SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay)
.SetMethod("getAllDisplays", &Screen::GetAllDisplays) .SetMethod("getAllDisplays", &Screen::GetAllDisplays)

View file

@ -28,7 +28,7 @@ class Screen : public mate::EventEmitter<Screen>,
static v8::Local<v8::Value> Create(v8::Isolate* isolate); static v8::Local<v8::Value> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
Screen(v8::Isolate* isolate, display::Screen* screen); Screen(v8::Isolate* isolate, display::Screen* screen);

View file

@ -570,8 +570,8 @@ mate::Handle<Session> Session::FromPartition(
// static // static
void Session::BuildPrototype(v8::Isolate* isolate, void Session::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable() .MakeDestroyable()
.SetMethod("resolveProxy", &Session::ResolveProxy) .SetMethod("resolveProxy", &Session::ResolveProxy)
.SetMethod("getCacheSize", &Session::DoCacheAction<CacheAction::STATS>) .SetMethod("getCacheSize", &Session::DoCacheAction<CacheAction::STATS>)

View file

@ -57,7 +57,7 @@ class Session: public mate::TrackableObject<Session>,
// mate::TrackableObject: // mate::TrackableObject:
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
// Methods. // Methods.
void ResolveProxy(const GURL& url, ResolveProxyCallback callback); void ResolveProxy(const GURL& url, ResolveProxyCallback callback);

View file

@ -44,8 +44,8 @@ mate::Handle<SystemPreferences> SystemPreferences::Create(
// static // static
void SystemPreferences::BuildPrototype( void SystemPreferences::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
#if defined(OS_WIN) #if defined(OS_WIN)
.SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled) .SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled)
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)

View file

@ -24,7 +24,7 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences> {
static mate::Handle<SystemPreferences> Create(v8::Isolate* isolate); static mate::Handle<SystemPreferences> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
#if defined(OS_WIN) #if defined(OS_WIN)
bool IsAeroGlassEnabled(); bool IsAeroGlassEnabled();

View file

@ -201,8 +201,8 @@ gfx::Rect Tray::GetBounds() {
// static // static
void Tray::BuildPrototype(v8::Isolate* isolate, void Tray::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable() .MakeDestroyable()
.SetMethod("setImage", &Tray::SetImage) .SetMethod("setImage", &Tray::SetImage)
.SetMethod("setPressedImage", &Tray::SetPressedImage) .SetMethod("setPressedImage", &Tray::SetPressedImage)

View file

@ -39,7 +39,7 @@ class Tray : public mate::TrackableObject<Tray>,
mate::Arguments* args); mate::Arguments* args);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
Tray(v8::Isolate* isolate, v8::Local<v8::Object> wrapper, Tray(v8::Isolate* isolate, v8::Local<v8::Object> wrapper,

View file

@ -1364,8 +1364,8 @@ v8::Local<v8::Value> WebContents::Debugger(v8::Isolate* isolate) {
// static // static
void WebContents::BuildPrototype(v8::Isolate* isolate, void WebContents::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable() .MakeDestroyable()
.SetMethod("getId", &WebContents::GetID) .SetMethod("getId", &WebContents::GetID)
.SetMethod("equal", &WebContents::Equal) .SetMethod("equal", &WebContents::Equal)

View file

@ -63,7 +63,7 @@ class WebContents : public mate::TrackableObject<WebContents>,
v8::Isolate* isolate, const mate::Dictionary& options); v8::Isolate* isolate, const mate::Dictionary& options);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
int GetID() const; int GetID() const;
Type GetType() const; Type GetType() const;

View file

@ -88,8 +88,8 @@ mate::Handle<WebRequest> WebRequest::Create(
// static // static
void WebRequest::BuildPrototype(v8::Isolate* isolate, void WebRequest::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("onBeforeRequest", .SetMethod("onBeforeRequest",
&WebRequest::SetResponseListener< &WebRequest::SetResponseListener<
AtomNetworkDelegate::kOnBeforeRequest>) AtomNetworkDelegate::kOnBeforeRequest>)

View file

@ -22,7 +22,7 @@ class WebRequest : public mate::TrackableObject<WebRequest> {
AtomBrowserContext* browser_context); AtomBrowserContext* browser_context);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
protected: protected:
WebRequest(v8::Isolate* isolate, AtomBrowserContext* browser_context); WebRequest(v8::Isolate* isolate, AtomBrowserContext* browser_context);

View file

@ -746,8 +746,8 @@ void Window::RemoveFromParentChildWindows() {
// static // static
void Window::BuildPrototype(v8::Isolate* isolate, void Window::BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.MakeDestroyable() .MakeDestroyable()
.SetMethod("close", &Window::Close) .SetMethod("close", &Window::Close)
.SetMethod("focus", &Window::Focus) .SetMethod("focus", &Window::Focus)

View file

@ -43,7 +43,7 @@ class Window : public mate::TrackableObject<Window>,
static mate::WrappableBase* New(mate::Arguments* args); static mate::WrappableBase* New(mate::Arguments* args);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
// Returns the BrowserWindow object from |native_window|. // Returns the BrowserWindow object from |native_window|.
static v8::Local<v8::Value> From(v8::Isolate* isolate, static v8::Local<v8::Value> From(v8::Isolate* isolate,

View file

@ -58,8 +58,8 @@ Handle<Event> Event::Create(v8::Isolate* isolate) {
// static // static
void Event::BuildPrototype( void Event::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("preventDefault", &Event::PreventDefault) .SetMethod("preventDefault", &Event::PreventDefault)
.SetMethod("sendReply", &Event::SendReply); .SetMethod("sendReply", &Event::SendReply);
} }

View file

@ -21,7 +21,7 @@ class Event : public Wrappable<Event>,
static Handle<Event> Create(v8::Isolate* isolate); static Handle<Event> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
// Pass the sender and message to be replied. // Pass the sender and message to be replied.
void SetSenderAndMessage(content::WebContents* sender, IPC::Message* message); void SetSenderAndMessage(content::WebContents* sender, IPC::Message* message);

View file

@ -29,8 +29,8 @@ class Archive : public mate::Wrappable<Archive> {
} }
static void BuildPrototype( static void BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetProperty("path", &Archive::GetPath) .SetProperty("path", &Archive::GetPath)
.SetMethod("getFileInfo", &Archive::GetFileInfo) .SetMethod("getFileInfo", &Archive::GetFileInfo)
.SetMethod("stat", &Archive::Stat) .SetMethod("stat", &Archive::Stat)

View file

@ -22,8 +22,8 @@ class KeyWeakMap : public mate::Wrappable<KeyWeakMap<K>> {
} }
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype) { v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("set", &KeyWeakMap<K>::Set) .SetMethod("set", &KeyWeakMap<K>::Set)
.SetMethod("get", &KeyWeakMap<K>::Get) .SetMethod("get", &KeyWeakMap<K>::Get)
.SetMethod("has", &KeyWeakMap<K>::Has) .SetMethod("has", &KeyWeakMap<K>::Has)

View file

@ -355,8 +355,8 @@ mate::Handle<NativeImage> NativeImage::CreateFromDataURL(
// static // static
void NativeImage::BuildPrototype( void NativeImage::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("toPNG", &NativeImage::ToPNG) .SetMethod("toPNG", &NativeImage::ToPNG)
.SetMethod("toJPEG", &NativeImage::ToJPEG) .SetMethod("toJPEG", &NativeImage::ToJPEG)
.SetMethod("toBitmap", &NativeImage::ToBitmap) .SetMethod("toBitmap", &NativeImage::ToBitmap)

View file

@ -52,7 +52,7 @@ class NativeImage : public mate::Wrappable<NativeImage> {
v8::Isolate* isolate, const GURL& url); v8::Isolate* isolate, const GURL& url);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
#if defined(OS_WIN) #if defined(OS_WIN)
HICON GetHICON(int size); HICON GetHICON(int size);

View file

@ -187,8 +187,8 @@ void WebFrame::ClearCache(v8::Isolate* isolate) {
// static // static
void WebFrame::BuildPrototype( void WebFrame::BuildPrototype(
v8::Isolate* isolate, v8::Local<v8::ObjectTemplate> prototype) { v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
mate::ObjectTemplateBuilder(isolate, prototype) mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
.SetMethod("setName", &WebFrame::SetName) .SetMethod("setName", &WebFrame::SetName)
.SetMethod("setZoomLevel", &WebFrame::SetZoomLevel) .SetMethod("setZoomLevel", &WebFrame::SetZoomLevel)
.SetMethod("getZoomLevel", &WebFrame::GetZoomLevel) .SetMethod("getZoomLevel", &WebFrame::GetZoomLevel)

View file

@ -32,7 +32,7 @@ class WebFrame : public mate::Wrappable<WebFrame> {
static mate::Handle<WebFrame> Create(v8::Isolate* isolate); static mate::Handle<WebFrame> Create(v8::Isolate* isolate);
static void BuildPrototype(v8::Isolate* isolate, static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::ObjectTemplate> prototype); v8::Local<v8::FunctionTemplate> prototype);
private: private:
explicit WebFrame(v8::Isolate* isolate); explicit WebFrame(v8::Isolate* isolate);

2
vendor/native_mate vendored

@ -1 +1 @@
Subproject commit 3a7a6efffb4b3cd68967466cb1cab337509e3b07 Subproject commit 4dbe0514941b3e6176414d7ceccc90d364726c30