From d78efe7c224624d1071fcedc081b55e9904b3767 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 22 May 2015 19:11:22 +0800 Subject: [PATCH] Use Local instead of Handle --- atom/browser/api/atom_api_app.cc | 6 ++--- atom/browser/api/atom_api_auto_updater.cc | 4 ++-- atom/browser/api/atom_api_content_tracing.cc | 8 +++---- atom/browser/api/atom_api_dialog.cc | 12 +++++----- atom/browser/api/atom_api_global_shortcut.cc | 4 ++-- atom/browser/api/atom_api_menu.cc | 10 ++++---- atom/browser/api/atom_api_menu.h | 4 ++-- atom/browser/api/atom_api_power_monitor.cc | 6 ++--- atom/browser/api/atom_api_power_monitor.h | 2 +- atom/browser/api/atom_api_protocol.cc | 12 +++++----- atom/browser/api/atom_api_protocol.h | 2 +- atom/browser/api/atom_api_screen.cc | 6 ++--- atom/browser/api/atom_api_screen.h | 2 +- atom/browser/api/atom_api_tray.cc | 10 ++++---- atom/browser/api/atom_api_tray.h | 2 +- atom/browser/api/atom_api_web_contents.cc | 4 ++-- atom/browser/api/atom_api_web_view_manager.cc | 8 +++---- atom/browser/api/atom_api_window.cc | 10 ++++---- atom/browser/api/atom_api_window.h | 4 ++-- atom/browser/api/event_emitter.cc | 4 ++-- atom/browser/api/event_emitter.h | 2 +- atom/common/api/atom_api_asar.cc | 24 +++++++++---------- atom/common/api/atom_api_clipboard.cc | 6 ++--- atom/common/api/atom_api_crash_reporter.cc | 12 +++++----- atom/common/api/atom_api_id_weak_map.cc | 10 ++++---- atom/common/api/atom_api_id_weak_map.h | 6 ++--- atom/common/api/atom_api_native_image.cc | 10 ++++---- atom/common/api/atom_api_native_image.h | 6 ++--- atom/common/api/atom_api_shell.cc | 4 ++-- atom/common/api/atom_api_v8_util.cc | 24 +++++++++---------- atom/common/api/atom_bindings.cc | 2 +- atom/common/api/atom_bindings.h | 2 +- atom/common/api/object_life_monitor.cc | 4 ++-- atom/common/api/object_life_monitor.h | 4 ++-- .../accelerator_converter.cc | 2 +- .../accelerator_converter.h | 2 +- .../file_path_converter.h | 4 ++-- .../native_mate_converters/gfx_converter.cc | 16 ++++++------- .../native_mate_converters/gfx_converter.h | 16 ++++++------- .../native_mate_converters/gurl_converter.h | 4 ++-- .../native_mate_converters/image_converter.cc | 6 ++--- .../native_mate_converters/image_converter.h | 6 ++--- .../string16_converter.h | 4 ++-- .../v8_value_converter.cc | 8 +++---- .../v8_value_converter.h | 4 ++-- .../native_mate_converters/value_converter.cc | 6 ++--- .../native_mate_converters/value_converter.h | 6 ++--- atom/renderer/api/atom_api_renderer_ipc.cc | 4 ++-- .../api/atom_api_spell_check_client.cc | 6 ++--- .../api/atom_api_spell_check_client.h | 2 +- atom/renderer/api/atom_api_web_frame.cc | 12 +++++----- atom/renderer/api/atom_api_web_frame.h | 6 ++--- atom/renderer/atom_render_view_observer.cc | 18 +++++++------- vendor/native_mate | 2 +- 54 files changed, 185 insertions(+), 185 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index d3b04f043622..27178b389409 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -42,7 +42,7 @@ namespace mate { #if defined(OS_WIN) template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, Browser::UserTask* out) { mate::Dictionary dict; if (!ConvertFromV8(isolate, val, &dict)) @@ -277,8 +277,8 @@ void DockSetMenu(atom::api::Menu* menu) { } #endif -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); auto command_line = base::CommandLine::ForCurrentProcess(); diff --git a/atom/browser/api/atom_api_auto_updater.cc b/atom/browser/api/atom_api_auto_updater.cc index bf52c310b72a..1691ac103e96 100644 --- a/atom/browser/api/atom_api_auto_updater.cc +++ b/atom/browser/api/atom_api_auto_updater.cc @@ -77,8 +77,8 @@ mate::Handle AutoUpdater::Create(v8::Isolate* isolate) { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("autoUpdater", atom::api::AutoUpdater::Create(isolate)); diff --git a/atom/browser/api/atom_api_content_tracing.cc b/atom/browser/api/atom_api_content_tracing.cc index a3299e447a8f..6da450185cd7 100644 --- a/atom/browser/api/atom_api_content_tracing.cc +++ b/atom/browser/api/atom_api_content_tracing.cc @@ -20,7 +20,7 @@ namespace mate { template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::trace_event::CategoryFilter* out) { std::string filter; if (!ConvertFromV8(isolate, val, &filter)) @@ -33,7 +33,7 @@ struct Converter { template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::trace_event::TraceOptions* out) { std::string options; if (!ConvertFromV8(isolate, val, &options)) @@ -46,8 +46,8 @@ struct Converter { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { auto controller = base::Unretained(TracingController::GetInstance()); mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("getCategories", base::Bind( diff --git a/atom/browser/api/atom_api_dialog.cc b/atom/browser/api/atom_api_dialog.cc index 5834b73e6b6d..02d820bdeb5f 100644 --- a/atom/browser/api/atom_api_dialog.cc +++ b/atom/browser/api/atom_api_dialog.cc @@ -22,7 +22,7 @@ namespace mate { template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, file_dialog::Filter* out) { mate::Dictionary dict; if (!ConvertFromV8(isolate, val, &dict)) @@ -52,7 +52,7 @@ void ShowMessageBox(int type, const std::string& message = texts[1]; const std::string& detail = texts[2]; - v8::Handle peek = args->PeekNext(); + v8::Local peek = args->PeekNext(); atom::MessageBoxCallback callback; if (mate::Converter::FromV8(args->isolate(), peek, @@ -72,7 +72,7 @@ void ShowOpenDialog(const std::string& title, int properties, atom::NativeWindow* window, mate::Arguments* args) { - v8::Handle peek = args->PeekNext(); + v8::Local peek = args->PeekNext(); file_dialog::OpenDialogCallback callback; if (mate::Converter::FromV8(args->isolate(), peek, @@ -92,7 +92,7 @@ void ShowSaveDialog(const std::string& title, const file_dialog::Filters& filters, atom::NativeWindow* window, mate::Arguments* args) { - v8::Handle peek = args->PeekNext(); + v8::Local peek = args->PeekNext(); file_dialog::SaveDialogCallback callback; if (mate::Converter::FromV8(args->isolate(), peek, @@ -106,8 +106,8 @@ void ShowSaveDialog(const std::string& title, } } -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("showMessageBox", &ShowMessageBox); dict.SetMethod("showErrorBox", &atom::ShowErrorBox); diff --git a/atom/browser/api/atom_api_global_shortcut.cc b/atom/browser/api/atom_api_global_shortcut.cc index c30873379746..47bebe9d12bd 100644 --- a/atom/browser/api/atom_api_global_shortcut.cc +++ b/atom/browser/api/atom_api_global_shortcut.cc @@ -86,8 +86,8 @@ mate::Handle GlobalShortcut::Create(v8::Isolate* isolate) { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("globalShortcut", atom::api::GlobalShortcut::Create(isolate)); diff --git a/atom/browser/api/atom_api_menu.cc b/atom/browser/api/atom_api_menu.cc index 010d0414d9a9..c0bfff3f050c 100644 --- a/atom/browser/api/atom_api_menu.cc +++ b/atom/browser/api/atom_api_menu.cc @@ -58,7 +58,7 @@ bool Menu::GetAcceleratorForCommandId(int command_id, v8::Isolate* isolate = v8::Isolate::GetCurrent(); v8::Locker locker(isolate); v8::HandleScope handle_scope(isolate); - v8::Handle val = get_accelerator_.Run(command_id); + v8::Local val = get_accelerator_.Run(command_id); return mate::ConvertFromV8(isolate, val, accelerator); } @@ -150,7 +150,7 @@ bool Menu::IsVisibleAt(int index) const { // static void Menu::BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype) { + v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) .SetMethod("insertItem", &Menu::InsertItemAt) .SetMethod("insertCheckItem", &Menu::InsertCheckItemAt) @@ -180,14 +180,14 @@ void Menu::BuildPrototype(v8::Isolate* isolate, namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { using atom::api::Menu; v8::Isolate* isolate = context->GetIsolate(); v8::Local constructor = mate::CreateConstructor( isolate, "Menu", base::Bind(&Menu::Create)); mate::Dictionary dict(isolate, exports); - dict.Set("Menu", static_cast>(constructor)); + dict.Set("Menu", static_cast>(constructor)); #if defined(OS_MACOSX) dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu); dict.SetMethod("sendActionToFirstResponder", diff --git a/atom/browser/api/atom_api_menu.h b/atom/browser/api/atom_api_menu.h index 830c5d0c6465..37e544a82e09 100644 --- a/atom/browser/api/atom_api_menu.h +++ b/atom/browser/api/atom_api_menu.h @@ -23,7 +23,7 @@ class Menu : public mate::Wrappable, static mate::Wrappable* Create(); static void BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype); + v8::Local prototype); #if defined(OS_MACOSX) // Set the global menubar. @@ -88,7 +88,7 @@ class Menu : public mate::Wrappable, base::Callback is_checked_; base::Callback is_enabled_; base::Callback is_visible_; - base::Callback(int)> get_accelerator_; + base::Callback(int)> get_accelerator_; base::Callback execute_command_; base::Callback menu_will_show_; diff --git a/atom/browser/api/atom_api_power_monitor.cc b/atom/browser/api/atom_api_power_monitor.cc index 8f87eec07280..afdebfcf7f2f 100644 --- a/atom/browser/api/atom_api_power_monitor.cc +++ b/atom/browser/api/atom_api_power_monitor.cc @@ -39,7 +39,7 @@ void PowerMonitor::OnResume() { } // static -v8::Handle PowerMonitor::Create(v8::Isolate* isolate) { +v8::Local PowerMonitor::Create(v8::Isolate* isolate) { if (!Browser::Get()->is_ready()) { node::ThrowError("Cannot initialize \"power-monitor\" module" "before app is ready"); @@ -56,8 +56,8 @@ v8::Handle PowerMonitor::Create(v8::Isolate* isolate) { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { #if defined(OS_MACOSX) base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); #endif diff --git a/atom/browser/api/atom_api_power_monitor.h b/atom/browser/api/atom_api_power_monitor.h index cdd14ff6e859..dcf0906b437f 100644 --- a/atom/browser/api/atom_api_power_monitor.h +++ b/atom/browser/api/atom_api_power_monitor.h @@ -17,7 +17,7 @@ namespace api { class PowerMonitor : public mate::EventEmitter, public base::PowerObserver { public: - static v8::Handle Create(v8::Isolate* isolate); + static v8::Local Create(v8::Isolate* isolate); protected: PowerMonitor(); diff --git a/atom/browser/api/atom_api_protocol.cc b/atom/browser/api/atom_api_protocol.cc index 8a7e0ae6840a..0d56a6fb1c49 100644 --- a/atom/browser/api/atom_api_protocol.cc +++ b/atom/browser/api/atom_api_protocol.cc @@ -21,7 +21,7 @@ namespace mate { template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const net::URLRequest* val) { return mate::ObjectTemplateBuilder(isolate) .SetValue("method", val->method()) @@ -63,7 +63,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob { // Call the JS handler. Protocol::JsProtocolHandler callback = registry_->GetProtocolHandler(request()->url().scheme()); - v8::Handle result = callback.Run(request()); + v8::Local result = callback.Run(request()); // Determine the type of the job we are going to create. if (result->IsString()) { @@ -73,7 +73,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob { GetWeakPtr(), "text/plain", "UTF-8", data)); return; } else if (result->IsObject()) { - v8::Handle obj = result->ToObject(); + v8::Local obj = result->ToObject(); mate::Dictionary dict(isolate, obj); std::string name = mate::V8ToString(obj->GetConstructorName()); if (name == "RequestStringJob") { @@ -88,7 +88,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob { return; } else if (name == "RequestBufferJob") { std::string mime_type, encoding; - v8::Handle buffer; + v8::Local buffer; dict.Get("mimeType", &mime_type); dict.Get("encoding", &encoding); dict.Get("data", &buffer); @@ -339,8 +339,8 @@ mate::Handle Protocol::Create(v8::Isolate* isolate) { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("protocol", atom::api::Protocol::Create(isolate)); diff --git a/atom/browser/api/atom_api_protocol.h b/atom/browser/api/atom_api_protocol.h index 03a6deb847a1..deef277333b5 100644 --- a/atom/browser/api/atom_api_protocol.h +++ b/atom/browser/api/atom_api_protocol.h @@ -24,7 +24,7 @@ namespace api { class Protocol : public mate::EventEmitter { public: - typedef base::Callback(const net::URLRequest*)> + typedef base::Callback(const net::URLRequest*)> JsProtocolHandler; static mate::Handle Create(v8::Isolate* isolate); diff --git a/atom/browser/api/atom_api_screen.cc b/atom/browser/api/atom_api_screen.cc index 3d2e46472472..c042cc3f1f08 100644 --- a/atom/browser/api/atom_api_screen.cc +++ b/atom/browser/api/atom_api_screen.cc @@ -111,7 +111,7 @@ mate::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder( } // static -v8::Handle Screen::Create(v8::Isolate* isolate) { +v8::Local Screen::Create(v8::Isolate* isolate) { if (!Browser::Get()->is_ready()) { node::ThrowError("Cannot initialize \"screen\" module before app is ready"); return v8::Null(isolate); @@ -132,8 +132,8 @@ v8::Handle Screen::Create(v8::Isolate* isolate) { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.Set("screen", atom::api::Screen::Create(context->GetIsolate())); } diff --git a/atom/browser/api/atom_api_screen.h b/atom/browser/api/atom_api_screen.h index 5a81f3d67057..f724130fa7fc 100644 --- a/atom/browser/api/atom_api_screen.h +++ b/atom/browser/api/atom_api_screen.h @@ -24,7 +24,7 @@ namespace api { class Screen : public mate::EventEmitter, public gfx::DisplayObserver { public: - static v8::Handle Create(v8::Isolate* isolate); + static v8::Local Create(v8::Isolate* isolate); protected: explicit Screen(gfx::Screen* screen); diff --git a/atom/browser/api/atom_api_tray.cc b/atom/browser/api/atom_api_tray.cc index b66d95cb0732..6d7a9e5dedbd 100644 --- a/atom/browser/api/atom_api_tray.cc +++ b/atom/browser/api/atom_api_tray.cc @@ -128,7 +128,7 @@ bool Tray::CheckTrayLife(mate::Arguments* args) { // static void Tray::BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype) { + v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) .SetMethod("destroy", &Tray::Destroy) .SetMethod("setImage", &Tray::SetImage) @@ -147,14 +147,14 @@ void Tray::BuildPrototype(v8::Isolate* isolate, namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { using atom::api::Tray; v8::Isolate* isolate = context->GetIsolate(); - v8::Handle constructor = mate::CreateConstructor( + v8::Local constructor = mate::CreateConstructor( isolate, "Tray", base::Bind(&Tray::New)); mate::Dictionary dict(isolate, exports); - dict.Set("Tray", static_cast>(constructor)); + dict.Set("Tray", static_cast>(constructor)); } } // namespace diff --git a/atom/browser/api/atom_api_tray.h b/atom/browser/api/atom_api_tray.h index 5ed29ecd74f1..9fe3513094d8 100644 --- a/atom/browser/api/atom_api_tray.h +++ b/atom/browser/api/atom_api_tray.h @@ -34,7 +34,7 @@ class Tray : public mate::EventEmitter, static mate::Wrappable* New(const gfx::Image& image); static void BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype); + v8::Local prototype); protected: explicit Tray(const gfx::Image& image); diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 1f3afb582710..441bb2408eb4 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -751,8 +751,8 @@ mate::Handle WebContents::Create( namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.SetMethod("create", &atom::api::WebContents::Create); diff --git a/atom/browser/api/atom_api_web_view_manager.cc b/atom/browser/api/atom_api_web_view_manager.cc index ed796be8e83f..d77ea18d6d0c 100644 --- a/atom/browser/api/atom_api_web_view_manager.cc +++ b/atom/browser/api/atom_api_web_view_manager.cc @@ -15,7 +15,7 @@ namespace mate { template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, content::WebContents** out) { atom::api::WebContents* contents; if (!Converter::FromV8(isolate, val, &contents)) @@ -27,7 +27,7 @@ struct Converter { template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, atom::WebViewManager::WebViewInfo* out) { Dictionary options; if (!ConvertFromV8(isolate, val, &options)) @@ -81,8 +81,8 @@ void RemoveGuest(content::WebContents* embedder, int guest_instance_id) { manager->RemoveGuest(guest_instance_id); } -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("addGuest", &AddGuest); dict.SetMethod("removeGuest", &RemoveGuest); diff --git a/atom/browser/api/atom_api_window.cc b/atom/browser/api/atom_api_window.cc index 252c8f920354..99df40845e7c 100644 --- a/atom/browser/api/atom_api_window.cc +++ b/atom/browser/api/atom_api_window.cc @@ -32,7 +32,7 @@ namespace mate { template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, PrintSettings* out) { mate::Dictionary dict; if (!ConvertFromV8(isolate, val, &dict)) @@ -462,7 +462,7 @@ mate::Handle Window::GetDevToolsWebContents( // static void Window::BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype) { + v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) .SetMethod("destroy", &Window::Destroy) .SetMethod("close", &Window::Close) @@ -542,14 +542,14 @@ void Window::BuildPrototype(v8::Isolate* isolate, namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { using atom::api::Window; v8::Isolate* isolate = context->GetIsolate(); v8::Local constructor = mate::CreateConstructor( isolate, "BrowserWindow", base::Bind(&Window::New)); mate::Dictionary dict(isolate, exports); - dict.Set("BrowserWindow", static_cast>(constructor)); + dict.Set("BrowserWindow", static_cast>(constructor)); } } // namespace diff --git a/atom/browser/api/atom_api_window.h b/atom/browser/api/atom_api_window.h index 8aa1ed0988dc..e3b48cf9651f 100644 --- a/atom/browser/api/atom_api_window.h +++ b/atom/browser/api/atom_api_window.h @@ -40,7 +40,7 @@ class Window : public mate::EventEmitter, const mate::Dictionary& options); static void BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype); + v8::Local prototype); NativeWindow* window() const { return window_.get(); } @@ -160,7 +160,7 @@ namespace mate { template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, atom::NativeWindow** out) { // null would be tranfered to NULL. if (val->IsNull()) { diff --git a/atom/browser/api/event_emitter.cc b/atom/browser/api/event_emitter.cc index 87ab69a16f83..7fdcfa138c74 100644 --- a/atom/browser/api/event_emitter.cc +++ b/atom/browser/api/event_emitter.cc @@ -43,13 +43,13 @@ bool EventEmitter::CallEmit(v8::Isolate* isolate, content::WebContents* sender, IPC::Message* message, ValueArray args) { - v8::Handle event; + v8::Local event; bool use_native_event = sender && message; if (use_native_event) { mate::Handle native_event = mate::Event::Create(isolate); native_event->SetSenderAndMessage(sender, message); - event = v8::Handle::Cast(native_event.ToV8()); + event = v8::Local::Cast(native_event.ToV8()); } else { event = CreateEventObject(isolate); } diff --git a/atom/browser/api/event_emitter.h b/atom/browser/api/event_emitter.h index 854076044bde..3809407138a1 100644 --- a/atom/browser/api/event_emitter.h +++ b/atom/browser/api/event_emitter.h @@ -22,7 +22,7 @@ namespace mate { // Provide helperers to emit event in JavaScript. class EventEmitter : public Wrappable { public: - typedef std::vector> ValueArray; + typedef std::vector> ValueArray; protected: EventEmitter(); diff --git a/atom/common/api/atom_api_asar.cc b/atom/common/api/atom_api_asar.cc index 3fd2ca6f86f7..07d7c608d16d 100644 --- a/atom/common/api/atom_api_asar.cc +++ b/atom/common/api/atom_api_asar.cc @@ -21,7 +21,7 @@ namespace { class Archive : public mate::Wrappable { public: - static v8::Handle Create(v8::Isolate* isolate, + static v8::Local Create(v8::Isolate* isolate, const base::FilePath& path) { scoped_ptr archive(new asar::Archive(path)); if (!archive->Init()) @@ -34,7 +34,7 @@ class Archive : public mate::Wrappable { : archive_(archive.Pass()) {} // Reads the offset and size of file. - v8::Handle GetFileInfo(v8::Isolate* isolate, + v8::Local GetFileInfo(v8::Isolate* isolate, const base::FilePath& path) { asar::Archive::FileInfo info; if (!archive_ || !archive_->GetFileInfo(path, &info)) @@ -47,7 +47,7 @@ class Archive : public mate::Wrappable { } // Returns a fake result of fs.stat(path). - v8::Handle Stat(v8::Isolate* isolate, + v8::Local Stat(v8::Isolate* isolate, const base::FilePath& path) { asar::Archive::Stats stats; if (!archive_ || !archive_->Stat(path, &stats)) @@ -62,7 +62,7 @@ class Archive : public mate::Wrappable { } // Returns all files under a directory. - v8::Handle Readdir(v8::Isolate* isolate, + v8::Local Readdir(v8::Isolate* isolate, const base::FilePath& path) { std::vector files; if (!archive_ || !archive_->Readdir(path, &files)) @@ -71,7 +71,7 @@ class Archive : public mate::Wrappable { } // Returns the path of file with symbol link resolved. - v8::Handle Realpath(v8::Isolate* isolate, + v8::Local Realpath(v8::Isolate* isolate, const base::FilePath& path) { base::FilePath realpath; if (!archive_ || !archive_->Realpath(path, &realpath)) @@ -80,7 +80,7 @@ class Archive : public mate::Wrappable { } // Copy the file out into a temporary file and returns the new path. - v8::Handle CopyFileOut(v8::Isolate* isolate, + v8::Local CopyFileOut(v8::Isolate* isolate, const base::FilePath& path) { base::FilePath new_path; if (!archive_ || !archive_->CopyFileOut(path, &new_path)) @@ -120,8 +120,8 @@ class Archive : public mate::Wrappable { }; void InitAsarSupport(v8::Isolate* isolate, - v8::Handle process, - v8::Handle require) { + v8::Local process, + v8::Local require) { // Evaluate asar_init.coffee. v8::Local asar_init = v8::Script::Compile(v8::String::NewFromUtf8( isolate, @@ -131,8 +131,8 @@ void InitAsarSupport(v8::Isolate* isolate, v8::Local result = asar_init->Run(); // Initialize asar support. - base::Callback, - v8::Handle, + base::Callback, + v8::Local, std::string)> init; if (mate::ConvertFromV8(isolate, result, &init)) { init.Run(process, @@ -141,8 +141,8 @@ void InitAsarSupport(v8::Isolate* isolate, } } -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("createArchive", &Archive::Create); dict.SetMethod("initAsarSupport", &InitAsarSupport); diff --git a/atom/common/api/atom_api_clipboard.cc b/atom/common/api/atom_api_clipboard.cc index 349b35ce5853..e6119864cb61 100644 --- a/atom/common/api/atom_api_clipboard.cc +++ b/atom/common/api/atom_api_clipboard.cc @@ -19,7 +19,7 @@ namespace mate { template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, ui::ClipboardType* out) { std::string type; if (!Converter::FromV8(isolate, val, &type)) @@ -78,8 +78,8 @@ void Clear(ui::ClipboardType type) { ui::Clipboard::GetForCurrentThread()->Clear(type); } -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("_has", &Has); dict.SetMethod("_read", &Read); diff --git a/atom/common/api/atom_api_crash_reporter.cc b/atom/common/api/atom_api_crash_reporter.cc index ba44be90b17e..9386dda8637e 100644 --- a/atom/common/api/atom_api_crash_reporter.cc +++ b/atom/common/api/atom_api_crash_reporter.cc @@ -16,15 +16,15 @@ namespace mate { template<> struct Converter > { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, std::map* out) { if (!val->IsObject()) return false; - v8::Handle dict = val->ToObject(); - v8::Handle keys = dict->GetOwnPropertyNames(); + v8::Local dict = val->ToObject(); + v8::Local keys = dict->GetOwnPropertyNames(); for (uint32_t i = 0; i < keys->Length(); ++i) { - v8::Handle key = keys->Get(i); + v8::Local key = keys->Get(i); (*out)[V8ToString(key)] = V8ToString(dict->Get(key)); } return true; @@ -35,8 +35,8 @@ struct Converter > { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { using crash_reporter::CrashReporter; mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("start", diff --git a/atom/common/api/atom_api_id_weak_map.cc b/atom/common/api/atom_api_id_weak_map.cc index cddf2d2dd4db..cc2af821de18 100644 --- a/atom/common/api/atom_api_id_weak_map.cc +++ b/atom/common/api/atom_api_id_weak_map.cc @@ -23,7 +23,7 @@ IDWeakMap::IDWeakMap() IDWeakMap::~IDWeakMap() { } -int32_t IDWeakMap::Add(v8::Isolate* isolate, v8::Handle object) { +int32_t IDWeakMap::Add(v8::Isolate* isolate, v8::Local object) { int32_t key = GetNextID(); object->SetHiddenValue(mate::StringToV8(isolate, "IDWeakMapKey"), mate::Converter::ToV8(isolate, key)); @@ -33,7 +33,7 @@ int32_t IDWeakMap::Add(v8::Isolate* isolate, v8::Handle object) { return key; } -v8::Handle IDWeakMap::Get(v8::Isolate* isolate, int32_t key) { +v8::Local IDWeakMap::Get(v8::Isolate* isolate, int32_t key) { if (!Has(key)) { node::ThrowError("Invalid key"); return v8::Undefined(isolate); @@ -67,7 +67,7 @@ int IDWeakMap::GetNextID() { // static void IDWeakMap::BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype) { + v8::Local prototype) { mate::ObjectTemplateBuilder(isolate, prototype) .SetMethod("add", &IDWeakMap::Add) .SetMethod("get", &IDWeakMap::Get) @@ -91,8 +91,8 @@ void IDWeakMap::WeakCallback( namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { using atom::api::IDWeakMap; v8::Isolate* isolate = context->GetIsolate(); v8::Local constructor = mate::CreateConstructor( diff --git a/atom/common/api/atom_api_id_weak_map.h b/atom/common/api/atom_api_id_weak_map.h index e435da189f01..0648ce925202 100644 --- a/atom/common/api/atom_api_id_weak_map.h +++ b/atom/common/api/atom_api_id_weak_map.h @@ -23,13 +23,13 @@ class IDWeakMap : public mate::Wrappable { IDWeakMap(); static void BuildPrototype(v8::Isolate* isolate, - v8::Handle prototype); + v8::Local prototype); private: virtual ~IDWeakMap(); - int32_t Add(v8::Isolate* isolate, v8::Handle object); - v8::Handle Get(v8::Isolate* isolate, int32_t key); + int32_t Add(v8::Isolate* isolate, v8::Local object); + v8::Local Get(v8::Isolate* isolate, int32_t key); bool Has(int32_t key) const; std::vector Keys() const; void Remove(int32_t key); diff --git a/atom/common/api/atom_api_native_image.cc b/atom/common/api/atom_api_native_image.cc index 23da1b9f1761..bd66ad511f75 100644 --- a/atom/common/api/atom_api_native_image.cc +++ b/atom/common/api/atom_api_native_image.cc @@ -145,14 +145,14 @@ mate::ObjectTemplateBuilder NativeImage::GetObjectTemplateBuilder( isolate, v8::Local::New(isolate, template_)); } -v8::Handle NativeImage::ToPNG(v8::Isolate* isolate) { +v8::Local NativeImage::ToPNG(v8::Isolate* isolate) { scoped_refptr png = image_.As1xPNGBytes(); return node::Buffer::New(isolate, reinterpret_cast(png->front()), png->size()); } -v8::Handle NativeImage::ToJPEG(v8::Isolate* isolate, int quality) { +v8::Local NativeImage::ToJPEG(v8::Isolate* isolate, int quality) { std::vector output; gfx::JPEG1xEncodedDataFromImage(image_, quality, &output); return node::Buffer::New(isolate, @@ -225,7 +225,7 @@ mate::Handle NativeImage::CreateFromPath( // static mate::Handle NativeImage::CreateFromBuffer( - mate::Arguments* args, v8::Handle buffer) { + mate::Arguments* args, v8::Local buffer) { double scale_factor = 1.; args->GetNext(&scale_factor); @@ -258,8 +258,8 @@ mate::Handle NativeImage::CreateFromDataURL( namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("createEmpty", &atom::api::NativeImage::CreateEmpty); dict.SetMethod("createFromPath", &atom::api::NativeImage::CreateFromPath); diff --git a/atom/common/api/atom_api_native_image.h b/atom/common/api/atom_api_native_image.h index 081501348868..8cb43d06e152 100644 --- a/atom/common/api/atom_api_native_image.h +++ b/atom/common/api/atom_api_native_image.h @@ -41,7 +41,7 @@ class NativeImage : public mate::Wrappable { static mate::Handle CreateFromPath( v8::Isolate* isolate, const base::FilePath& path); static mate::Handle CreateFromBuffer( - mate::Arguments* args, v8::Handle buffer); + mate::Arguments* args, v8::Local buffer); static mate::Handle CreateFromDataURL( v8::Isolate* isolate, const GURL& url); @@ -59,8 +59,8 @@ class NativeImage : public mate::Wrappable { v8::Isolate* isolate) override; private: - v8::Handle ToPNG(v8::Isolate* isolate); - v8::Handle ToJPEG(v8::Isolate* isolate, int quality); + v8::Local ToPNG(v8::Isolate* isolate); + v8::Local ToJPEG(v8::Isolate* isolate, int quality); std::string ToDataURL(); bool IsEmpty(); gfx::Size GetSize(); diff --git a/atom/common/api/atom_api_shell.cc b/atom/common/api/atom_api_shell.cc index ecbb99f71aac..013c5f5c6c84 100644 --- a/atom/common/api/atom_api_shell.cc +++ b/atom/common/api/atom_api_shell.cc @@ -13,8 +13,8 @@ namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("showItemInFolder", &platform_util::ShowItemInFolder); dict.SetMethod("openItem", &platform_util::OpenItem); diff --git a/atom/common/api/atom_api_v8_util.cc b/atom/common/api/atom_api_v8_util.cc index b0c79afb0ef1..ae90fe1f37fc 100644 --- a/atom/common/api/atom_api_v8_util.cc +++ b/atom/common/api/atom_api_v8_util.cc @@ -10,31 +10,31 @@ namespace { -v8::Handle CreateObjectWithName(v8::Isolate* isolate, - v8::Handle name) { +v8::Local CreateObjectWithName(v8::Isolate* isolate, + v8::Local name) { v8::Local t = v8::FunctionTemplate::New(isolate); t->SetClassName(name); return t->GetFunction()->NewInstance(); } -v8::Handle GetHiddenValue(v8::Handle object, - v8::Handle key) { +v8::Local GetHiddenValue(v8::Local object, + v8::Local key) { return object->GetHiddenValue(key); } -void SetHiddenValue(v8::Handle object, - v8::Handle key, - v8::Handle value) { +void SetHiddenValue(v8::Local object, + v8::Local key, + v8::Local value) { object->SetHiddenValue(key, value); } -int32_t GetObjectHash(v8::Handle object) { +int32_t GetObjectHash(v8::Local object) { return object->GetIdentityHash(); } void SetDestructor(v8::Isolate* isolate, - v8::Handle object, - v8::Handle callback) { + v8::Local object, + v8::Local callback) { atom::ObjectLifeMonitor::BindTo(isolate, object, callback); } @@ -42,8 +42,8 @@ void TakeHeapSnapshot(v8::Isolate* isolate) { isolate->GetHeapProfiler()->TakeHeapSnapshot(); } -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("createObjectWithName", &CreateObjectWithName); dict.SetMethod("getHiddenValue", &GetHiddenValue); diff --git a/atom/common/api/atom_bindings.cc b/atom/common/api/atom_bindings.cc index 202819eb539e..a210cc6931d2 100644 --- a/atom/common/api/atom_bindings.cc +++ b/atom/common/api/atom_bindings.cc @@ -49,7 +49,7 @@ AtomBindings::~AtomBindings() { } void AtomBindings::BindTo(v8::Isolate* isolate, - v8::Handle process) { + v8::Local process) { v8::V8::SetFatalErrorHandler(FatalErrorCallback); mate::Dictionary dict(isolate, process); diff --git a/atom/common/api/atom_bindings.h b/atom/common/api/atom_bindings.h index 1d92f174d5eb..b3536c234030 100644 --- a/atom/common/api/atom_bindings.h +++ b/atom/common/api/atom_bindings.h @@ -24,7 +24,7 @@ class AtomBindings { // Add process.atomBinding function, which behaves like process.binding but // load native code from atom-shell instead. - void BindTo(v8::Isolate* isolate, v8::Handle process); + void BindTo(v8::Isolate* isolate, v8::Local process); private: void ActivateUVLoop(v8::Isolate* isolate); diff --git a/atom/common/api/object_life_monitor.cc b/atom/common/api/object_life_monitor.cc index ac954d8d54f7..18d2a3a4d53f 100644 --- a/atom/common/api/object_life_monitor.cc +++ b/atom/common/api/object_life_monitor.cc @@ -11,8 +11,8 @@ namespace atom { // static void ObjectLifeMonitor::BindTo(v8::Isolate* isolate, - v8::Handle target, - v8::Handle destructor) { + v8::Local target, + v8::Local destructor) { target->SetHiddenValue(MATE_STRING_NEW(isolate, "destructor"), destructor); ObjectLifeMonitor* olm = new ObjectLifeMonitor(); diff --git a/atom/common/api/object_life_monitor.h b/atom/common/api/object_life_monitor.h index 6717c68db52d..e8dbbcf65f15 100644 --- a/atom/common/api/object_life_monitor.h +++ b/atom/common/api/object_life_monitor.h @@ -13,8 +13,8 @@ namespace atom { class ObjectLifeMonitor { public: static void BindTo(v8::Isolate* isolate, - v8::Handle target, - v8::Handle destructor); + v8::Local target, + v8::Local destructor); private: ObjectLifeMonitor(); diff --git a/atom/common/native_mate_converters/accelerator_converter.cc b/atom/common/native_mate_converters/accelerator_converter.cc index 74d65161585e..15eaafda2e3d 100644 --- a/atom/common/native_mate_converters/accelerator_converter.cc +++ b/atom/common/native_mate_converters/accelerator_converter.cc @@ -12,7 +12,7 @@ namespace mate { // static bool Converter::FromV8( - v8::Isolate* isolate, v8::Handle val, ui::Accelerator* out) { + v8::Isolate* isolate, v8::Local val, ui::Accelerator* out) { std::string keycode; if (!ConvertFromV8(isolate, val, &keycode)) return false; diff --git a/atom/common/native_mate_converters/accelerator_converter.h b/atom/common/native_mate_converters/accelerator_converter.h index 0a08f059253a..499077c08e28 100644 --- a/atom/common/native_mate_converters/accelerator_converter.h +++ b/atom/common/native_mate_converters/accelerator_converter.h @@ -15,7 +15,7 @@ namespace mate { template<> struct Converter { - static bool FromV8(v8::Isolate* isolate, v8::Handle val, + static bool FromV8(v8::Isolate* isolate, v8::Local val, ui::Accelerator* out); }; diff --git a/atom/common/native_mate_converters/file_path_converter.h b/atom/common/native_mate_converters/file_path_converter.h index f41449d5f85a..468f506de8a3 100644 --- a/atom/common/native_mate_converters/file_path_converter.h +++ b/atom/common/native_mate_converters/file_path_converter.h @@ -14,12 +14,12 @@ namespace mate { template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const base::FilePath& val) { return Converter::ToV8(isolate, val.value()); } static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::FilePath* out) { base::FilePath::StringType path; if (Converter::FromV8(isolate, val, &path)) { diff --git a/atom/common/native_mate_converters/gfx_converter.cc b/atom/common/native_mate_converters/gfx_converter.cc index 7f18debb96e1..6620276b584e 100644 --- a/atom/common/native_mate_converters/gfx_converter.cc +++ b/atom/common/native_mate_converters/gfx_converter.cc @@ -12,7 +12,7 @@ namespace mate { -v8::Handle Converter::ToV8(v8::Isolate* isolate, +v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Point& val) { mate::Dictionary dict(isolate, v8::Object::New(isolate)); dict.Set("x", val.x()); @@ -21,7 +21,7 @@ v8::Handle Converter::ToV8(v8::Isolate* isolate, } bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Point* out) { mate::Dictionary dict; if (!ConvertFromV8(isolate, val, &dict)) @@ -33,7 +33,7 @@ bool Converter::FromV8(v8::Isolate* isolate, return true; } -v8::Handle Converter::ToV8(v8::Isolate* isolate, +v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Size& val) { mate::Dictionary dict(isolate, v8::Object::New(isolate)); dict.Set("width", val.width()); @@ -42,7 +42,7 @@ v8::Handle Converter::ToV8(v8::Isolate* isolate, } bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Size* out) { mate::Dictionary dict; if (!ConvertFromV8(isolate, val, &dict)) @@ -54,7 +54,7 @@ bool Converter::FromV8(v8::Isolate* isolate, return true; } -v8::Handle Converter::ToV8(v8::Isolate* isolate, +v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Rect& val) { mate::Dictionary dict(isolate, v8::Object::New(isolate)); dict.Set("x", val.x()); @@ -65,7 +65,7 @@ v8::Handle Converter::ToV8(v8::Isolate* isolate, } bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Rect* out) { mate::Dictionary dict; if (!ConvertFromV8(isolate, val, &dict)) @@ -80,7 +80,7 @@ bool Converter::FromV8(v8::Isolate* isolate, template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const gfx::Display::TouchSupport& val) { switch (val) { case gfx::Display::TOUCH_SUPPORT_AVAILABLE: @@ -93,7 +93,7 @@ struct Converter { } }; -v8::Handle Converter::ToV8(v8::Isolate* isolate, +v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Display& val) { mate::Dictionary dict(isolate, v8::Object::New(isolate)); dict.Set("id", val.id()); diff --git a/atom/common/native_mate_converters/gfx_converter.h b/atom/common/native_mate_converters/gfx_converter.h index 35fd5039a72f..c6da76a2d0e7 100644 --- a/atom/common/native_mate_converters/gfx_converter.h +++ b/atom/common/native_mate_converters/gfx_converter.h @@ -18,37 +18,37 @@ namespace mate { template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const gfx::Point& val); static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Point* out); }; template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const gfx::Size& val); static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Size* out); }; template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const gfx::Rect& val); static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Rect* out); }; template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const gfx::Display& val); static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Display* out); }; diff --git a/atom/common/native_mate_converters/gurl_converter.h b/atom/common/native_mate_converters/gurl_converter.h index f578ad4cffcd..34408913b789 100644 --- a/atom/common/native_mate_converters/gurl_converter.h +++ b/atom/common/native_mate_converters/gurl_converter.h @@ -14,12 +14,12 @@ namespace mate { template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const GURL& val) { return ConvertToV8(isolate, val.spec()); } static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, GURL* out) { std::string url; if (Converter::FromV8(isolate, val, &url)) { diff --git a/atom/common/native_mate_converters/image_converter.cc b/atom/common/native_mate_converters/image_converter.cc index ec5c50f31564..550bb7b904a7 100644 --- a/atom/common/native_mate_converters/image_converter.cc +++ b/atom/common/native_mate_converters/image_converter.cc @@ -11,7 +11,7 @@ namespace mate { bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::ImageSkia* out) { gfx::Image image; if (!ConvertFromV8(isolate, val, &image)) @@ -22,7 +22,7 @@ bool Converter::FromV8(v8::Isolate* isolate, } bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Image* out) { if (val->IsNull()) return true; @@ -43,7 +43,7 @@ bool Converter::FromV8(v8::Isolate* isolate, return true; } -v8::Handle Converter::ToV8(v8::Isolate* isolate, +v8::Local Converter::ToV8(v8::Isolate* isolate, const gfx::Image& val) { return ConvertToV8(isolate, atom::api::NativeImage::Create(isolate, val)); } diff --git a/atom/common/native_mate_converters/image_converter.h b/atom/common/native_mate_converters/image_converter.h index 1b1a12c3ae02..be52288eb049 100644 --- a/atom/common/native_mate_converters/image_converter.h +++ b/atom/common/native_mate_converters/image_converter.h @@ -17,16 +17,16 @@ namespace mate { template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::ImageSkia* out); }; template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, gfx::Image* out); - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const gfx::Image& val); }; diff --git a/atom/common/native_mate_converters/string16_converter.h b/atom/common/native_mate_converters/string16_converter.h index 4eb7d7698870..9fff5be45f7a 100644 --- a/atom/common/native_mate_converters/string16_converter.h +++ b/atom/common/native_mate_converters/string16_converter.h @@ -12,13 +12,13 @@ namespace mate { template<> struct Converter { - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const base::string16& val) { return MATE_STRING_NEW_FROM_UTF16( isolate, reinterpret_cast(val.data()), val.size()); } static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::string16* out) { if (!val->IsString()) return false; diff --git a/atom/common/native_mate_converters/v8_value_converter.cc b/atom/common/native_mate_converters/v8_value_converter.cc index 7c34b222ff01..87bc2e7c030f 100644 --- a/atom/common/native_mate_converters/v8_value_converter.cc +++ b/atom/common/native_mate_converters/v8_value_converter.cc @@ -46,7 +46,7 @@ class V8ValueConverter::FromV8ValueState { // other handle B in the map points to the same object as A. Note that A can // be unique even if there already is another handle with the same identity // hash (key) in the map, because two objects can have the same hash. - bool UpdateAndCheckUniqueness(v8::Handle handle) { + bool UpdateAndCheckUniqueness(v8::Local handle) { typedef HashToHandleMap::const_iterator Iterator; int hash = handle->GetIdentityHash(); // We only compare using == with handles to objects with the same identity @@ -67,7 +67,7 @@ class V8ValueConverter::FromV8ValueState { } private: - typedef std::multimap > HashToHandleMap; + typedef std::multimap > HashToHandleMap; HashToHandleMap unique_map_; int max_recursion_depth_; @@ -202,7 +202,7 @@ v8::Local V8ValueConverter::ToV8Object( base::Value* V8ValueConverter::FromV8ValueImpl( FromV8ValueState* state, - v8::Handle val, + v8::Local val, v8::Isolate* isolate) const { CHECK(!val.IsEmpty()); @@ -267,7 +267,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl( } base::Value* V8ValueConverter::FromV8Array( - v8::Handle val, + v8::Local val, FromV8ValueState* state, v8::Isolate* isolate) const { if (!state->UpdateAndCheckUniqueness(val)) diff --git a/atom/common/native_mate_converters/v8_value_converter.h b/atom/common/native_mate_converters/v8_value_converter.h index 94250a335f2a..3a0f6374ccb4 100644 --- a/atom/common/native_mate_converters/v8_value_converter.h +++ b/atom/common/native_mate_converters/v8_value_converter.h @@ -43,9 +43,9 @@ class V8ValueConverter { const base::DictionaryValue* dictionary) const; base::Value* FromV8ValueImpl(FromV8ValueState* state, - v8::Handle value, + v8::Local value, v8::Isolate* isolate) const; - base::Value* FromV8Array(v8::Handle array, + base::Value* FromV8Array(v8::Local array, FromV8ValueState* state, v8::Isolate* isolate) const; diff --git a/atom/common/native_mate_converters/value_converter.cc b/atom/common/native_mate_converters/value_converter.cc index 65d47b2af8c4..815ba0ebb211 100644 --- a/atom/common/native_mate_converters/value_converter.cc +++ b/atom/common/native_mate_converters/value_converter.cc @@ -10,7 +10,7 @@ namespace mate { bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::DictionaryValue* out) { scoped_ptr converter(new atom::V8ValueConverter); scoped_ptr value(converter->FromV8Value( @@ -24,7 +24,7 @@ bool Converter::FromV8(v8::Isolate* isolate, } bool Converter::FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::ListValue* out) { scoped_ptr converter(new atom::V8ValueConverter); scoped_ptr value(converter->FromV8Value( @@ -37,7 +37,7 @@ bool Converter::FromV8(v8::Isolate* isolate, } } -v8::Handle Converter::ToV8( +v8::Local Converter::ToV8( v8::Isolate* isolate, const base::ListValue& val) { scoped_ptr converter(new atom::V8ValueConverter); diff --git a/atom/common/native_mate_converters/value_converter.h b/atom/common/native_mate_converters/value_converter.h index 4810e6aa26f0..bb0ef66e719b 100644 --- a/atom/common/native_mate_converters/value_converter.h +++ b/atom/common/native_mate_converters/value_converter.h @@ -17,16 +17,16 @@ namespace mate { template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::DictionaryValue* out); }; template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, base::ListValue* out); - static v8::Handle ToV8(v8::Isolate* isolate, + static v8::Local ToV8(v8::Isolate* isolate, const base::ListValue& val); }; diff --git a/atom/renderer/api/atom_api_renderer_ipc.cc b/atom/renderer/api/atom_api_renderer_ipc.cc index 81209d9cffae..00a5ba861650 100644 --- a/atom/renderer/api/atom_api_renderer_ipc.cc +++ b/atom/renderer/api/atom_api_renderer_ipc.cc @@ -62,8 +62,8 @@ base::string16 SendSync(const base::string16& channel, return json; } -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { mate::Dictionary dict(context->GetIsolate(), exports); dict.SetMethod("send", &Send); dict.SetMethod("sendSync", &SendSync); diff --git a/atom/renderer/api/atom_api_spell_check_client.cc b/atom/renderer/api/atom_api_spell_check_client.cc index e4ee25ea5eff..25d1e30b0aac 100644 --- a/atom/renderer/api/atom_api_spell_check_client.cc +++ b/atom/renderer/api/atom_api_spell_check_client.cc @@ -41,7 +41,7 @@ bool HasWordCharacters(const base::string16& text, int index) { SpellCheckClient::SpellCheckClient(const std::string& language, bool auto_spell_correct_turned_on, v8::Isolate* isolate, - v8::Handle provider) + v8::Local provider) : auto_spell_correct_turned_on_(auto_spell_correct_turned_on), isolate_(isolate), provider_(isolate, provider) { @@ -160,8 +160,8 @@ bool SpellCheckClient::SpellCheckWord(const base::string16& word_to_check) { return true; v8::HandleScope handle_scope(isolate_); - v8::Handle word = mate::ConvertToV8(isolate_, word_to_check); - v8::Handle result = spell_check_.NewHandle()->Call( + v8::Local word = mate::ConvertToV8(isolate_, word_to_check); + v8::Local result = spell_check_.NewHandle()->Call( provider_.NewHandle(), 1, &word); if (result->IsBoolean()) diff --git a/atom/renderer/api/atom_api_spell_check_client.h b/atom/renderer/api/atom_api_spell_check_client.h index fa616528d482..345cad186ace 100644 --- a/atom/renderer/api/atom_api_spell_check_client.h +++ b/atom/renderer/api/atom_api_spell_check_client.h @@ -22,7 +22,7 @@ class SpellCheckClient : public blink::WebSpellCheckClient { SpellCheckClient(const std::string& language, bool auto_spell_correct_turned_on, v8::Isolate* isolate, - v8::Handle provider); + v8::Local provider); virtual ~SpellCheckClient(); private: diff --git a/atom/renderer/api/atom_api_web_frame.cc b/atom/renderer/api/atom_api_web_frame.cc index ee0d11a0200b..21c0592a7c43 100644 --- a/atom/renderer/api/atom_api_web_frame.cc +++ b/atom/renderer/api/atom_api_web_frame.cc @@ -27,7 +27,7 @@ namespace mate { template<> struct Converter { static bool FromV8(v8::Isolate* isolate, - v8::Handle val, + v8::Local val, WTF::String* out) { if (!val->IsString()) return false; @@ -72,8 +72,8 @@ double WebFrame::GetZoomFactor() const { return blink::WebView::zoomLevelToZoomFactor(GetZoomLevel()); } -v8::Handle WebFrame::RegisterEmbedderCustomElement( - const base::string16& name, v8::Handle options) { +v8::Local WebFrame::RegisterEmbedderCustomElement( + const base::string16& name, v8::Local options) { blink::WebExceptionCode c = 0; return web_frame_->document().registerEmbedderCustomElement(name, options, c); } @@ -85,7 +85,7 @@ void WebFrame::AttachGuest(int id) { void WebFrame::SetSpellCheckProvider(mate::Arguments* args, const std::string& language, bool auto_spell_correct_turned_on, - v8::Handle provider) { + v8::Local provider) { if (!provider->Has(mate::StringToV8(args->isolate(), "spellCheck"))) { args->ThrowError("\"spellCheck\" has to be defined"); return; @@ -123,8 +123,8 @@ mate::Handle WebFrame::Create(v8::Isolate* isolate) { namespace { -void Initialize(v8::Handle exports, v8::Handle unused, - v8::Handle context, void* priv) { +void Initialize(v8::Local exports, v8::Local unused, + v8::Local context, void* priv) { v8::Isolate* isolate = context->GetIsolate(); mate::Dictionary dict(isolate, exports); dict.Set("webFrame", atom::api::WebFrame::Create(isolate)); diff --git a/atom/renderer/api/atom_api_web_frame.h b/atom/renderer/api/atom_api_web_frame.h index aca4d0f0b52b..f9afa1d1d616 100644 --- a/atom/renderer/api/atom_api_web_frame.h +++ b/atom/renderer/api/atom_api_web_frame.h @@ -40,15 +40,15 @@ class WebFrame : public mate::Wrappable { double SetZoomFactor(double factor); double GetZoomFactor() const; - v8::Handle RegisterEmbedderCustomElement( - const base::string16& name, v8::Handle options); + v8::Local RegisterEmbedderCustomElement( + const base::string16& name, v8::Local options); void AttachGuest(int element_instance_id); // Set the provider that will be used by SpellCheckClient for spell check. void SetSpellCheckProvider(mate::Arguments* args, const std::string& language, bool auto_spell_correct_turned_on, - v8::Handle provider); + v8::Local provider); // mate::Wrappable: virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder( diff --git a/atom/renderer/atom_render_view_observer.cc b/atom/renderer/atom_render_view_observer.cc index 2c1166b7e24f..10ac9bbd6b7c 100644 --- a/atom/renderer/atom_render_view_observer.cc +++ b/atom/renderer/atom_render_view_observer.cc @@ -30,21 +30,21 @@ namespace atom { namespace { bool GetIPCObject(v8::Isolate* isolate, - v8::Handle context, - v8::Handle* ipc) { - v8::Handle key = mate::StringToV8(isolate, "ipc"); - v8::Handle value = context->Global()->GetHiddenValue(key); + v8::Local context, + v8::Local* ipc) { + v8::Local key = mate::StringToV8(isolate, "ipc"); + v8::Local value = context->Global()->GetHiddenValue(key); if (value.IsEmpty() || !value->IsObject()) return false; *ipc = value->ToObject(); return true; } -std::vector> ListValueToVector( +std::vector> ListValueToVector( v8::Isolate* isolate, const base::ListValue& list) { - v8::Handle array = mate::ConvertToV8(isolate, list); - std::vector> result; + v8::Local array = mate::ConvertToV8(isolate, list); + std::vector> result; mate::ConvertFromV8(isolate, array, &result); return result; } @@ -119,11 +119,11 @@ void AtomRenderViewObserver::OnBrowserMessage(const base::string16& channel, v8::Local context = frame->mainWorldScriptContext(); v8::Context::Scope context_scope(context); - std::vector> arguments = ListValueToVector( + std::vector> arguments = ListValueToVector( isolate, args); arguments.insert(arguments.begin(), mate::ConvertToV8(isolate, channel)); - v8::Handle ipc; + v8::Local ipc; if (GetIPCObject(isolate, context, &ipc)) node::MakeCallback(isolate, ipc, "emit", arguments.size(), &arguments[0]); } diff --git a/vendor/native_mate b/vendor/native_mate index 047a8de9342a..269be869988b 160000 --- a/vendor/native_mate +++ b/vendor/native_mate @@ -1 +1 @@ -Subproject commit 047a8de9342a3217a8d8316f77b9276e8eb7a649 +Subproject commit 269be869988bda9a7e8ad0ef56af178a741af09c