diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 15:28:34 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 13:54:51 +0000 |
commit | 2a19c63448c84c1805fb1a585c3651318bb86ca7 (patch) | |
tree | eb17888e8531aa6ee5e85721bd553b832a7e5156 /chromium/components/guest_view | |
parent | b014812705fc80bff0a5c120dfcef88f349816dc (diff) | |
download | qtwebengine-chromium-2a19c63448c84c1805fb1a585c3651318bb86ca7.tar.gz |
BASELINE: Update Chromium to 69.0.3497.70
Change-Id: I2b7b56e4e7a8b26656930def0d4575dc32b900a0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/guest_view')
4 files changed, 18 insertions, 20 deletions
diff --git a/chromium/components/guest_view/browser/guest_view_base.cc b/chromium/components/guest_view/browser/guest_view_base.cc index 8f31866db03..7b1a30f6189 100644 --- a/chromium/components/guest_view/browser/guest_view_base.cc +++ b/chromium/components/guest_view/browser/guest_view_base.cc @@ -187,7 +187,7 @@ GuestViewBase::GuestViewBase(WebContents* owner_web_contents) GuestViewBase::~GuestViewBase() {} void GuestViewBase::Init(const base::DictionaryValue& create_params, - const WebContentsCreatedCallback& callback) { + WebContentsCreatedCallback callback) { if (initialized_) return; initialized_ = true; @@ -196,16 +196,15 @@ void GuestViewBase::Init(const base::DictionaryValue& create_params, // The derived class did not create a WebContents so this class serves no // purpose. Let's self-destruct. delete this; - callback.Run(nullptr); + std::move(callback).Run(nullptr); return; } std::unique_ptr<base::DictionaryValue> params(create_params.DeepCopy()); CreateWebContents(create_params, - base::Bind(&GuestViewBase::CompleteInit, - weak_ptr_factory_.GetWeakPtr(), - base::Passed(¶ms), - callback)); + base::BindOnce(&GuestViewBase::CompleteInit, + weak_ptr_factory_.GetWeakPtr(), + base::Passed(¶ms), std::move(callback))); } void GuestViewBase::InitWithWebContents( @@ -783,17 +782,17 @@ void GuestViewBase::SendQueuedEvents() { void GuestViewBase::CompleteInit( std::unique_ptr<base::DictionaryValue> create_params, - const WebContentsCreatedCallback& callback, + WebContentsCreatedCallback callback, WebContents* guest_web_contents) { if (!guest_web_contents) { // The derived class did not create a WebContents so this class serves no // purpose. Let's self-destruct. delete this; - callback.Run(nullptr); + std::move(callback).Run(nullptr); return; } InitWithWebContents(*create_params, guest_web_contents); - callback.Run(guest_web_contents); + std::move(callback).Run(guest_web_contents); } double GuestViewBase::GetEmbedderZoomFactor() const { diff --git a/chromium/components/guest_view/browser/guest_view_base.h b/chromium/components/guest_view/browser/guest_view_base.h index 32341e9197a..fc5b48c0f9a 100644 --- a/chromium/components/guest_view/browser/guest_view_base.h +++ b/chromium/components/guest_view/browser/guest_view_base.h @@ -120,9 +120,9 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate, // This creates a WebContents and initializes |this| GuestViewBase to use the // newly created WebContents. using WebContentsCreatedCallback = - base::Callback<void(content::WebContents*)>; + base::OnceCallback<void(content::WebContents*)>; void Init(const base::DictionaryValue& create_params, - const WebContentsCreatedCallback& callback); + WebContentsCreatedCallback callback); void InitWithWebContents(const base::DictionaryValue& create_params, content::WebContents* guest_web_contents); @@ -233,9 +233,8 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate, // Given a set of initialization parameters, a concrete subclass of // GuestViewBase can create a specialized WebContents that it returns back to // GuestViewBase. - virtual void CreateWebContents( - const base::DictionaryValue& create_params, - const WebContentsCreatedCallback& callback) = 0; + virtual void CreateWebContents(const base::DictionaryValue& create_params, + WebContentsCreatedCallback callback) = 0; // This method is called after the guest has been attached to an embedder and // suspended resource loads have been resumed. @@ -386,7 +385,7 @@ class GuestViewBase : public content::BrowserPluginGuestDelegate, void SendQueuedEvents(); void CompleteInit(std::unique_ptr<base::DictionaryValue> create_params, - const WebContentsCreatedCallback& callback, + WebContentsCreatedCallback callback, content::WebContents* guest_web_contents); // Dispatches the onResize event to the embedder. diff --git a/chromium/components/guest_view/browser/guest_view_manager.cc b/chromium/components/guest_view/browser/guest_view_manager.cc index a18eacb3b74..0671c3cd7d7 100644 --- a/chromium/components/guest_view/browser/guest_view_manager.cc +++ b/chromium/components/guest_view/browser/guest_view_manager.cc @@ -174,13 +174,13 @@ int GuestViewManager::GetNextInstanceID() { void GuestViewManager::CreateGuest(const std::string& view_type, content::WebContents* owner_web_contents, const base::DictionaryValue& create_params, - const WebContentsCreatedCallback& callback) { + WebContentsCreatedCallback callback) { GuestViewBase* guest = CreateGuestInternal(owner_web_contents, view_type); if (!guest) { - callback.Run(nullptr); + std::move(callback).Run(nullptr); return; } - guest->Init(create_params, callback); + guest->Init(create_params, std::move(callback)); } content::WebContents* GuestViewManager::CreateGuestWithWebContentsParams( diff --git a/chromium/components/guest_view/browser/guest_view_manager.h b/chromium/components/guest_view/browser/guest_view_manager.h index 9045a219f5b..84a8cda92a0 100644 --- a/chromium/components/guest_view/browser/guest_view_manager.h +++ b/chromium/components/guest_view/browser/guest_view_manager.h @@ -107,11 +107,11 @@ class GuestViewManager : public content::BrowserPluginGuestManager, const base::Closure& callback); using WebContentsCreatedCallback = - base::Callback<void(content::WebContents*)>; + base::OnceCallback<void(content::WebContents*)>; void CreateGuest(const std::string& view_type, content::WebContents* owner_web_contents, const base::DictionaryValue& create_params, - const WebContentsCreatedCallback& callback); + WebContentsCreatedCallback callback); content::WebContents* CreateGuestWithWebContentsParams( const std::string& view_type, |