diff --git a/atom/browser/api/atom_api_content_tracing.cc b/atom/browser/api/atom_api_content_tracing.cc index 0eff59137..42295fd26 100644 --- a/atom/browser/api/atom_api_content_tracing.cc +++ b/atom/browser/api/atom_api_content_tracing.cc @@ -69,14 +69,17 @@ void Initialize(v8::Handle exports, v8::Handle unused, dict.SetMethod("startRecording", base::Bind( &TracingController::EnableRecording, base::Unretained(controller))); dict.SetMethod("stopRecording", base::Bind( - &TracingController::DisableRecording, base::Unretained(controller))); + &TracingController::DisableRecording, + base::Unretained(controller), + nullptr)); dict.SetMethod("startMonitoring", base::Bind( &TracingController::EnableMonitoring, base::Unretained(controller))); dict.SetMethod("stopMonitoring", base::Bind( &TracingController::DisableMonitoring, base::Unretained(controller))); dict.SetMethod("captureMonitoringSnapshot", base::Bind( &TracingController::CaptureMonitoringSnapshot, - base::Unretained(controller))); + base::Unretained(controller), + nullptr)); dict.SetMethod("getTraceBufferPercentFull", base::Bind( &TracingController::GetTraceBufferPercentFull, base::Unretained(controller))); diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 9115cbc82..427a22810 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -225,28 +225,12 @@ void WebContents::WebContentsDestroyed() { Emit("destroyed"); } -void WebContents::WillAttach(content::WebContents* embedder_web_contents, - const base::DictionaryValue& extra_params) { - embedder_web_contents_ = embedder_web_contents; - extra_params_.reset(extra_params.DeepCopy()); -} - -content::WebContents* WebContents::CreateNewGuestWindow( - const content::WebContents::CreateParams& create_params) { - NOTREACHED() << "Should not create new window from guest"; - return nullptr; -} - -void WebContents::DidAttach() { +void WebContents::DidAttach(int guest_proxy_routing_id) { base::ListValue args; args.Append(extra_params_.release()); Emit("did-attach", args); } -int WebContents::GetGuestInstanceID() const { - return guest_instance_id_; -} - void WebContents::ElementSizeChanged(const gfx::Size& old_size, const gfx::Size& new_size) { element_size_ = new_size; @@ -260,18 +244,16 @@ void WebContents::GuestSizeChanged(const gfx::Size& old_size, GuestSizeChangedDueToAutoSize(old_size, new_size); } -void WebContents::RequestPointerLockPermission( - bool user_gesture, - bool last_unlocked_by_target, - const base::Callback& callback) { - callback.Run(true); -} - void WebContents::RegisterDestructionCallback( const DestructionCallback& callback) { destruction_callback_ = callback; } +void WebContents::WillAttach(content::WebContents* embedder_web_contents, + int browser_plugin_instance_id) { + embedder_web_contents_ = embedder_web_contents; +} + void WebContents::Destroy() { if (storage_) { if (!destruction_callback_.is_null()) @@ -294,7 +276,7 @@ void WebContents::LoadURL(const GURL& url, const mate::Dictionary& options) { params.referrer = content::Referrer(http_referrer.GetAsReferrer(), blink::WebReferrerPolicyDefault); - params.transition_type = content::PAGE_TRANSITION_TYPED; + params.transition_type = ui::PAGE_TRANSITION_TYPED; params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; web_contents()->GetController().LoadURLWithParams(params); } diff --git a/atom/browser/api/atom_api_web_contents.h b/atom/browser/api/atom_api_web_contents.h index 7f6a69719..f6442e8a8 100644 --- a/atom/browser/api/atom_api_web_contents.h +++ b/atom/browser/api/atom_api_web_contents.h @@ -138,22 +138,14 @@ class WebContents : public mate::EventEmitter, virtual void WebContentsDestroyed() override; // content::BrowserPluginGuestDelegate: - virtual void WillAttach(content::WebContents* embedder_web_contents, - const base::DictionaryValue& extra_params) override; - virtual content::WebContents* CreateNewGuestWindow( - const content::WebContents::CreateParams& create_params) override; - virtual void DidAttach() override; - virtual int GetGuestInstanceID() const override; - virtual void ElementSizeChanged(const gfx::Size& old_size, - const gfx::Size& new_size) override; - virtual void GuestSizeChanged(const gfx::Size& old_size, - const gfx::Size& new_size) override; - virtual void RequestPointerLockPermission( - bool user_gesture, - bool last_unlocked_by_target, - const base::Callback& callback) override; - virtual void RegisterDestructionCallback( - const DestructionCallback& callback) override; + void DidAttach(int guest_proxy_routing_id) final; + void ElementSizeChanged(const gfx::Size& old_size, + const gfx::Size& new_size) final; + void GuestSizeChanged(const gfx::Size& old_size, + const gfx::Size& new_size) final; + void RegisterDestructionCallback(const DestructionCallback& callback) final; + void WillAttach(content::WebContents* embedder_web_contents, + int browser_plugin_instance_id) final; private: // Called when received a message from renderer. diff --git a/atom/browser/javascript_environment.cc b/atom/browser/javascript_environment.cc index e0dd7d54f..f8dd71f47 100644 --- a/atom/browser/javascript_environment.cc +++ b/atom/browser/javascript_environment.cc @@ -7,8 +7,7 @@ namespace atom { JavascriptEnvironment::JavascriptEnvironment() - : isolate_holder_(gin::IsolateHolder::kNonStrictMode), - isolate_(isolate_holder_.isolate()), + : isolate_(isolate_holder_.isolate()), isolate_scope_(isolate_), locker_(isolate_), handle_scope_(isolate_), diff --git a/atom/browser/net/adapter_request_job.cc b/atom/browser/net/adapter_request_job.cc index eabd65553..6b5b905ab 100644 --- a/atom/browser/net/adapter_request_job.cc +++ b/atom/browser/net/adapter_request_job.cc @@ -22,7 +22,7 @@ AdapterRequestJob::AdapterRequestJob(ProtocolHandler* protocol_handler, } void AdapterRequestJob::Start() { - DCHECK(!real_job_); + DCHECK(!real_job_.get()); content::BrowserThread::PostTask( content::BrowserThread::UI, FROM_HERE, @@ -31,35 +31,35 @@ void AdapterRequestJob::Start() { } void AdapterRequestJob::Kill() { - if (real_job_) // Kill could happen when real_job_ is created. + if (real_job_.get()) // Kill could happen when real_job_ is created. real_job_->Kill(); } bool AdapterRequestJob::ReadRawData(net::IOBuffer* buf, int buf_size, int *bytes_read) { - DCHECK(real_job_); + DCHECK(!real_job_.get()); return real_job_->ReadRawData(buf, buf_size, bytes_read); } bool AdapterRequestJob::IsRedirectResponse(GURL* location, int* http_status_code) { - DCHECK(real_job_); + DCHECK(!real_job_.get()); return real_job_->IsRedirectResponse(location, http_status_code); } net::Filter* AdapterRequestJob::SetupFilter() const { - DCHECK(real_job_); + DCHECK(!real_job_.get()); return real_job_->SetupFilter(); } bool AdapterRequestJob::GetMimeType(std::string* mime_type) const { - DCHECK(real_job_); + DCHECK(!real_job_.get()); return real_job_->GetMimeType(mime_type); } bool AdapterRequestJob::GetCharset(std::string* charset) { - DCHECK(real_job_); + DCHECK(!real_job_.get()); return real_job_->GetCharset(charset); } diff --git a/atom/browser/web_view/web_view_manager.cc b/atom/browser/web_view/web_view_manager.cc index 5dd427c6a..bc308deba 100644 --- a/atom/browser/web_view/web_view_manager.cc +++ b/atom/browser/web_view/web_view_manager.cc @@ -75,14 +75,13 @@ void WebViewManager::RemoveGuest(int guest_instance_id) { web_contents_map_.erase(guest_instance_id); } -void WebViewManager::MaybeGetGuestByInstanceIDOrKill( - int guest_instance_id, - int embedder_render_process_id, - const GuestByInstanceIDCallback& callback) { +content::WebContents* WebViewManager::GetGuestByInstanceID( + content::WebContents* embedder_web_contents, + int guest_instance_id) { if (ContainsKey(web_contents_map_, guest_instance_id)) - callback.Run(web_contents_map_[guest_instance_id].web_contents); + return web_contents_map_[guest_instance_id].web_contents; else - callback.Run(nullptr); + return nullptr; } bool WebViewManager::ForEachGuest(content::WebContents* embedder_web_contents, diff --git a/atom/browser/web_view/web_view_manager.h b/atom/browser/web_view/web_view_manager.h index e68744089..fb118251e 100644 --- a/atom/browser/web_view/web_view_manager.h +++ b/atom/browser/web_view/web_view_manager.h @@ -8,6 +8,7 @@ #include #include "content/public/browser/browser_plugin_guest_manager.h" +#include "url/gurl.h" namespace content { class BrowserContext; @@ -30,12 +31,11 @@ class WebViewManager : public content::BrowserPluginGuestManager { protected: // content::BrowserPluginGuestManager: - virtual void MaybeGetGuestByInstanceIDOrKill( - int guest_instance_id, - int embedder_render_process_id, - const GuestByInstanceIDCallback& callback) override; - virtual bool ForEachGuest(content::WebContents* embedder_web_contents, - const GuestCallback& callback) override; + content::WebContents* GetGuestByInstanceID( + content::WebContents* embedder_web_contents, + int browser_plugin_instance_id) override; + bool ForEachGuest(content::WebContents* embedder_web_contents, + const GuestCallback& callback) override; private: struct WebContentsWithEmbedder { diff --git a/atom/common/api/atom_api_clipboard.cc b/atom/common/api/atom_api_clipboard.cc index ee6cc0ccc..36b8cecb7 100644 --- a/atom/common/api/atom_api_clipboard.cc +++ b/atom/common/api/atom_api_clipboard.cc @@ -58,8 +58,7 @@ base::string16 ReadText(ui::ClipboardType type) { } void WriteText(const base::string16& text, ui::ClipboardType type) { - ui::Clipboard* clipboard = ui::Clipboard::GetForCurrentThread(); - ui::ScopedClipboardWriter writer(clipboard, type); + ui::ScopedClipboardWriter writer(type); writer.WriteText(text); }