Browse Source

Pass FunctionTemplate in BuildPrototype

Cheng Zhao 8 years ago
parent
commit
cb19efe49c
47 changed files with 71 additions and 71 deletions
  1. 2 2
      atom/browser/api/atom_api_app.cc
  2. 1 1
      atom/browser/api/atom_api_app.h
  3. 2 2
      atom/browser/api/atom_api_auto_updater.cc
  4. 1 1
      atom/browser/api/atom_api_auto_updater.h
  5. 2 2
      atom/browser/api/atom_api_cookies.cc
  6. 1 1
      atom/browser/api/atom_api_cookies.h
  7. 2 2
      atom/browser/api/atom_api_debugger.cc
  8. 1 1
      atom/browser/api/atom_api_debugger.h
  9. 2 2
      atom/browser/api/atom_api_desktop_capturer.cc
  10. 1 1
      atom/browser/api/atom_api_desktop_capturer.h
  11. 2 2
      atom/browser/api/atom_api_download_item.cc
  12. 1 1
      atom/browser/api/atom_api_download_item.h
  13. 2 2
      atom/browser/api/atom_api_global_shortcut.cc
  14. 1 1
      atom/browser/api/atom_api_global_shortcut.h
  15. 2 2
      atom/browser/api/atom_api_menu.cc
  16. 1 1
      atom/browser/api/atom_api_menu.h
  17. 2 2
      atom/browser/api/atom_api_power_monitor.cc
  18. 1 1
      atom/browser/api/atom_api_power_monitor.h
  19. 2 2
      atom/browser/api/atom_api_power_save_blocker.cc
  20. 1 1
      atom/browser/api/atom_api_power_save_blocker.h
  21. 2 2
      atom/browser/api/atom_api_protocol.cc
  22. 1 1
      atom/browser/api/atom_api_protocol.h
  23. 2 2
      atom/browser/api/atom_api_render_process_preferences.cc
  24. 1 1
      atom/browser/api/atom_api_render_process_preferences.h
  25. 2 2
      atom/browser/api/atom_api_screen.cc
  26. 1 1
      atom/browser/api/atom_api_screen.h
  27. 2 2
      atom/browser/api/atom_api_session.cc
  28. 1 1
      atom/browser/api/atom_api_session.h
  29. 2 2
      atom/browser/api/atom_api_system_preferences.cc
  30. 1 1
      atom/browser/api/atom_api_system_preferences.h
  31. 2 2
      atom/browser/api/atom_api_tray.cc
  32. 1 1
      atom/browser/api/atom_api_tray.h
  33. 2 2
      atom/browser/api/atom_api_web_contents.cc
  34. 1 1
      atom/browser/api/atom_api_web_contents.h
  35. 2 2
      atom/browser/api/atom_api_web_request.cc
  36. 1 1
      atom/browser/api/atom_api_web_request.h
  37. 2 2
      atom/browser/api/atom_api_window.cc
  38. 1 1
      atom/browser/api/atom_api_window.h
  39. 2 2
      atom/browser/api/event.cc
  40. 1 1
      atom/browser/api/event.h
  41. 2 2
      atom/common/api/atom_api_asar.cc
  42. 2 2
      atom/common/api/atom_api_key_weak_map.h
  43. 2 2
      atom/common/api/atom_api_native_image.cc
  44. 1 1
      atom/common/api/atom_api_native_image.h
  45. 2 2
      atom/renderer/api/atom_api_web_frame.cc
  46. 1 1
      atom/renderer/api/atom_api_web_frame.h
  47. 1 1
      vendor/native_mate

+ 2 - 2
atom/browser/api/atom_api_app.cc

@@ -531,9 +531,9 @@ mate::Handle<App> App::Create(v8::Isolate* isolate) {
 
 // static
 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());
-  mate::ObjectTemplateBuilder(isolate, prototype)
+  mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("quit", base::Bind(&Browser::Quit, browser))
       .SetMethod("exit", base::Bind(&Browser::Exit, browser))
       .SetMethod("focus", base::Bind(&Browser::Focus, browser))

+ 1 - 1
atom/browser/api/atom_api_app.h

@@ -40,7 +40,7 @@ class App : public AtomBrowserClient::Delegate,
   static mate::Handle<App> Create(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.
   void OnCreateWindow(const GURL& target_url,

+ 2 - 2
atom/browser/api/atom_api_auto_updater.cc

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

+ 1 - 1
atom/browser/api/atom_api_auto_updater.h

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

+ 2 - 2
atom/browser/api/atom_api_cookies.cc

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

+ 1 - 1
atom/browser/api/atom_api_cookies.h

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

+ 2 - 2
atom/browser/api/atom_api_debugger.cc

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

+ 1 - 1
atom/browser/api/atom_api_debugger.h

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

+ 2 - 2
atom/browser/api/atom_api_desktop_capturer.cc

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

+ 1 - 1
atom/browser/api/atom_api_desktop_capturer.h

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

+ 2 - 2
atom/browser/api/atom_api_download_item.cc

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

+ 1 - 1
atom/browser/api/atom_api_download_item.h

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

+ 2 - 2
atom/browser/api/atom_api_global_shortcut.cc

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

+ 1 - 1
atom/browser/api/atom_api_global_shortcut.h

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

+ 2 - 2
atom/browser/api/atom_api_menu.cc

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

+ 1 - 1
atom/browser/api/atom_api_menu.h

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

+ 2 - 2
atom/browser/api/atom_api_power_monitor.cc

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

+ 1 - 1
atom/browser/api/atom_api_power_monitor.h

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

+ 2 - 2
atom/browser/api/atom_api_power_save_blocker.cc

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

+ 1 - 1
atom/browser/api/atom_api_power_save_blocker.h

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

+ 2 - 2
atom/browser/api/atom_api_protocol.cc

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

+ 1 - 1
atom/browser/api/atom_api_protocol.h

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

+ 2 - 2
atom/browser/api/atom_api_render_process_preferences.cc

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

+ 1 - 1
atom/browser/api/atom_api_render_process_preferences.h

@@ -20,7 +20,7 @@ class RenderProcessPreferences
       ForAllWebContents(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);
   void RemoveEntry(int id);

+ 2 - 2
atom/browser/api/atom_api_screen.cc

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

+ 1 - 1
atom/browser/api/atom_api_screen.h

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

+ 2 - 2
atom/browser/api/atom_api_session.cc

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

+ 1 - 1
atom/browser/api/atom_api_session.h

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

+ 2 - 2
atom/browser/api/atom_api_system_preferences.cc

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

+ 1 - 1
atom/browser/api/atom_api_system_preferences.h

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

+ 2 - 2
atom/browser/api/atom_api_tray.cc

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

+ 1 - 1
atom/browser/api/atom_api_tray.h

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

+ 2 - 2
atom/browser/api/atom_api_web_contents.cc

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

+ 1 - 1
atom/browser/api/atom_api_web_contents.h

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

+ 2 - 2
atom/browser/api/atom_api_web_request.cc

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

+ 1 - 1
atom/browser/api/atom_api_web_request.h

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

+ 2 - 2
atom/browser/api/atom_api_window.cc

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

+ 1 - 1
atom/browser/api/atom_api_window.h

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

+ 2 - 2
atom/browser/api/event.cc

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

+ 1 - 1
atom/browser/api/event.h

@@ -21,7 +21,7 @@ class Event : public Wrappable<Event>,
   static Handle<Event> Create(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.
   void SetSenderAndMessage(content::WebContents* sender, IPC::Message* message);

+ 2 - 2
atom/common/api/atom_api_asar.cc

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

+ 2 - 2
atom/common/api/atom_api_key_weak_map.h

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

+ 2 - 2
atom/common/api/atom_api_native_image.cc

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

+ 1 - 1
atom/common/api/atom_api_native_image.h

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

+ 2 - 2
atom/renderer/api/atom_api_web_frame.cc

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

+ 1 - 1
atom/renderer/api/atom_api_web_frame.h

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

+ 1 - 1
vendor/native_mate

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