Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1869)

Unified Diff: chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h

Issue 2965843002: [Media Router] Support dual discovery (Closed)
Patch Set: resovle code review comments from Derek and Mark Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h
diff --git a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h
index e238bc4ed7de4679807f3c1ba538b5642fea9592..4209d199c45162665f55c783516dc515e24b3e89 100644
--- a/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h
+++ b/chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.h
@@ -18,6 +18,24 @@ namespace media_router {
class DeviceDescriptionService;
class DialRegistry;
+// A delegate class registered with DialMediaSinkService to receive
+// notifications when dial sinks are added or removed from DialMediaSinkService
+class DialMediaSinkServiceDelegate
+ : public base::RefCountedThreadSafe<DialMediaSinkServiceDelegate> {
+ public:
+ // Invoked when |sink| is added to DialMediaSinkServiceImpl instance.
+ virtual void OnDialSinkAdded(const MediaSinkInternal& sink) = 0;
+
+ // Invoked when dial sinks are removed from DialMediaSinkServiceImpl instance.
+ virtual void OnDialSinksRemoved() = 0;
+
+ protected:
+ virtual ~DialMediaSinkServiceDelegate() {}
+
+ private:
+ friend class base::RefCountedThreadSafe<DialMediaSinkServiceDelegate>;
+};
+
// A service which can be used to start background discovery and resolution of
// DIAL devices (Smart TVs, Game Consoles, etc.).
// This class is not thread safe. All methods must be called from the IO thread.
@@ -28,6 +46,9 @@ class DialMediaSinkServiceImpl : public MediaSinkServiceBase,
net::URLRequestContextGetter* request_context);
~DialMediaSinkServiceImpl() override;
+ void SetDialMediaSinkServiceDelegate(
+ scoped_refptr<DialMediaSinkServiceDelegate> delegate);
+
// MediaSinkService implementation
void Start() override;
void Stop() override;
@@ -78,6 +99,8 @@ class DialMediaSinkServiceImpl : public MediaSinkServiceBase,
// Device data list from current round of discovery.
DialRegistry::DeviceList current_devices_;
+ scoped_refptr<DialMediaSinkServiceDelegate> delegate_;
+
scoped_refptr<net::URLRequestContextGetter> request_context_;
MediaRouterMetrics metrics_;
« no previous file with comments | « no previous file | chrome/browser/media/router/discovery/dial/dial_media_sink_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698