OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_IMPL_ H_ | 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_IMPL_ H_ |
6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_IMPL_ H_ | 6 #define CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_IMPL_ H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 | 10 |
11 #include "chrome/browser/media/router/discovery/dial/device_description_service. h" | 11 #include "chrome/browser/media/router/discovery/dial/device_description_service. h" |
12 #include "chrome/browser/media/router/discovery/dial/dial_registry.h" | 12 #include "chrome/browser/media/router/discovery/dial/dial_registry.h" |
13 #include "chrome/browser/media/router/discovery/media_sink_service_base.h" | 13 #include "chrome/browser/media/router/discovery/media_sink_service_base.h" |
14 #include "chrome/browser/media/router/media_router_metrics.h" | 14 #include "chrome/browser/media/router/media_router_metrics.h" |
15 | 15 |
16 namespace media_router { | 16 namespace media_router { |
17 | 17 |
18 class CastMediaSinkService; | |
18 class DeviceDescriptionService; | 19 class DeviceDescriptionService; |
19 class DialRegistry; | 20 class DialRegistry; |
20 | 21 |
21 // A service which can be used to start background discovery and resolution of | 22 // A service which can be used to start background discovery and resolution of |
22 // DIAL devices (Smart TVs, Game Consoles, etc.). | 23 // DIAL devices (Smart TVs, Game Consoles, etc.). |
23 // This class is not thread safe. All methods must be called from the IO thread. | 24 // This class is not thread safe. All methods must be called from the IO thread. |
24 class DialMediaSinkServiceImpl : public MediaSinkServiceBase, | 25 class DialMediaSinkServiceImpl : public MediaSinkServiceBase, |
25 public DialRegistry::Observer { | 26 public DialRegistry::Observer { |
26 public: | 27 public: |
27 DialMediaSinkServiceImpl(const OnSinksDiscoveredCallback& callback, | 28 DialMediaSinkServiceImpl( |
28 net::URLRequestContextGetter* request_context); | 29 const OnSinksDiscoveredCallback& callback, |
30 scoped_refptr<CastMediaSinkService> cast_media_sink_service, | |
mark a. foltz
2017/07/11 23:52:51
Since the CMSS is optional for the DialMediaSinkSe
| |
31 net::URLRequestContextGetter* request_context); | |
29 ~DialMediaSinkServiceImpl() override; | 32 ~DialMediaSinkServiceImpl() override; |
30 | 33 |
31 // MediaSinkService implementation | 34 // MediaSinkService implementation |
32 void Start() override; | 35 void Start() override; |
33 void Stop() override; | 36 void Stop() override; |
34 | 37 |
35 protected: | 38 protected: |
36 // Returns instance of device description service. Create a new one if none | 39 // Returns instance of device description service. Create a new one if none |
37 // exists. | 40 // exists. |
38 DeviceDescriptionService* GetDescriptionService(); | 41 DeviceDescriptionService* GetDescriptionService(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
71 | 74 |
72 // Raw pointer to DialRegistry singleton. | 75 // Raw pointer to DialRegistry singleton. |
73 DialRegistry* dial_registry_ = nullptr; | 76 DialRegistry* dial_registry_ = nullptr; |
74 | 77 |
75 // DialRegistry for unit test. | 78 // DialRegistry for unit test. |
76 DialRegistry* test_dial_registry_ = nullptr; | 79 DialRegistry* test_dial_registry_ = nullptr; |
77 | 80 |
78 // Device data list from current round of discovery. | 81 // Device data list from current round of discovery. |
79 DialRegistry::DeviceList current_devices_; | 82 DialRegistry::DeviceList current_devices_; |
80 | 83 |
84 scoped_refptr<CastMediaSinkService> cast_media_sink_service_; | |
85 | |
81 scoped_refptr<net::URLRequestContextGetter> request_context_; | 86 scoped_refptr<net::URLRequestContextGetter> request_context_; |
82 | 87 |
83 MediaRouterMetrics metrics_; | 88 MediaRouterMetrics metrics_; |
84 }; | 89 }; |
85 | 90 |
86 } // namespace media_router | 91 } // namespace media_router |
87 | 92 |
88 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_IM PL_H_ | 93 #endif // CHROME_BROWSER_MEDIA_ROUTER_DISCOVERY_DIAL_DIAL_MEDIA_SINK_SERVICE_IM PL_H_ |
OLD | NEW |