Commit b62b8b5c authored by avi's avatar avi Committed by Commit bot

Switch SupportsUserData uses to use unique_ptr.

The interface taking a raw pointer is deprecated and being removed.

BUG=690937

Review-Url: https://codereview.chromium.org/2851513005
Cr-Commit-Position: refs/heads/master@{#468896}
parent 750b068d
...@@ -146,7 +146,7 @@ CastRemotingConnector* CastRemotingConnector::Get( ...@@ -146,7 +146,7 @@ CastRemotingConnector* CastRemotingConnector::Get(
media_router::MediaSourceForTabContentRemoting( media_router::MediaSourceForTabContentRemoting(
SessionTabHelper::IdForTab(contents)) SessionTabHelper::IdForTab(contents))
.id()); .id());
contents->SetUserData(kUserDataKey, connector); contents->SetUserData(kUserDataKey, base::WrapUnique(connector));
} }
return connector; return connector;
} }
......
...@@ -66,6 +66,8 @@ class CastRemotingConnector ...@@ -66,6 +66,8 @@ class CastRemotingConnector
: public base::SupportsUserData::Data, : public base::SupportsUserData::Data,
public media_router::MediaRoutesObserver { public media_router::MediaRoutesObserver {
public: public:
~CastRemotingConnector() final;
// Returns the instance of the CastRemotingConnector associated with // Returns the instance of the CastRemotingConnector associated with
// |source_contents|, creating a new instance if needed. // |source_contents|, creating a new instance if needed.
static CastRemotingConnector* Get(content::WebContents* source_contents); static CastRemotingConnector* Get(content::WebContents* source_contents);
...@@ -99,8 +101,6 @@ class CastRemotingConnector ...@@ -99,8 +101,6 @@ class CastRemotingConnector
CastRemotingConnector(media_router::MediaRouter* router, CastRemotingConnector(media_router::MediaRouter* router,
const media_router::MediaSource::Id& media_source_id); const media_router::MediaSource::Id& media_source_id);
~CastRemotingConnector() final;
// Creates a RemotingBridge that implements the requested Remoter service, and // Creates a RemotingBridge that implements the requested Remoter service, and
// binds it to the interface |request|. // binds it to the interface |request|.
void CreateBridge(media::mojom::RemotingSourcePtr source, void CreateBridge(media::mojom::RemotingSourcePtr source,
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "chrome/browser/media/router/receiver_presentation_service_delegate_impl.h" #include "chrome/browser/media/router/receiver_presentation_service_delegate_impl.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/media/router/offscreen_presentation_manager.h" #include "chrome/browser/media/router/offscreen_presentation_manager.h"
#include "chrome/browser/media/router/offscreen_presentation_manager_factory.h" #include "chrome/browser/media/router/offscreen_presentation_manager_factory.h"
...@@ -23,9 +24,10 @@ void ReceiverPresentationServiceDelegateImpl::CreateForWebContents( ...@@ -23,9 +24,10 @@ void ReceiverPresentationServiceDelegateImpl::CreateForWebContents(
if (FromWebContents(web_contents)) if (FromWebContents(web_contents))
return; return;
web_contents->SetUserData(UserDataKey(), web_contents->SetUserData(
new ReceiverPresentationServiceDelegateImpl( UserDataKey(),
web_contents, presentation_id)); base::WrapUnique(new ReceiverPresentationServiceDelegateImpl(
web_contents, presentation_id)));
} }
void ReceiverPresentationServiceDelegateImpl::AddObserver( void ReceiverPresentationServiceDelegateImpl::AddObserver(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment