Every native class now gets a name
authorCheng Zhao <zcbenz@gmail.com>
Tue, 2 Aug 2016 10:28:12 +0000 (19:28 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Tue, 2 Aug 2016 10:28:12 +0000 (19:28 +0900)
25 files changed:
atom/browser/api/atom_api_app.cc
atom/browser/api/atom_api_auto_updater.cc
atom/browser/api/atom_api_cookies.cc
atom/browser/api/atom_api_debugger.cc
atom/browser/api/atom_api_desktop_capturer.cc
atom/browser/api/atom_api_download_item.cc
atom/browser/api/atom_api_global_shortcut.cc
atom/browser/api/atom_api_menu.cc
atom/browser/api/atom_api_power_monitor.cc
atom/browser/api/atom_api_power_save_blocker.cc
atom/browser/api/atom_api_protocol.cc
atom/browser/api/atom_api_render_process_preferences.cc
atom/browser/api/atom_api_screen.cc
atom/browser/api/atom_api_session.cc
atom/browser/api/atom_api_system_preferences.cc
atom/browser/api/atom_api_tray.cc
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_request.cc
atom/browser/api/atom_api_window.cc
atom/browser/api/event.cc
atom/common/api/atom_api_asar.cc
atom/common/api/atom_api_key_weak_map.h
atom/common/api/atom_api_native_image.cc
atom/renderer/api/atom_api_web_frame.cc
vendor/native_mate

index fb3655c..3851fcf 100644 (file)
@@ -532,6 +532,7 @@ mate::Handle<App> App::Create(v8::Isolate* isolate) {
 // static
 void App::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "App"));
   auto browser = base::Unretained(Browser::Get());
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("quit", base::Bind(&Browser::Quit, browser))
index ed1193d..0908911 100644 (file)
@@ -107,6 +107,7 @@ mate::Handle<AutoUpdater> AutoUpdater::Create(v8::Isolate* isolate) {
 // static
 void AutoUpdater::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "AutoUpdater"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("checkForUpdates", &auto_updater::AutoUpdater::CheckForUpdates)
       .SetMethod("getFeedURL", &auto_updater::AutoUpdater::GetFeedURL)
index 0f1fb33..86cc598 100644 (file)
@@ -249,6 +249,7 @@ mate::Handle<Cookies> Cookies::Create(
 // static
 void Cookies::BuildPrototype(v8::Isolate* isolate,
                              v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Cookies"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("get", &Cookies::Get)
       .SetMethod("remove", &Cookies::Remove)
index f867adb..dea70b2 100644 (file)
@@ -160,6 +160,7 @@ mate::Handle<Debugger> Debugger::Create(
 // static
 void Debugger::BuildPrototype(v8::Isolate* isolate,
                               v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Debugger"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("attach", &Debugger::Attach)
       .SetMethod("isAttached", &Debugger::IsAttached)
index 053efbd..1ff5aad 100644 (file)
@@ -100,6 +100,7 @@ mate::Handle<DesktopCapturer> DesktopCapturer::Create(v8::Isolate* isolate) {
 // static
 void DesktopCapturer::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "DesktopCapturer"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("startHandling", &DesktopCapturer::StartHandling);
 }
index 1a3a9ec..5c7ea07 100644 (file)
@@ -168,6 +168,7 @@ base::FilePath DownloadItem::GetSavePath() const {
 // static
 void DownloadItem::BuildPrototype(v8::Isolate* isolate,
                                   v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "DownloadItem"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("pause", &DownloadItem::Pause)
index 7ed8265..039d708 100644 (file)
@@ -75,6 +75,7 @@ mate::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) {
 // static
 void GlobalShortcut::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "GlobalShortcut"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("register", &GlobalShortcut::Register)
       .SetMethod("isRegistered", &GlobalShortcut::IsRegistered)
index 8150fee..627ce60 100644 (file)
@@ -156,6 +156,7 @@ bool Menu::IsVisibleAt(int index) const {
 // static
 void Menu::BuildPrototype(v8::Isolate* isolate,
                           v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Menu"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("insertItem", &Menu::InsertItemAt)
@@ -190,7 +191,7 @@ using atom::api::Menu;
 void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
                 v8::Local<v8::Context> context, void* priv) {
   v8::Isolate* isolate = context->GetIsolate();
-  Menu::SetConstructor(isolate, "Menu", base::Bind(&Menu::New));
+  Menu::SetConstructor(isolate, base::Bind(&Menu::New));
 
   mate::Dictionary dict(isolate, exports);
   dict.Set("Menu", Menu::GetConstructor(isolate)->GetFunction());
index 06ab986..51d078b 100644 (file)
@@ -53,7 +53,7 @@ v8::Local<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) {
 // static
 void PowerMonitor::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
-  mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate());
+  prototype->SetClassName(mate::StringToV8(isolate, "PowerMonitor"));
 }
 
 }  // namespace api
index 7aa079c..0f017be 100644 (file)
@@ -106,6 +106,7 @@ mate::Handle<PowerSaveBlocker> PowerSaveBlocker::Create(v8::Isolate* isolate) {
 // static
 void PowerSaveBlocker::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "PowerSaveBlocker"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("start", &PowerSaveBlocker::Start)
       .SetMethod("stop", &PowerSaveBlocker::Stop)
index c081c13..eaed0c6 100644 (file)
@@ -161,6 +161,7 @@ mate::Handle<Protocol> Protocol::Create(
 // static
 void Protocol::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Protocol"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("registerServiceWorkerSchemes",
                  &Protocol::RegisterServiceWorkerSchemes)
index 5f57763..d501712 100644 (file)
@@ -54,6 +54,8 @@ void RenderProcessPreferences::RemoveEntry(int id) {
 // static
 void RenderProcessPreferences::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(
+      mate::StringToV8(isolate, "RenderProcessPreferences"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("addEntry", &RenderProcessPreferences::AddEntry)
       .SetMethod("removeEntry", &RenderProcessPreferences::RemoveEntry);
index 56e49ab..eabfc18 100644 (file)
@@ -114,6 +114,7 @@ v8::Local<v8::Value> Screen::Create(v8::Isolate* isolate) {
 // static
 void Screen::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Screen"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("getCursorScreenPoint", &Screen::GetCursorScreenPoint)
       .SetMethod("getPrimaryDisplay", &Screen::GetPrimaryDisplay)
index f483980..25eca3b 100644 (file)
@@ -571,6 +571,7 @@ mate::Handle<Session> Session::FromPartition(
 // static
 void Session::BuildPrototype(v8::Isolate* isolate,
                              v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Session"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("resolveProxy", &Session::ResolveProxy)
index a7fca68..df66234 100644 (file)
@@ -45,6 +45,7 @@ mate::Handle<SystemPreferences> SystemPreferences::Create(
 // static
 void SystemPreferences::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "SystemPreferences"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
 #if defined(OS_WIN)
       .SetMethod("isAeroGlassEnabled", &SystemPreferences::IsAeroGlassEnabled)
index 051b7b2..3f0386a 100644 (file)
@@ -202,6 +202,7 @@ gfx::Rect Tray::GetBounds() {
 // static
 void Tray::BuildPrototype(v8::Isolate* isolate,
                           v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Tray"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("setImage", &Tray::SetImage)
@@ -227,7 +228,7 @@ using atom::api::Tray;
 void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
                 v8::Local<v8::Context> context, void* priv) {
   v8::Isolate* isolate = context->GetIsolate();
-  Tray::SetConstructor(isolate, "Tray", base::Bind(&Tray::New));
+  Tray::SetConstructor(isolate, base::Bind(&Tray::New));
 
   mate::Dictionary dict(isolate, exports);
   dict.Set("Tray", Tray::GetConstructor(isolate)->GetFunction());
index 2a83072..bb73e04 100644 (file)
@@ -1365,6 +1365,7 @@ v8::Local<v8::Value> WebContents::Debugger(v8::Isolate* isolate) {
 // static
 void WebContents::BuildPrototype(v8::Isolate* isolate,
                                  v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "WebContents"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("getId", &WebContents::GetID)
index 11ba39c..2a39347 100644 (file)
@@ -89,6 +89,7 @@ mate::Handle<WebRequest> WebRequest::Create(
 // static
 void WebRequest::BuildPrototype(v8::Isolate* isolate,
                                 v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "WebRequest"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("onBeforeRequest",
                  &WebRequest::SetResponseListener<
index a013b4e..bb78b37 100644 (file)
@@ -747,6 +747,7 @@ void Window::RemoveFromParentChildWindows() {
 // static
 void Window::BuildPrototype(v8::Isolate* isolate,
                             v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "BrowserWindow"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .MakeDestroyable()
       .SetMethod("close", &Window::Close)
@@ -869,7 +870,7 @@ using atom::api::Window;
 void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused,
                 v8::Local<v8::Context> context, void* priv) {
   v8::Isolate* isolate = context->GetIsolate();
-  Window::SetConstructor(isolate, "BrowserWindow", base::Bind(&Window::New));
+  Window::SetConstructor(isolate, base::Bind(&Window::New));
 
   mate::Dictionary browser_window(
       isolate, Window::GetConstructor(isolate)->GetFunction());
index 874e30f..8810fed 100644 (file)
@@ -59,6 +59,7 @@ Handle<Event> Event::Create(v8::Isolate* isolate) {
 // static
 void Event::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "Event"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("preventDefault", &Event::PreventDefault)
       .SetMethod("sendReply", &Event::SendReply);
index 0890368..012d8f3 100644 (file)
@@ -30,6 +30,7 @@ class Archive : public mate::Wrappable<Archive> {
 
   static void BuildPrototype(
       v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+    prototype->SetClassName(mate::StringToV8(isolate, "Archive"));
     mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
         .SetProperty("path", &Archive::GetPath)
         .SetMethod("getFileInfo", &Archive::GetFileInfo)
index b6549e2..743b719 100644 (file)
@@ -23,6 +23,7 @@ class KeyWeakMap : public mate::Wrappable<KeyWeakMap<K>> {
 
   static void BuildPrototype(v8::Isolate* isolate,
                              v8::Local<v8::FunctionTemplate> prototype) {
+    prototype->SetClassName(mate::StringToV8(isolate, "KeyWeakMap"));
     mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
         .SetMethod("set", &KeyWeakMap<K>::Set)
         .SetMethod("get", &KeyWeakMap<K>::Get)
index d135e99..bd97ea3 100644 (file)
@@ -356,6 +356,7 @@ mate::Handle<NativeImage> NativeImage::CreateFromDataURL(
 // static
 void NativeImage::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "NativeImage"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("toPNG", &NativeImage::ToPNG)
       .SetMethod("toJPEG", &NativeImage::ToJPEG)
index 1c88b53..7c6bed9 100644 (file)
@@ -188,6 +188,7 @@ void WebFrame::ClearCache(v8::Isolate* isolate) {
 // static
 void WebFrame::BuildPrototype(
     v8::Isolate* isolate, v8::Local<v8::FunctionTemplate> prototype) {
+  prototype->SetClassName(mate::StringToV8(isolate, "WebFrame"));
   mate::ObjectTemplateBuilder(isolate, prototype->PrototypeTemplate())
       .SetMethod("setName", &WebFrame::SetName)
       .SetMethod("setZoomLevel", &WebFrame::SetZoomLevel)
index 4dbe051..fa483e1 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4dbe0514941b3e6176414d7ceccc90d364726c30
+Subproject commit fa483e1fe012f873ad9812a67a66e2b7dbb570c6