commit
				
					
						30d815e28f
					
				
			
		
					 69 changed files with 286 additions and 255 deletions
				
			
		|  | @ -42,7 +42,7 @@ namespace mate { | |||
| #if defined(OS_WIN) | ||||
| template<> | ||||
| struct Converter<Browser::UserTask> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> 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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   auto command_line = base::CommandLine::ForCurrentProcess(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -77,8 +77,8 @@ mate::Handle<AutoUpdater> AutoUpdater::Create(v8::Isolate* isolate) { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("autoUpdater", atom::api::AutoUpdater::Create(isolate)); | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ namespace mate { | |||
| template<> | ||||
| struct Converter<base::trace_event::CategoryFilter> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      base::trace_event::CategoryFilter* out) { | ||||
|     std::string filter; | ||||
|     if (!ConvertFromV8(isolate, val, &filter)) | ||||
|  | @ -33,7 +33,7 @@ struct Converter<base::trace_event::CategoryFilter> { | |||
| template<> | ||||
| struct Converter<base::trace_event::TraceOptions> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      base::trace_event::TraceOptions* out) { | ||||
|     std::string options; | ||||
|     if (!ConvertFromV8(isolate, val, &options)) | ||||
|  | @ -46,8 +46,8 @@ struct Converter<base::trace_event::TraceOptions> { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   auto controller = base::Unretained(TracingController::GetInstance()); | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("getCategories", base::Bind( | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ namespace mate { | |||
| template<> | ||||
| struct Converter<file_dialog::Filter> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> 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<v8::Value> peek = args->PeekNext(); | ||||
|   v8::Local<v8::Value> peek = args->PeekNext(); | ||||
|   atom::MessageBoxCallback callback; | ||||
|   if (mate::Converter<atom::MessageBoxCallback>::FromV8(args->isolate(), | ||||
|                                                         peek, | ||||
|  | @ -72,7 +72,7 @@ void ShowOpenDialog(const std::string& title, | |||
|                     int properties, | ||||
|                     atom::NativeWindow* window, | ||||
|                     mate::Arguments* args) { | ||||
|   v8::Handle<v8::Value> peek = args->PeekNext(); | ||||
|   v8::Local<v8::Value> peek = args->PeekNext(); | ||||
|   file_dialog::OpenDialogCallback callback; | ||||
|   if (mate::Converter<file_dialog::OpenDialogCallback>::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<v8::Value> peek = args->PeekNext(); | ||||
|   v8::Local<v8::Value> peek = args->PeekNext(); | ||||
|   file_dialog::SaveDialogCallback callback; | ||||
|   if (mate::Converter<file_dialog::SaveDialogCallback>::FromV8(args->isolate(), | ||||
|                                                                peek, | ||||
|  | @ -106,8 +106,8 @@ void ShowSaveDialog(const std::string& title, | |||
|   } | ||||
| } | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("showMessageBox", &ShowMessageBox); | ||||
|   dict.SetMethod("showErrorBox", &atom::ShowErrorBox); | ||||
|  |  | |||
|  | @ -86,8 +86,8 @@ mate::Handle<GlobalShortcut> GlobalShortcut::Create(v8::Isolate* isolate) { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("globalShortcut", atom::api::GlobalShortcut::Create(isolate)); | ||||
|  |  | |||
|  | @ -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<v8::Value> val = get_accelerator_.Run(command_id); | ||||
|   v8::Local<v8::Value> 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<v8::ObjectTemplate> prototype) { | ||||
|                           v8::Local<v8::ObjectTemplate> 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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   using atom::api::Menu; | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   v8::Local<v8::Function> constructor = mate::CreateConstructor<Menu>( | ||||
|       isolate, "Menu", base::Bind(&Menu::Create)); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("Menu", static_cast<v8::Handle<v8::Value>>(constructor)); | ||||
|   dict.Set("Menu", static_cast<v8::Local<v8::Value>>(constructor)); | ||||
| #if defined(OS_MACOSX) | ||||
|   dict.SetMethod("setApplicationMenu", &Menu::SetApplicationMenu); | ||||
|   dict.SetMethod("sendActionToFirstResponder", | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ class Menu : public mate::Wrappable, | |||
|   static mate::Wrappable* Create(); | ||||
| 
 | ||||
|   static void BuildPrototype(v8::Isolate* isolate, | ||||
|                              v8::Handle<v8::ObjectTemplate> prototype); | ||||
|                              v8::Local<v8::ObjectTemplate> prototype); | ||||
| 
 | ||||
| #if defined(OS_MACOSX) | ||||
|   // Set the global menubar.
 | ||||
|  | @ -88,7 +88,7 @@ class Menu : public mate::Wrappable, | |||
|   base::Callback<bool(int)> is_checked_; | ||||
|   base::Callback<bool(int)> is_enabled_; | ||||
|   base::Callback<bool(int)> is_visible_; | ||||
|   base::Callback<v8::Handle<v8::Value>(int)> get_accelerator_; | ||||
|   base::Callback<v8::Local<v8::Value>(int)> get_accelerator_; | ||||
|   base::Callback<void(int)> execute_command_; | ||||
|   base::Callback<void()> menu_will_show_; | ||||
| 
 | ||||
|  |  | |||
|  | @ -39,7 +39,7 @@ void PowerMonitor::OnResume() { | |||
| } | ||||
| 
 | ||||
| // static
 | ||||
| v8::Handle<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) { | ||||
| v8::Local<v8::Value> 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<v8::Value> PowerMonitor::Create(v8::Isolate* isolate) { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
| #if defined(OS_MACOSX) | ||||
|   base::PowerMonitorDeviceSource::AllocateSystemIOPorts(); | ||||
| #endif | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ namespace api { | |||
| class PowerMonitor : public mate::EventEmitter, | ||||
|                      public base::PowerObserver { | ||||
|  public: | ||||
|   static v8::Handle<v8::Value> Create(v8::Isolate* isolate); | ||||
|   static v8::Local<v8::Value> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  protected: | ||||
|   PowerMonitor(); | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<const net::URLRequest*> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const net::URLRequest* val) { | ||||
|     return mate::ObjectTemplateBuilder(isolate) | ||||
|         .SetValue("method", val->method()) | ||||
|  | @ -42,6 +42,14 @@ namespace { | |||
| 
 | ||||
| typedef net::URLRequestJobFactory::ProtocolHandler ProtocolHandler; | ||||
| 
 | ||||
| scoped_refptr<base::RefCountedBytes> BufferToRefCountedBytes( | ||||
|     v8::Local<v8::Value> buf) { | ||||
|   scoped_refptr<base::RefCountedBytes> data(new base::RefCountedBytes); | ||||
|   auto start = reinterpret_cast<const unsigned char*>(node::Buffer::Data(buf)); | ||||
|   data->data().assign(start, start + node::Buffer::Length(buf)); | ||||
|   return data; | ||||
| } | ||||
| 
 | ||||
| class CustomProtocolRequestJob : public AdapterRequestJob { | ||||
|  public: | ||||
|   CustomProtocolRequestJob(Protocol* registry, | ||||
|  | @ -63,7 +71,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob { | |||
|     // Call the JS handler.
 | ||||
|     Protocol::JsProtocolHandler callback = | ||||
|         registry_->GetProtocolHandler(request()->url().scheme()); | ||||
|     v8::Handle<v8::Value> result = callback.Run(request()); | ||||
|     v8::Local<v8::Value> result = callback.Run(request()); | ||||
| 
 | ||||
|     // Determine the type of the job we are going to create.
 | ||||
|     if (result->IsString()) { | ||||
|  | @ -73,7 +81,7 @@ class CustomProtocolRequestJob : public AdapterRequestJob { | |||
|                      GetWeakPtr(), "text/plain", "UTF-8", data)); | ||||
|       return; | ||||
|     } else if (result->IsObject()) { | ||||
|       v8::Handle<v8::Object> obj = result->ToObject(); | ||||
|       v8::Local<v8::Object> obj = result->ToObject(); | ||||
|       mate::Dictionary dict(isolate, obj); | ||||
|       std::string name = mate::V8ToString(obj->GetConstructorName()); | ||||
|       if (name == "RequestStringJob") { | ||||
|  | @ -88,14 +96,15 @@ class CustomProtocolRequestJob : public AdapterRequestJob { | |||
|         return; | ||||
|       } else if (name == "RequestBufferJob") { | ||||
|         std::string mime_type, encoding; | ||||
|         v8::Handle<v8::Value> buffer; | ||||
|         v8::Local<v8::Value> buffer; | ||||
|         dict.Get("mimeType", &mime_type); | ||||
|         dict.Get("encoding", &encoding); | ||||
|         dict.Get("data", &buffer); | ||||
| 
 | ||||
|         BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | ||||
|             base::Bind(&AdapterRequestJob::CreateBufferJobAndStart, | ||||
|                        GetWeakPtr(), mime_type, encoding, buffer->ToObject())); | ||||
|                        GetWeakPtr(), mime_type, encoding, | ||||
|                        BufferToRefCountedBytes(buffer))); | ||||
|         return; | ||||
|       } else if (name == "RequestFileJob") { | ||||
|         base::FilePath path; | ||||
|  | @ -339,8 +348,8 @@ mate::Handle<Protocol> Protocol::Create(v8::Isolate* isolate) { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("protocol", atom::api::Protocol::Create(isolate)); | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ namespace api { | |||
| 
 | ||||
| class Protocol : public mate::EventEmitter { | ||||
|  public: | ||||
|   typedef base::Callback<v8::Handle<v8::Value>(const net::URLRequest*)> | ||||
|   typedef base::Callback<v8::Local<v8::Value>(const net::URLRequest*)> | ||||
|           JsProtocolHandler; | ||||
| 
 | ||||
|   static mate::Handle<Protocol> Create(v8::Isolate* isolate); | ||||
|  |  | |||
|  | @ -111,7 +111,7 @@ mate::ObjectTemplateBuilder Screen::GetObjectTemplateBuilder( | |||
| } | ||||
| 
 | ||||
| // static
 | ||||
| v8::Handle<v8::Value> Screen::Create(v8::Isolate* isolate) { | ||||
| v8::Local<v8::Value> 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<v8::Value> Screen::Create(v8::Isolate* isolate) { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.Set("screen", atom::api::Screen::Create(context->GetIsolate())); | ||||
| } | ||||
|  |  | |||
|  | @ -24,7 +24,7 @@ namespace api { | |||
| class Screen : public mate::EventEmitter, | ||||
|                public gfx::DisplayObserver { | ||||
|  public: | ||||
|   static v8::Handle<v8::Value> Create(v8::Isolate* isolate); | ||||
|   static v8::Local<v8::Value> Create(v8::Isolate* isolate); | ||||
| 
 | ||||
|  protected: | ||||
|   explicit Screen(gfx::Screen* screen); | ||||
|  |  | |||
|  | @ -128,7 +128,7 @@ bool Tray::CheckTrayLife(mate::Arguments* args) { | |||
| 
 | ||||
| // static
 | ||||
| void Tray::BuildPrototype(v8::Isolate* isolate, | ||||
|                           v8::Handle<v8::ObjectTemplate> prototype) { | ||||
|                           v8::Local<v8::ObjectTemplate> 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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   using atom::api::Tray; | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   v8::Handle<v8::Function> constructor = mate::CreateConstructor<Tray>( | ||||
|   v8::Local<v8::Function> constructor = mate::CreateConstructor<Tray>( | ||||
|       isolate, "Tray", base::Bind(&Tray::New)); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("Tray", static_cast<v8::Handle<v8::Value>>(constructor)); | ||||
|   dict.Set("Tray", static_cast<v8::Local<v8::Value>>(constructor)); | ||||
| } | ||||
| 
 | ||||
| }  // namespace
 | ||||
|  |  | |||
|  | @ -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<v8::ObjectTemplate> prototype); | ||||
|                              v8::Local<v8::ObjectTemplate> prototype); | ||||
| 
 | ||||
|  protected: | ||||
|   explicit Tray(const gfx::Image& image); | ||||
|  |  | |||
|  | @ -22,6 +22,7 @@ | |||
| #include "brightray/browser/inspectable_web_contents.h" | ||||
| #include "brightray/browser/media/media_stream_devices_controller.h" | ||||
| #include "content/public/browser/favicon_status.h" | ||||
| #include "content/public/browser/guest_host.h" | ||||
| #include "content/public/browser/navigation_details.h" | ||||
| #include "content/public/browser/navigation_entry.h" | ||||
| #include "content/public/browser/plugin_service.h" | ||||
|  | @ -81,7 +82,7 @@ WebContents::WebContents(content::WebContents* web_contents) | |||
|       guest_instance_id_(-1), | ||||
|       element_instance_id_(-1), | ||||
|       guest_opaque_(true), | ||||
|       guest_sizer_(nullptr), | ||||
|       guest_host_(nullptr), | ||||
|       auto_size_enabled_(false) { | ||||
| } | ||||
| 
 | ||||
|  | @ -89,7 +90,7 @@ WebContents::WebContents(const mate::Dictionary& options) | |||
|     : guest_instance_id_(-1), | ||||
|       element_instance_id_(-1), | ||||
|       guest_opaque_(true), | ||||
|       guest_sizer_(nullptr), | ||||
|       guest_host_(nullptr), | ||||
|       auto_size_enabled_(false) { | ||||
|   options.Get("guestInstanceId", &guest_instance_id_); | ||||
| 
 | ||||
|  | @ -299,11 +300,11 @@ void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host, | |||
|   Emit("did-fail-load", error_code, error_description); | ||||
| } | ||||
| 
 | ||||
| void WebContents::DidStartLoading(content::RenderViewHost* render_view_host) { | ||||
| void WebContents::DidStartLoading() { | ||||
|   Emit("did-start-loading"); | ||||
| } | ||||
| 
 | ||||
| void WebContents::DidStopLoading(content::RenderViewHost* render_view_host) { | ||||
| void WebContents::DidStopLoading() { | ||||
|   Emit("did-stop-loading"); | ||||
| } | ||||
| 
 | ||||
|  | @ -406,7 +407,7 @@ void WebContents::ElementSizeChanged(const gfx::Size& size) { | |||
| 
 | ||||
|   // Only resize if needed.
 | ||||
|   if (!size.IsEmpty()) | ||||
|     guest_sizer_->SizeContents(size); | ||||
|     guest_host_->SizeContents(size); | ||||
| } | ||||
| 
 | ||||
| content::WebContents* WebContents::GetOwnerWebContents() const { | ||||
|  | @ -420,13 +421,8 @@ void WebContents::GuestSizeChanged(const gfx::Size& new_size) { | |||
|   guest_size_ = new_size; | ||||
| } | ||||
| 
 | ||||
| void WebContents::RegisterDestructionCallback( | ||||
|     const DestructionCallback& callback) { | ||||
|   destruction_callback_ = callback; | ||||
| } | ||||
| 
 | ||||
| void WebContents::SetGuestSizer(content::GuestSizer* guest_sizer) { | ||||
|   guest_sizer_ = guest_sizer; | ||||
| void WebContents::SetGuestHost(content::GuestHost* guest_host) { | ||||
|   guest_host_ = guest_host; | ||||
| } | ||||
| 
 | ||||
| void WebContents::WillAttach(content::WebContents* embedder_web_contents, | ||||
|  | @ -438,12 +434,13 @@ void WebContents::WillAttach(content::WebContents* embedder_web_contents, | |||
| 
 | ||||
| void WebContents::Destroy() { | ||||
|   if (storage_) { | ||||
|     if (!destruction_callback_.is_null()) | ||||
|       destruction_callback_.Run(); | ||||
| 
 | ||||
|     // When force destroying the "destroyed" event is not emitted.
 | ||||
|     WebContentsDestroyed(); | ||||
| 
 | ||||
|     // Give the content module an opportunity to perform some cleanup.
 | ||||
|     guest_host_->WillDestroy(); | ||||
|     guest_host_ = nullptr; | ||||
| 
 | ||||
|     Observe(nullptr); | ||||
|     storage_.reset(); | ||||
|   } | ||||
|  | @ -754,8 +751,8 @@ mate::Handle<WebContents> WebContents::Create( | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.SetMethod("create", &atom::api::WebContents::Create); | ||||
|  |  | |||
|  | @ -172,8 +172,8 @@ class WebContents : public mate::EventEmitter, | |||
|                               const GURL& validated_url, | ||||
|                               int error_code, | ||||
|                               const base::string16& error_description) override; | ||||
|   void DidStartLoading(content::RenderViewHost* render_view_host) override; | ||||
|   void DidStopLoading(content::RenderViewHost* render_view_host) override; | ||||
|   void DidStartLoading() override; | ||||
|   void DidStopLoading() override; | ||||
|   void DidGetResourceResponseStart( | ||||
|       const content::ResourceRequestDetails& details) override; | ||||
|   void DidGetRedirectForResourceRequest( | ||||
|  | @ -198,8 +198,7 @@ class WebContents : public mate::EventEmitter, | |||
|   void ElementSizeChanged(const gfx::Size& size) final; | ||||
|   content::WebContents* GetOwnerWebContents() const final; | ||||
|   void GuestSizeChanged(const gfx::Size& new_size) final; | ||||
|   void RegisterDestructionCallback(const DestructionCallback& callback) final; | ||||
|   void SetGuestSizer(content::GuestSizer* guest_sizer) final; | ||||
|   void SetGuestHost(content::GuestHost* guest_host) final; | ||||
|   void WillAttach(content::WebContents* embedder_web_contents, | ||||
|                   int element_instance_id, | ||||
|                   bool is_full_page_plugin) final; | ||||
|  | @ -230,8 +229,6 @@ class WebContents : public mate::EventEmitter, | |||
|   // element.
 | ||||
|   int element_instance_id_; | ||||
| 
 | ||||
|   DestructionCallback destruction_callback_; | ||||
| 
 | ||||
|   // Stores whether the contents of the guest can be transparent.
 | ||||
|   bool guest_opaque_; | ||||
| 
 | ||||
|  | @ -248,8 +245,8 @@ class WebContents : public mate::EventEmitter, | |||
|   // element may not match the size of the guest.
 | ||||
|   gfx::Size guest_size_; | ||||
| 
 | ||||
|   // A pointer to the guest_sizer.
 | ||||
|   content::GuestSizer* guest_sizer_; | ||||
|   // A pointer to the guest_host.
 | ||||
|   content::GuestHost* guest_host_; | ||||
| 
 | ||||
|   // Indicates whether autosize mode is enabled or not.
 | ||||
|   bool auto_size_enabled_; | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<content::WebContents*> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, | ||||
|                      content::WebContents** out) { | ||||
|     atom::api::WebContents* contents; | ||||
|     if (!Converter<atom::api::WebContents*>::FromV8(isolate, val, &contents)) | ||||
|  | @ -27,7 +27,7 @@ struct Converter<content::WebContents*> { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<atom::WebViewManager::WebViewInfo> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> 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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("addGuest", &AddGuest); | ||||
|   dict.SetMethod("removeGuest", &RemoveGuest); | ||||
|  |  | |||
|  | @ -32,7 +32,7 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<PrintSettings> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, | ||||
|                      PrintSettings* out) { | ||||
|     mate::Dictionary dict; | ||||
|     if (!ConvertFromV8(isolate, val, &dict)) | ||||
|  | @ -462,7 +462,7 @@ mate::Handle<WebContents> Window::GetDevToolsWebContents( | |||
| 
 | ||||
| // static
 | ||||
| void Window::BuildPrototype(v8::Isolate* isolate, | ||||
|                             v8::Handle<v8::ObjectTemplate> prototype) { | ||||
|                             v8::Local<v8::ObjectTemplate> 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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   using atom::api::Window; | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   v8::Local<v8::Function> constructor = mate::CreateConstructor<Window>( | ||||
|       isolate, "BrowserWindow", base::Bind(&Window::New)); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("BrowserWindow", static_cast<v8::Handle<v8::Value>>(constructor)); | ||||
|   dict.Set("BrowserWindow", static_cast<v8::Local<v8::Value>>(constructor)); | ||||
| } | ||||
| 
 | ||||
| }  // namespace
 | ||||
|  |  | |||
|  | @ -40,7 +40,7 @@ class Window : public mate::EventEmitter, | |||
|                               const mate::Dictionary& options); | ||||
| 
 | ||||
|   static void BuildPrototype(v8::Isolate* isolate, | ||||
|                              v8::Handle<v8::ObjectTemplate> prototype); | ||||
|                              v8::Local<v8::ObjectTemplate> prototype); | ||||
| 
 | ||||
|   NativeWindow* window() const { return window_.get(); } | ||||
| 
 | ||||
|  | @ -160,7 +160,7 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<atom::NativeWindow*> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, | ||||
|                      atom::NativeWindow** out) { | ||||
|     // null would be tranfered to NULL.
 | ||||
|     if (val->IsNull()) { | ||||
|  |  | |||
|  | @ -43,13 +43,13 @@ bool EventEmitter::CallEmit(v8::Isolate* isolate, | |||
|                             content::WebContents* sender, | ||||
|                             IPC::Message* message, | ||||
|                             ValueArray args) { | ||||
|   v8::Handle<v8::Object> event; | ||||
|   v8::Local<v8::Object> event; | ||||
|   bool use_native_event = sender && message; | ||||
| 
 | ||||
|   if (use_native_event) { | ||||
|     mate::Handle<mate::Event> native_event = mate::Event::Create(isolate); | ||||
|     native_event->SetSenderAndMessage(sender, message); | ||||
|     event = v8::Handle<v8::Object>::Cast(native_event.ToV8()); | ||||
|     event = v8::Local<v8::Object>::Cast(native_event.ToV8()); | ||||
|   } else { | ||||
|     event = CreateEventObject(isolate); | ||||
|   } | ||||
|  |  | |||
|  | @ -22,7 +22,7 @@ namespace mate { | |||
| // Provide helperers to emit event in JavaScript.
 | ||||
| class EventEmitter : public Wrappable { | ||||
|  public: | ||||
|   typedef std::vector<v8::Handle<v8::Value>> ValueArray; | ||||
|   typedef std::vector<v8::Local<v8::Value>> ValueArray; | ||||
| 
 | ||||
|  protected: | ||||
|   EventEmitter(); | ||||
|  |  | |||
|  | @ -30,7 +30,7 @@ class AtomJavaScriptDialogManager : public content::JavaScriptDialogManager { | |||
|       const DialogClosedCallback& callback) override; | ||||
|   void CancelActiveAndPendingDialogs( | ||||
|       content::WebContents* web_contents) override {} | ||||
|   void WebContentsDestroyed(content::WebContents* web_contents) override {} | ||||
|   void ResetDialogState(content::WebContents* web_contents) override {}; | ||||
| }; | ||||
| 
 | ||||
| }  // namespace atom
 | ||||
|  |  | |||
|  | @ -4,10 +4,13 @@ | |||
| 
 | ||||
| #include "atom/browser/javascript_environment.h" | ||||
| 
 | ||||
| #include "gin/array_buffer.h" | ||||
| 
 | ||||
| namespace atom { | ||||
| 
 | ||||
| JavascriptEnvironment::JavascriptEnvironment() | ||||
|     : isolate_(isolate_holder_.isolate()), | ||||
|     : initialized_(Initialize()), | ||||
|       isolate_(isolate_holder_.isolate()), | ||||
|       isolate_scope_(isolate_), | ||||
|       locker_(isolate_), | ||||
|       handle_scope_(isolate_), | ||||
|  | @ -15,4 +18,11 @@ JavascriptEnvironment::JavascriptEnvironment() | |||
|       context_scope_(v8::Local<v8::Context>::New(isolate_, context_)) { | ||||
| } | ||||
| 
 | ||||
| bool JavascriptEnvironment::Initialize() { | ||||
|   gin::IsolateHolder::LoadV8Snapshot(); | ||||
|   gin::IsolateHolder::Initialize(gin::IsolateHolder::kNonStrictMode, | ||||
|                                  gin::ArrayBufferAllocator::SharedInstance()); | ||||
|   return true; | ||||
| } | ||||
| 
 | ||||
| }  // namespace atom
 | ||||
|  |  | |||
|  | @ -20,6 +20,9 @@ class JavascriptEnvironment { | |||
|   } | ||||
| 
 | ||||
|  private: | ||||
|   bool Initialize(); | ||||
| 
 | ||||
|   bool initialized_; | ||||
|   gin::IsolateHolder isolate_holder_; | ||||
|   v8::Isolate* isolate_; | ||||
|   v8::Isolate::Scope isolate_scope_; | ||||
|  |  | |||
|  | @ -840,7 +840,8 @@ void NativeWindowViews::GetDevToolsWindowWMClass( | |||
| } | ||||
| #endif | ||||
| 
 | ||||
| void NativeWindowViews::HandleMouseDown() { | ||||
| void NativeWindowViews::ActivateContents(content::WebContents* contents) { | ||||
|   NativeWindow::ActivateContents(contents); | ||||
|   // Hide menu bar when web view is clicked.
 | ||||
|   if (menu_bar_autohide_ && menu_bar_visible_) | ||||
|     SetMenuBarVisibility(false); | ||||
|  |  | |||
|  | @ -125,7 +125,7 @@ class NativeWindowViews : public NativeWindow, | |||
| #endif | ||||
| 
 | ||||
|   // content::WebContentsDelegate:
 | ||||
|   void HandleMouseDown() override; | ||||
|   void ActivateContents(content::WebContents* contents) override; | ||||
|   void HandleKeyboardEvent( | ||||
|       content::WebContents*, | ||||
|       const content::NativeWebKeyboardEvent& event) override; | ||||
|  |  | |||
|  | @ -71,8 +71,6 @@ base::WeakPtr<AdapterRequestJob> AdapterRequestJob::GetWeakPtr() { | |||
| } | ||||
| 
 | ||||
| void AdapterRequestJob::CreateErrorJobAndStart(int error_code) { | ||||
|   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | ||||
| 
 | ||||
|   real_job_ = new net::URLRequestErrorJob( | ||||
|       request(), network_delegate(), error_code); | ||||
|   real_job_->Start(); | ||||
|  | @ -81,25 +79,21 @@ void AdapterRequestJob::CreateErrorJobAndStart(int error_code) { | |||
| void AdapterRequestJob::CreateStringJobAndStart(const std::string& mime_type, | ||||
|                                                 const std::string& charset, | ||||
|                                                 const std::string& data) { | ||||
|   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | ||||
| 
 | ||||
|   real_job_ = new URLRequestStringJob( | ||||
|       request(), network_delegate(), mime_type, charset, data); | ||||
|   real_job_->Start(); | ||||
| } | ||||
| 
 | ||||
| void AdapterRequestJob::CreateBufferJobAndStart(const std::string& mime_type, | ||||
|                                                 const std::string& charset, | ||||
|                                                 v8::Local<v8::Object> buffer) { | ||||
|   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | ||||
| 
 | ||||
| void AdapterRequestJob::CreateBufferJobAndStart( | ||||
|     const std::string& mime_type, | ||||
|     const std::string& charset, | ||||
|     scoped_refptr<base::RefCountedBytes> data) { | ||||
|   real_job_ = new URLRequestBufferJob( | ||||
|       request(), network_delegate(), mime_type, charset, buffer); | ||||
|       request(), network_delegate(), mime_type, charset, data); | ||||
|   real_job_->Start(); | ||||
| } | ||||
| 
 | ||||
| void AdapterRequestJob::CreateFileJobAndStart(const base::FilePath& path) { | ||||
|   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | ||||
|   real_job_ = asar::CreateJobFromPath( | ||||
|       path, | ||||
|       request(), | ||||
|  | @ -111,8 +105,6 @@ void AdapterRequestJob::CreateFileJobAndStart(const base::FilePath& path) { | |||
| } | ||||
| 
 | ||||
| void AdapterRequestJob::CreateJobFromProtocolHandlerAndStart() { | ||||
|   DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | ||||
|   DCHECK(protocol_handler_); | ||||
|   real_job_ = protocol_handler_->MaybeCreateJob(request(), | ||||
|                                                 network_delegate()); | ||||
|   if (!real_job_.get()) | ||||
|  |  | |||
|  | @ -7,6 +7,7 @@ | |||
| 
 | ||||
| #include <string> | ||||
| 
 | ||||
| #include "base/memory/ref_counted_memory.h" | ||||
| #include "base/memory/weak_ptr.h" | ||||
| #include "net/url_request/url_request_job.h" | ||||
| #include "net/url_request/url_request_job_factory.h" | ||||
|  | @ -53,7 +54,7 @@ class AdapterRequestJob : public net::URLRequestJob { | |||
|                                const std::string& data); | ||||
|   void CreateBufferJobAndStart(const std::string& mime_type, | ||||
|                                const std::string& charset, | ||||
|                                v8::Local<v8::Object> buffer); | ||||
|                                scoped_refptr<base::RefCountedBytes> data); | ||||
|   void CreateFileJobAndStart(const base::FilePath& path); | ||||
|   void CreateJobFromProtocolHandlerAndStart(); | ||||
| 
 | ||||
|  |  | |||
|  | @ -10,18 +10,16 @@ | |||
| 
 | ||||
| namespace atom { | ||||
| 
 | ||||
| URLRequestBufferJob::URLRequestBufferJob(net::URLRequest* request, | ||||
|                                          net::NetworkDelegate* network_delegate, | ||||
|                                          const std::string& mime_type, | ||||
|                                          const std::string& charset, | ||||
|                                          v8::Local<v8::Object> data) | ||||
| URLRequestBufferJob::URLRequestBufferJob( | ||||
|     net::URLRequest* request, | ||||
|     net::NetworkDelegate* network_delegate, | ||||
|     const std::string& mime_type, | ||||
|     const std::string& charset, | ||||
|     scoped_refptr<base::RefCountedBytes> data) | ||||
|     : net::URLRequestSimpleJob(request, network_delegate), | ||||
|       mime_type_(mime_type), | ||||
|       charset_(charset), | ||||
|       buffer_data_(new base::RefCountedBytes()) { | ||||
|   auto input = reinterpret_cast<const unsigned char*>(node::Buffer::Data(data)); | ||||
|   size_t length = node::Buffer::Length(data); | ||||
|   buffer_data_->data().assign(input, input + length); | ||||
|       buffer_data_(data) { | ||||
| } | ||||
| 
 | ||||
| int URLRequestBufferJob::GetRefCountedData( | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ class URLRequestBufferJob : public net::URLRequestSimpleJob { | |||
|                       net::NetworkDelegate* network_delegate, | ||||
|                       const std::string& mime_type, | ||||
|                       const std::string& charset, | ||||
|                       v8::Local<v8::Object> buffer); | ||||
|                       scoped_refptr<base::RefCountedBytes> data); | ||||
| 
 | ||||
|   // URLRequestSimpleJob:
 | ||||
|   int GetRefCountedData(std::string* mime_type, | ||||
|  |  | |||
|  | @ -21,7 +21,7 @@ namespace { | |||
| 
 | ||||
| class Archive : public mate::Wrappable { | ||||
|  public: | ||||
|   static v8::Handle<v8::Value> Create(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> Create(v8::Isolate* isolate, | ||||
|                                       const base::FilePath& path) { | ||||
|     scoped_ptr<asar::Archive> 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<v8::Value> GetFileInfo(v8::Isolate* isolate, | ||||
|   v8::Local<v8::Value> 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<v8::Value> Stat(v8::Isolate* isolate, | ||||
|   v8::Local<v8::Value> 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<v8::Value> Readdir(v8::Isolate* isolate, | ||||
|   v8::Local<v8::Value> Readdir(v8::Isolate* isolate, | ||||
|                                 const base::FilePath& path) { | ||||
|     std::vector<base::FilePath> 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<v8::Value> Realpath(v8::Isolate* isolate, | ||||
|   v8::Local<v8::Value> 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<v8::Value> CopyFileOut(v8::Isolate* isolate, | ||||
|   v8::Local<v8::Value> 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<v8::Value> process, | ||||
|                      v8::Handle<v8::Value> require) { | ||||
|                      v8::Local<v8::Value> process, | ||||
|                      v8::Local<v8::Value> require) { | ||||
|   // Evaluate asar_init.coffee.
 | ||||
|   v8::Local<v8::Script> asar_init = v8::Script::Compile(v8::String::NewFromUtf8( | ||||
|       isolate, | ||||
|  | @ -131,8 +131,8 @@ void InitAsarSupport(v8::Isolate* isolate, | |||
|   v8::Local<v8::Value> result = asar_init->Run(); | ||||
| 
 | ||||
|   // Initialize asar support.
 | ||||
|   base::Callback<void(v8::Handle<v8::Value>, | ||||
|                       v8::Handle<v8::Value>, | ||||
|   base::Callback<void(v8::Local<v8::Value>, | ||||
|                       v8::Local<v8::Value>, | ||||
|                       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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("createArchive", &Archive::Create); | ||||
|   dict.SetMethod("initAsarSupport", &InitAsarSupport); | ||||
|  |  | |||
|  | @ -19,7 +19,7 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<ui::ClipboardType> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, | ||||
|                      ui::ClipboardType* out) { | ||||
|     std::string type; | ||||
|     if (!Converter<std::string>::FromV8(isolate, val, &type)) | ||||
|  | @ -78,8 +78,8 @@ void Clear(ui::ClipboardType type) { | |||
|   ui::Clipboard::GetForCurrentThread()->Clear(type); | ||||
| } | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("_has", &Has); | ||||
|   dict.SetMethod("_read", &Read); | ||||
|  |  | |||
|  | @ -16,15 +16,15 @@ namespace mate { | |||
| template<> | ||||
| struct Converter<std::map<std::string, std::string> > { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      std::map<std::string, std::string>* out) { | ||||
|     if (!val->IsObject()) | ||||
|       return false; | ||||
| 
 | ||||
|     v8::Handle<v8::Object> dict = val->ToObject(); | ||||
|     v8::Handle<v8::Array> keys = dict->GetOwnPropertyNames(); | ||||
|     v8::Local<v8::Object> dict = val->ToObject(); | ||||
|     v8::Local<v8::Array> keys = dict->GetOwnPropertyNames(); | ||||
|     for (uint32_t i = 0; i < keys->Length(); ++i) { | ||||
|       v8::Handle<v8::Value> key = keys->Get(i); | ||||
|       v8::Local<v8::Value> key = keys->Get(i); | ||||
|       (*out)[V8ToString(key)] = V8ToString(dict->Get(key)); | ||||
|     } | ||||
|     return true; | ||||
|  | @ -35,8 +35,8 @@ struct Converter<std::map<std::string, std::string> > { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   using crash_reporter::CrashReporter; | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("start", | ||||
|  |  | |||
|  | @ -23,7 +23,7 @@ IDWeakMap::IDWeakMap() | |||
| IDWeakMap::~IDWeakMap() { | ||||
| } | ||||
| 
 | ||||
| int32_t IDWeakMap::Add(v8::Isolate* isolate, v8::Handle<v8::Object> object) { | ||||
| int32_t IDWeakMap::Add(v8::Isolate* isolate, v8::Local<v8::Object> object) { | ||||
|   int32_t key = GetNextID(); | ||||
|   object->SetHiddenValue(mate::StringToV8(isolate, "IDWeakMapKey"), | ||||
|                          mate::Converter<int32_t>::ToV8(isolate, key)); | ||||
|  | @ -33,7 +33,7 @@ int32_t IDWeakMap::Add(v8::Isolate* isolate, v8::Handle<v8::Object> object) { | |||
|   return key; | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> IDWeakMap::Get(v8::Isolate* isolate, int32_t key) { | ||||
| v8::Local<v8::Value> 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<v8::ObjectTemplate> prototype) { | ||||
|                                v8::Local<v8::ObjectTemplate> 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<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   using atom::api::IDWeakMap; | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   v8::Local<v8::Function> constructor = mate::CreateConstructor<IDWeakMap>( | ||||
|  |  | |||
|  | @ -23,13 +23,13 @@ class IDWeakMap : public mate::Wrappable { | |||
|   IDWeakMap(); | ||||
| 
 | ||||
|   static void BuildPrototype(v8::Isolate* isolate, | ||||
|                              v8::Handle<v8::ObjectTemplate> prototype); | ||||
|                              v8::Local<v8::ObjectTemplate> prototype); | ||||
| 
 | ||||
|  private: | ||||
|   virtual ~IDWeakMap(); | ||||
| 
 | ||||
|   int32_t Add(v8::Isolate* isolate, v8::Handle<v8::Object> object); | ||||
|   v8::Handle<v8::Value> Get(v8::Isolate* isolate, int32_t key); | ||||
|   int32_t Add(v8::Isolate* isolate, v8::Local<v8::Object> object); | ||||
|   v8::Local<v8::Value> Get(v8::Isolate* isolate, int32_t key); | ||||
|   bool Has(int32_t key) const; | ||||
|   std::vector<int32_t> Keys() const; | ||||
|   void Remove(int32_t key); | ||||
|  |  | |||
|  | @ -145,14 +145,14 @@ mate::ObjectTemplateBuilder NativeImage::GetObjectTemplateBuilder( | |||
|       isolate, v8::Local<v8::ObjectTemplate>::New(isolate, template_)); | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> NativeImage::ToPNG(v8::Isolate* isolate) { | ||||
| v8::Local<v8::Value> NativeImage::ToPNG(v8::Isolate* isolate) { | ||||
|   scoped_refptr<base::RefCountedMemory> png = image_.As1xPNGBytes(); | ||||
|   return node::Buffer::New(isolate, | ||||
|                            reinterpret_cast<const char*>(png->front()), | ||||
|                            png->size()); | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> NativeImage::ToJPEG(v8::Isolate* isolate, int quality) { | ||||
| v8::Local<v8::Value> NativeImage::ToJPEG(v8::Isolate* isolate, int quality) { | ||||
|   std::vector<unsigned char> output; | ||||
|   gfx::JPEG1xEncodedDataFromImage(image_, quality, &output); | ||||
|   return node::Buffer::New(isolate, | ||||
|  | @ -225,7 +225,7 @@ mate::Handle<NativeImage> NativeImage::CreateFromPath( | |||
| 
 | ||||
| // static
 | ||||
| mate::Handle<NativeImage> NativeImage::CreateFromBuffer( | ||||
|     mate::Arguments* args, v8::Handle<v8::Value> buffer) { | ||||
|     mate::Arguments* args, v8::Local<v8::Value> buffer) { | ||||
|   double scale_factor = 1.; | ||||
|   args->GetNext(&scale_factor); | ||||
| 
 | ||||
|  | @ -258,8 +258,8 @@ mate::Handle<NativeImage> NativeImage::CreateFromDataURL( | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("createEmpty", &atom::api::NativeImage::CreateEmpty); | ||||
|   dict.SetMethod("createFromPath", &atom::api::NativeImage::CreateFromPath); | ||||
|  |  | |||
|  | @ -41,7 +41,7 @@ class NativeImage : public mate::Wrappable { | |||
|   static mate::Handle<NativeImage> CreateFromPath( | ||||
|       v8::Isolate* isolate, const base::FilePath& path); | ||||
|   static mate::Handle<NativeImage> CreateFromBuffer( | ||||
|       mate::Arguments* args, v8::Handle<v8::Value> buffer); | ||||
|       mate::Arguments* args, v8::Local<v8::Value> buffer); | ||||
|   static mate::Handle<NativeImage> CreateFromDataURL( | ||||
|       v8::Isolate* isolate, const GURL& url); | ||||
| 
 | ||||
|  | @ -59,8 +59,8 @@ class NativeImage : public mate::Wrappable { | |||
|       v8::Isolate* isolate) override; | ||||
| 
 | ||||
|  private: | ||||
|   v8::Handle<v8::Value> ToPNG(v8::Isolate* isolate); | ||||
|   v8::Handle<v8::Value> ToJPEG(v8::Isolate* isolate, int quality); | ||||
|   v8::Local<v8::Value> ToPNG(v8::Isolate* isolate); | ||||
|   v8::Local<v8::Value> ToJPEG(v8::Isolate* isolate, int quality); | ||||
|   std::string ToDataURL(); | ||||
|   bool IsEmpty(); | ||||
|   gfx::Size GetSize(); | ||||
|  |  | |||
|  | @ -13,8 +13,8 @@ | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("showItemInFolder", &platform_util::ShowItemInFolder); | ||||
|   dict.SetMethod("openItem", &platform_util::OpenItem); | ||||
|  |  | |||
|  | @ -10,41 +10,40 @@ | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| v8::Handle<v8::Object> CreateObjectWithName(v8::Isolate* isolate, | ||||
|                                             v8::Handle<v8::String> name) { | ||||
| v8::Local<v8::Object> CreateObjectWithName(v8::Isolate* isolate, | ||||
|                                             v8::Local<v8::String> name) { | ||||
|   v8::Local<v8::FunctionTemplate> t = v8::FunctionTemplate::New(isolate); | ||||
|   t->SetClassName(name); | ||||
|   return t->GetFunction()->NewInstance(); | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> GetHiddenValue(v8::Handle<v8::Object> object, | ||||
|                                      v8::Handle<v8::String> key) { | ||||
| v8::Local<v8::Value> GetHiddenValue(v8::Local<v8::Object> object, | ||||
|                                      v8::Local<v8::String> key) { | ||||
|   return object->GetHiddenValue(key); | ||||
| } | ||||
| 
 | ||||
| void SetHiddenValue(v8::Handle<v8::Object> object, | ||||
|                     v8::Handle<v8::String> key, | ||||
|                     v8::Handle<v8::Value> value) { | ||||
| void SetHiddenValue(v8::Local<v8::Object> object, | ||||
|                     v8::Local<v8::String> key, | ||||
|                     v8::Local<v8::Value> value) { | ||||
|   object->SetHiddenValue(key, value); | ||||
| } | ||||
| 
 | ||||
| int32_t GetObjectHash(v8::Handle<v8::Object> object) { | ||||
| int32_t GetObjectHash(v8::Local<v8::Object> object) { | ||||
|   return object->GetIdentityHash(); | ||||
| } | ||||
| 
 | ||||
| void SetDestructor(v8::Isolate* isolate, | ||||
|                    v8::Handle<v8::Object> object, | ||||
|                    v8::Handle<v8::Function> callback) { | ||||
|                    v8::Local<v8::Object> object, | ||||
|                    v8::Local<v8::Function> callback) { | ||||
|   atom::ObjectLifeMonitor::BindTo(isolate, object, callback); | ||||
| } | ||||
| 
 | ||||
| void TakeHeapSnapshot(v8::Isolate* isolate) { | ||||
|   isolate->GetHeapProfiler()->TakeHeapSnapshot( | ||||
|       mate::StringToV8(isolate, "test")); | ||||
|   isolate->GetHeapProfiler()->TakeHeapSnapshot(); | ||||
| } | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("createObjectWithName", &CreateObjectWithName); | ||||
|   dict.SetMethod("getHiddenValue", &GetHiddenValue); | ||||
|  |  | |||
|  | @ -49,7 +49,7 @@ AtomBindings::~AtomBindings() { | |||
| } | ||||
| 
 | ||||
| void AtomBindings::BindTo(v8::Isolate* isolate, | ||||
|                           v8::Handle<v8::Object> process) { | ||||
|                           v8::Local<v8::Object> process) { | ||||
|   v8::V8::SetFatalErrorHandler(FatalErrorCallback); | ||||
| 
 | ||||
|   mate::Dictionary dict(isolate, process); | ||||
|  |  | |||
|  | @ -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<v8::Object> process); | ||||
|   void BindTo(v8::Isolate* isolate, v8::Local<v8::Object> process); | ||||
| 
 | ||||
|  private: | ||||
|   void ActivateUVLoop(v8::Isolate* isolate); | ||||
|  |  | |||
|  | @ -11,8 +11,8 @@ namespace atom { | |||
| 
 | ||||
| // static
 | ||||
| void ObjectLifeMonitor::BindTo(v8::Isolate* isolate, | ||||
|                                v8::Handle<v8::Object> target, | ||||
|                                v8::Handle<v8::Value> destructor) { | ||||
|                                v8::Local<v8::Object> target, | ||||
|                                v8::Local<v8::Value> destructor) { | ||||
|   target->SetHiddenValue(MATE_STRING_NEW(isolate, "destructor"), destructor); | ||||
| 
 | ||||
|   ObjectLifeMonitor* olm = new ObjectLifeMonitor(); | ||||
|  |  | |||
|  | @ -13,8 +13,8 @@ namespace atom { | |||
| class ObjectLifeMonitor { | ||||
|  public: | ||||
|   static void BindTo(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Object> target, | ||||
|                      v8::Handle<v8::Value> destructor); | ||||
|                      v8::Local<v8::Object> target, | ||||
|                      v8::Local<v8::Value> destructor); | ||||
| 
 | ||||
|  private: | ||||
|   ObjectLifeMonitor(); | ||||
|  |  | |||
|  | @ -15,8 +15,9 @@ | |||
| #include "base/files/file.h" | ||||
| #include "base/logging.h" | ||||
| #include "base/pickle.h" | ||||
| #include "base/json/json_string_value_serializer.h" | ||||
| #include "base/json/json_reader.h" | ||||
| #include "base/strings/string_number_conversions.h" | ||||
| #include "base/values.h" | ||||
| 
 | ||||
| namespace asar { | ||||
| 
 | ||||
|  | @ -149,15 +150,15 @@ bool Archive::Init() { | |||
|   } | ||||
| 
 | ||||
|   std::string error; | ||||
|   JSONStringValueSerializer serializer(&header); | ||||
|   base::Value* value = serializer.Deserialize(NULL, &error); | ||||
|   base::JSONReader reader; | ||||
|   scoped_ptr<base::Value> value(reader.ReadToValue(header)); | ||||
|   if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) { | ||||
|     LOG(ERROR) << "Failed to parse header: " << error; | ||||
|     return false; | ||||
|   } | ||||
| 
 | ||||
|   header_size_ = 8 + size; | ||||
|   header_.reset(static_cast<base::DictionaryValue*>(value)); | ||||
|   header_.reset(static_cast<base::DictionaryValue*>(value.release())); | ||||
|   return true; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ namespace mate { | |||
| 
 | ||||
| // static
 | ||||
| bool Converter<ui::Accelerator>::FromV8( | ||||
|     v8::Isolate* isolate, v8::Handle<v8::Value> val, ui::Accelerator* out) { | ||||
|     v8::Isolate* isolate, v8::Local<v8::Value> val, ui::Accelerator* out) { | ||||
|   std::string keycode; | ||||
|   if (!ConvertFromV8(isolate, val, &keycode)) | ||||
|     return false; | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<ui::Accelerator> { | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Handle<v8::Value> val, | ||||
|   static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, | ||||
|                      ui::Accelerator* out); | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -14,12 +14,12 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<base::FilePath> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const base::FilePath& val) { | ||||
|     return Converter<base::FilePath::StringType>::ToV8(isolate, val.value()); | ||||
|   } | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      base::FilePath* out) { | ||||
|     base::FilePath::StringType path; | ||||
|     if (Converter<base::FilePath::StringType>::FromV8(isolate, val, &path)) { | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ | |||
| 
 | ||||
| namespace mate { | ||||
| 
 | ||||
| v8::Handle<v8::Value> Converter<gfx::Point>::ToV8(v8::Isolate* isolate, | ||||
| v8::Local<v8::Value> Converter<gfx::Point>::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<v8::Value> Converter<gfx::Point>::ToV8(v8::Isolate* isolate, | |||
| } | ||||
| 
 | ||||
| bool Converter<gfx::Point>::FromV8(v8::Isolate* isolate, | ||||
|                                    v8::Handle<v8::Value> val, | ||||
|                                    v8::Local<v8::Value> val, | ||||
|                                    gfx::Point* out) { | ||||
|   mate::Dictionary dict; | ||||
|   if (!ConvertFromV8(isolate, val, &dict)) | ||||
|  | @ -33,7 +33,7 @@ bool Converter<gfx::Point>::FromV8(v8::Isolate* isolate, | |||
|   return true; | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> Converter<gfx::Size>::ToV8(v8::Isolate* isolate, | ||||
| v8::Local<v8::Value> Converter<gfx::Size>::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<v8::Value> Converter<gfx::Size>::ToV8(v8::Isolate* isolate, | |||
| } | ||||
| 
 | ||||
| bool Converter<gfx::Size>::FromV8(v8::Isolate* isolate, | ||||
|                                   v8::Handle<v8::Value> val, | ||||
|                                   v8::Local<v8::Value> val, | ||||
|                                   gfx::Size* out) { | ||||
|   mate::Dictionary dict; | ||||
|   if (!ConvertFromV8(isolate, val, &dict)) | ||||
|  | @ -54,7 +54,7 @@ bool Converter<gfx::Size>::FromV8(v8::Isolate* isolate, | |||
|   return true; | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> Converter<gfx::Rect>::ToV8(v8::Isolate* isolate, | ||||
| v8::Local<v8::Value> Converter<gfx::Rect>::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<v8::Value> Converter<gfx::Rect>::ToV8(v8::Isolate* isolate, | |||
| } | ||||
| 
 | ||||
| bool Converter<gfx::Rect>::FromV8(v8::Isolate* isolate, | ||||
|                                   v8::Handle<v8::Value> val, | ||||
|                                   v8::Local<v8::Value> val, | ||||
|                                   gfx::Rect* out) { | ||||
|   mate::Dictionary dict; | ||||
|   if (!ConvertFromV8(isolate, val, &dict)) | ||||
|  | @ -80,7 +80,7 @@ bool Converter<gfx::Rect>::FromV8(v8::Isolate* isolate, | |||
| 
 | ||||
| template<> | ||||
| struct Converter<gfx::Display::TouchSupport> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const gfx::Display::TouchSupport& val) { | ||||
|     switch (val) { | ||||
|       case gfx::Display::TOUCH_SUPPORT_AVAILABLE: | ||||
|  | @ -93,7 +93,7 @@ struct Converter<gfx::Display::TouchSupport> { | |||
|   } | ||||
| }; | ||||
| 
 | ||||
| v8::Handle<v8::Value> Converter<gfx::Display>::ToV8(v8::Isolate* isolate, | ||||
| v8::Local<v8::Value> Converter<gfx::Display>::ToV8(v8::Isolate* isolate, | ||||
|                                                     const gfx::Display& val) { | ||||
|   mate::Dictionary dict(isolate, v8::Object::New(isolate)); | ||||
|   dict.Set("id", val.id()); | ||||
|  |  | |||
|  | @ -18,37 +18,37 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<gfx::Point> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const gfx::Point& val); | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      gfx::Point* out); | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct Converter<gfx::Size> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const gfx::Size& val); | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      gfx::Size* out); | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct Converter<gfx::Rect> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const gfx::Rect& val); | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      gfx::Rect* out); | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct Converter<gfx::Display> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const gfx::Display& val); | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      gfx::Display* out); | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -14,12 +14,12 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<GURL> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const GURL& val) { | ||||
|     return ConvertToV8(isolate, val.spec()); | ||||
|   } | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      GURL* out) { | ||||
|     std::string url; | ||||
|     if (Converter<std::string>::FromV8(isolate, val, &url)) { | ||||
|  |  | |||
|  | @ -11,7 +11,7 @@ | |||
| namespace mate { | ||||
| 
 | ||||
| bool Converter<gfx::ImageSkia>::FromV8(v8::Isolate* isolate, | ||||
|                                        v8::Handle<v8::Value> val, | ||||
|                                        v8::Local<v8::Value> val, | ||||
|                                        gfx::ImageSkia* out) { | ||||
|   gfx::Image image; | ||||
|   if (!ConvertFromV8(isolate, val, &image)) | ||||
|  | @ -22,7 +22,7 @@ bool Converter<gfx::ImageSkia>::FromV8(v8::Isolate* isolate, | |||
| } | ||||
| 
 | ||||
| bool Converter<gfx::Image>::FromV8(v8::Isolate* isolate, | ||||
|                                    v8::Handle<v8::Value> val, | ||||
|                                    v8::Local<v8::Value> val, | ||||
|                                    gfx::Image* out) { | ||||
|   if (val->IsNull()) | ||||
|     return true; | ||||
|  | @ -43,7 +43,7 @@ bool Converter<gfx::Image>::FromV8(v8::Isolate* isolate, | |||
|   return true; | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> Converter<gfx::Image>::ToV8(v8::Isolate* isolate, | ||||
| v8::Local<v8::Value> Converter<gfx::Image>::ToV8(v8::Isolate* isolate, | ||||
|                                                   const gfx::Image& val) { | ||||
|   return ConvertToV8(isolate, atom::api::NativeImage::Create(isolate, val)); | ||||
| } | ||||
|  |  | |||
|  | @ -17,16 +17,16 @@ namespace mate { | |||
| template<> | ||||
| struct Converter<gfx::ImageSkia> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      gfx::ImageSkia* out); | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct Converter<gfx::Image> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      gfx::Image* out); | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const gfx::Image& val); | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -12,13 +12,13 @@ namespace mate { | |||
| 
 | ||||
| template<> | ||||
| struct Converter<base::string16> { | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const base::string16& val) { | ||||
|     return MATE_STRING_NEW_FROM_UTF16( | ||||
|         isolate, reinterpret_cast<const uint16_t*>(val.data()), val.size()); | ||||
|   } | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      base::string16* out) { | ||||
|     if (!val->IsString()) | ||||
|       return false; | ||||
|  |  | |||
|  | @ -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<v8::Object> handle) { | ||||
|   bool UpdateAndCheckUniqueness(v8::Local<v8::Object> 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<int, v8::Handle<v8::Object> > HashToHandleMap; | ||||
|   typedef std::multimap<int, v8::Local<v8::Object> > HashToHandleMap; | ||||
|   HashToHandleMap unique_map_; | ||||
| 
 | ||||
|   int max_recursion_depth_; | ||||
|  | @ -202,7 +202,7 @@ v8::Local<v8::Value> V8ValueConverter::ToV8Object( | |||
| 
 | ||||
| base::Value* V8ValueConverter::FromV8ValueImpl( | ||||
|     FromV8ValueState* state, | ||||
|     v8::Handle<v8::Value> val, | ||||
|     v8::Local<v8::Value> val, | ||||
|     v8::Isolate* isolate) const { | ||||
|   CHECK(!val.IsEmpty()); | ||||
| 
 | ||||
|  | @ -267,7 +267,7 @@ base::Value* V8ValueConverter::FromV8ValueImpl( | |||
| } | ||||
| 
 | ||||
| base::Value* V8ValueConverter::FromV8Array( | ||||
|     v8::Handle<v8::Array> val, | ||||
|     v8::Local<v8::Array> val, | ||||
|     FromV8ValueState* state, | ||||
|     v8::Isolate* isolate) const { | ||||
|   if (!state->UpdateAndCheckUniqueness(val)) | ||||
|  |  | |||
|  | @ -43,9 +43,9 @@ class V8ValueConverter { | |||
|       const base::DictionaryValue* dictionary) const; | ||||
| 
 | ||||
|   base::Value* FromV8ValueImpl(FromV8ValueState* state, | ||||
|                                v8::Handle<v8::Value> value, | ||||
|                                v8::Local<v8::Value> value, | ||||
|                                v8::Isolate* isolate) const; | ||||
|   base::Value* FromV8Array(v8::Handle<v8::Array> array, | ||||
|   base::Value* FromV8Array(v8::Local<v8::Array> array, | ||||
|                            FromV8ValueState* state, | ||||
|                            v8::Isolate* isolate) const; | ||||
| 
 | ||||
|  |  | |||
|  | @ -10,7 +10,7 @@ | |||
| namespace mate { | ||||
| 
 | ||||
| bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate, | ||||
|                                               v8::Handle<v8::Value> val, | ||||
|                                               v8::Local<v8::Value> val, | ||||
|                                               base::DictionaryValue* out) { | ||||
|   scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter); | ||||
|   scoped_ptr<base::Value> value(converter->FromV8Value( | ||||
|  | @ -24,7 +24,7 @@ bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate, | |||
| } | ||||
| 
 | ||||
| bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate, | ||||
|                                         v8::Handle<v8::Value> val, | ||||
|                                         v8::Local<v8::Value> val, | ||||
|                                         base::ListValue* out) { | ||||
|   scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter); | ||||
|   scoped_ptr<base::Value> value(converter->FromV8Value( | ||||
|  | @ -37,7 +37,7 @@ bool Converter<base::ListValue>::FromV8(v8::Isolate* isolate, | |||
|   } | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> Converter<base::ListValue>::ToV8( | ||||
| v8::Local<v8::Value> Converter<base::ListValue>::ToV8( | ||||
|     v8::Isolate* isolate, | ||||
|     const base::ListValue& val) { | ||||
|   scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter); | ||||
|  |  | |||
|  | @ -17,16 +17,16 @@ namespace mate { | |||
| template<> | ||||
| struct Converter<base::DictionaryValue> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      base::DictionaryValue* out); | ||||
| }; | ||||
| 
 | ||||
| template<> | ||||
| struct Converter<base::ListValue> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      base::ListValue* out); | ||||
|   static v8::Handle<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, | ||||
|                                     const base::ListValue& val); | ||||
| }; | ||||
| 
 | ||||
|  |  | |||
|  | @ -62,8 +62,8 @@ base::string16 SendSync(const base::string16& channel, | |||
|   return json; | ||||
| } | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   mate::Dictionary dict(context->GetIsolate(), exports); | ||||
|   dict.SetMethod("send", &Send); | ||||
|   dict.SetMethod("sendSync", &SendSync); | ||||
|  |  | |||
|  | @ -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<v8::Object> provider) | ||||
|                                    v8::Local<v8::Object> 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<v8::Value> word = mate::ConvertToV8(isolate_, word_to_check); | ||||
|   v8::Handle<v8::Value> result = spell_check_.NewHandle()->Call( | ||||
|   v8::Local<v8::Value> word = mate::ConvertToV8(isolate_, word_to_check); | ||||
|   v8::Local<v8::Value> result = spell_check_.NewHandle()->Call( | ||||
|       provider_.NewHandle(), 1, &word); | ||||
| 
 | ||||
|   if (result->IsBoolean()) | ||||
|  |  | |||
|  | @ -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<v8::Object> provider); | ||||
|                    v8::Local<v8::Object> provider); | ||||
|   virtual ~SpellCheckClient(); | ||||
| 
 | ||||
|  private: | ||||
|  |  | |||
|  | @ -27,7 +27,7 @@ namespace mate { | |||
| template<> | ||||
| struct Converter<WTF::String> { | ||||
|   static bool FromV8(v8::Isolate* isolate, | ||||
|                      v8::Handle<v8::Value> val, | ||||
|                      v8::Local<v8::Value> val, | ||||
|                      WTF::String* out) { | ||||
|     if (!val->IsString()) | ||||
|       return false; | ||||
|  | @ -72,8 +72,8 @@ double WebFrame::GetZoomFactor() const { | |||
|   return blink::WebView::zoomLevelToZoomFactor(GetZoomLevel()); | ||||
| } | ||||
| 
 | ||||
| v8::Handle<v8::Value> WebFrame::RegisterEmbedderCustomElement( | ||||
|     const base::string16& name, v8::Handle<v8::Object> options) { | ||||
| v8::Local<v8::Value> WebFrame::RegisterEmbedderCustomElement( | ||||
|     const base::string16& name, v8::Local<v8::Object> 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<v8::Object> provider) { | ||||
|                                      v8::Local<v8::Object> provider) { | ||||
|   if (!provider->Has(mate::StringToV8(args->isolate(), "spellCheck"))) { | ||||
|     args->ThrowError("\"spellCheck\" has to be defined"); | ||||
|     return; | ||||
|  | @ -123,8 +123,8 @@ mate::Handle<WebFrame> WebFrame::Create(v8::Isolate* isolate) { | |||
| 
 | ||||
| namespace { | ||||
| 
 | ||||
| void Initialize(v8::Handle<v8::Object> exports, v8::Handle<v8::Value> unused, | ||||
|                 v8::Handle<v8::Context> context, void* priv) { | ||||
| void Initialize(v8::Local<v8::Object> exports, v8::Local<v8::Value> unused, | ||||
|                 v8::Local<v8::Context> context, void* priv) { | ||||
|   v8::Isolate* isolate = context->GetIsolate(); | ||||
|   mate::Dictionary dict(isolate, exports); | ||||
|   dict.Set("webFrame", atom::api::WebFrame::Create(isolate)); | ||||
|  |  | |||
|  | @ -40,15 +40,15 @@ class WebFrame : public mate::Wrappable { | |||
|   double SetZoomFactor(double factor); | ||||
|   double GetZoomFactor() const; | ||||
| 
 | ||||
|   v8::Handle<v8::Value> RegisterEmbedderCustomElement( | ||||
|       const base::string16& name, v8::Handle<v8::Object> options); | ||||
|   v8::Local<v8::Value> RegisterEmbedderCustomElement( | ||||
|       const base::string16& name, v8::Local<v8::Object> 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<v8::Object> provider); | ||||
|                              v8::Local<v8::Object> provider); | ||||
| 
 | ||||
|   // mate::Wrappable:
 | ||||
|   virtual mate::ObjectTemplateBuilder GetObjectTemplateBuilder( | ||||
|  |  | |||
|  | @ -30,21 +30,21 @@ namespace atom { | |||
| namespace { | ||||
| 
 | ||||
| bool GetIPCObject(v8::Isolate* isolate, | ||||
|                   v8::Handle<v8::Context> context, | ||||
|                   v8::Handle<v8::Object>* ipc) { | ||||
|   v8::Handle<v8::String> key = mate::StringToV8(isolate, "ipc"); | ||||
|   v8::Handle<v8::Value> value = context->Global()->GetHiddenValue(key); | ||||
|                   v8::Local<v8::Context> context, | ||||
|                   v8::Local<v8::Object>* ipc) { | ||||
|   v8::Local<v8::String> key = mate::StringToV8(isolate, "ipc"); | ||||
|   v8::Local<v8::Value> value = context->Global()->GetHiddenValue(key); | ||||
|   if (value.IsEmpty() || !value->IsObject()) | ||||
|     return false; | ||||
|   *ipc = value->ToObject(); | ||||
|   return true; | ||||
| } | ||||
| 
 | ||||
| std::vector<v8::Handle<v8::Value>> ListValueToVector( | ||||
| std::vector<v8::Local<v8::Value>> ListValueToVector( | ||||
|     v8::Isolate* isolate, | ||||
|     const base::ListValue& list) { | ||||
|   v8::Handle<v8::Value> array = mate::ConvertToV8(isolate, list); | ||||
|   std::vector<v8::Handle<v8::Value>> result; | ||||
|   v8::Local<v8::Value> array = mate::ConvertToV8(isolate, list); | ||||
|   std::vector<v8::Local<v8::Value>> result; | ||||
|   mate::ConvertFromV8(isolate, array, &result); | ||||
|   return result; | ||||
| } | ||||
|  | @ -119,11 +119,11 @@ void AtomRenderViewObserver::OnBrowserMessage(const base::string16& channel, | |||
|   v8::Local<v8::Context> context = frame->mainWorldScriptContext(); | ||||
|   v8::Context::Scope context_scope(context); | ||||
| 
 | ||||
|   std::vector<v8::Handle<v8::Value>> arguments = ListValueToVector( | ||||
|   std::vector<v8::Local<v8::Value>> arguments = ListValueToVector( | ||||
|       isolate, args); | ||||
|   arguments.insert(arguments.begin(), mate::ConvertToV8(isolate, channel)); | ||||
| 
 | ||||
|   v8::Handle<v8::Object> ipc; | ||||
|   v8::Local<v8::Object> ipc; | ||||
|   if (GetIPCObject(isolate, context, &ipc)) | ||||
|     node::MakeCallback(isolate, ipc, "emit", arguments.size(), &arguments[0]); | ||||
| } | ||||
|  |  | |||
|  | @ -11,14 +11,16 @@ | |||
| #include "atom/common/options_switches.h" | ||||
| #include "atom/renderer/atom_render_view_observer.h" | ||||
| #include "atom/renderer/guest_view_container.h" | ||||
| #include "base/command_line.h" | ||||
| #include "chrome/renderer/pepper/pepper_helper.h" | ||||
| #include "chrome/renderer/printing/print_web_view_helper.h" | ||||
| #include "chrome/renderer/tts_dispatcher.h" | ||||
| #include "content/public/common/content_constants.h" | ||||
| #include "content/public/renderer/render_frame.h" | ||||
| #include "content/public/renderer/render_frame_observer.h" | ||||
| #include "content/public/renderer/render_thread.h" | ||||
| #include "base/command_line.h" | ||||
| #include "third_party/WebKit/public/web/WebCustomElement.h" | ||||
| #include "third_party/WebKit/public/web/WebFrame.h" | ||||
| #include "third_party/WebKit/public/web/WebLocalFrame.h" | ||||
| #include "third_party/WebKit/public/web/WebPluginParams.h" | ||||
| #include "third_party/WebKit/public/web/WebKit.h" | ||||
| #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | ||||
|  | @ -46,6 +48,28 @@ bool IsGuestFrame(blink::WebFrame* frame) { | |||
|   return frame->uniqueName().utf8() == "ATOM_SHELL_GUEST_WEB_VIEW"; | ||||
| } | ||||
| 
 | ||||
| // Helper class to forward the messages to the client.
 | ||||
| class AtomRenderFrameObserver : public content::RenderFrameObserver { | ||||
|  public: | ||||
|   AtomRenderFrameObserver(content::RenderFrame* frame, | ||||
|                           AtomRendererClient* renderer_client) | ||||
|       : content::RenderFrameObserver(frame), | ||||
|         renderer_client_(renderer_client) {} | ||||
| 
 | ||||
|   // content::RenderFrameObserver:
 | ||||
|   void DidCreateScriptContext(v8::Handle<v8::Context> context, | ||||
|                               int extension_group, | ||||
|                               int world_id) { | ||||
|     renderer_client_->DidCreateScriptContext( | ||||
|         render_frame()->GetWebFrame(), context); | ||||
|   } | ||||
| 
 | ||||
|  private: | ||||
|   AtomRendererClient* renderer_client_; | ||||
| 
 | ||||
|   DISALLOW_COPY_AND_ASSIGN(AtomRenderFrameObserver); | ||||
| }; | ||||
| 
 | ||||
| }  // namespace
 | ||||
| 
 | ||||
| AtomRendererClient::AtomRendererClient() | ||||
|  | @ -83,6 +107,7 @@ void AtomRendererClient::RenderThreadStarted() { | |||
| void AtomRendererClient::RenderFrameCreated( | ||||
|     content::RenderFrame* render_frame) { | ||||
|   new PepperHelper(render_frame); | ||||
|   new AtomRenderFrameObserver(render_frame, this); | ||||
| } | ||||
| 
 | ||||
| void AtomRendererClient::RenderViewCreated(content::RenderView* render_view) { | ||||
|  | @ -109,10 +134,9 @@ bool AtomRendererClient::OverrideCreatePlugin( | |||
|   return true; | ||||
| } | ||||
| 
 | ||||
| void AtomRendererClient::DidCreateScriptContext(blink::WebFrame* frame, | ||||
|                                                 v8::Handle<v8::Context> context, | ||||
|                                                 int extension_group, | ||||
|                                                 int world_id) { | ||||
| void AtomRendererClient::DidCreateScriptContext( | ||||
|     blink::WebFrame* frame, | ||||
|     v8::Handle<v8::Context> context) { | ||||
|   // Only attach node bindings in main frame or guest frame.
 | ||||
|   if (!IsGuestFrame(frame)) { | ||||
|     if (main_frame_) | ||||
|  |  | |||
|  | @ -21,6 +21,9 @@ class AtomRendererClient : public content::ContentRendererClient, | |||
|   AtomRendererClient(); | ||||
|   virtual ~AtomRendererClient(); | ||||
| 
 | ||||
|   void DidCreateScriptContext(blink::WebFrame* frame, | ||||
|                               v8::Handle<v8::Context> context); | ||||
| 
 | ||||
|  private: | ||||
|   enum NodeIntegration { | ||||
|     ALL, | ||||
|  | @ -42,10 +45,6 @@ class AtomRendererClient : public content::ContentRendererClient, | |||
|                             blink::WebLocalFrame* frame, | ||||
|                             const blink::WebPluginParams& params, | ||||
|                             blink::WebPlugin** plugin) override; | ||||
|   void DidCreateScriptContext(blink::WebFrame* frame, | ||||
|                               v8::Handle<v8::Context> context, | ||||
|                               int extension_group, | ||||
|                               int world_id) override; | ||||
|   bool ShouldFork(blink::WebFrame* frame, | ||||
|                   const GURL& url, | ||||
|                   const std::string& http_method, | ||||
|  |  | |||
|  | @ -7,7 +7,7 @@ import sys | |||
| 
 | ||||
| 
 | ||||
| BASE_URL = 'http://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' | ||||
| LIBCHROMIUMCONTENT_COMMIT = '90a5b9c3792645067ad9517e60cf5eb99730e0f9' | ||||
| LIBCHROMIUMCONTENT_COMMIT = '1a1ecefebd8aef44cf0dafe6f4315ecdd367e54c' | ||||
| 
 | ||||
| PLATFORM = { | ||||
|   'cygwin': 'win32', | ||||
|  |  | |||
							
								
								
									
										2
									
								
								vendor/brightray
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/brightray
									
										
									
									
										vendored
									
									
								
							|  | @ -1 +1 @@ | |||
| Subproject commit 2cd0e42cb8375f2793df531f5668d4414fe38698 | ||||
| Subproject commit 748e5b922456f352a7cc54c0705d0a997f926a18 | ||||
							
								
								
									
										2
									
								
								vendor/native_mate
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/native_mate
									
										
									
									
										vendored
									
									
								
							|  | @ -1 +1 @@ | |||
| Subproject commit 047a8de9342a3217a8d8316f77b9276e8eb7a649 | ||||
| Subproject commit 1696237a3f444f0e33a8947749b4d70f6feb511b | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Cheng Zhao
				Cheng Zhao