Chromium Code Reviews| Index: chrome/browser/media/router/mojo/media_router_mojo_impl.h |
| diff --git a/chrome/browser/media/router/mojo/media_router_mojo_impl.h b/chrome/browser/media/router/mojo/media_router_mojo_impl.h |
| index 8f311c9a84260ca91ba3c3d2472c90688953bbed..60f6d31154b9d14105ad8bc7cd70a18870ea445a 100644 |
| --- a/chrome/browser/media/router/mojo/media_router_mojo_impl.h |
| +++ b/chrome/browser/media/router/mojo/media_router_mojo_impl.h |
| @@ -16,6 +16,7 @@ |
| #include <vector> |
| #include "base/containers/hash_tables.h" |
| +#include "base/feature_list.h" |
| #include "base/gtest_prod_util.h" |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| @@ -29,6 +30,7 @@ |
| #include "chrome/common/media_router/issue.h" |
| #include "chrome/common/media_router/mojo/media_router.mojom.h" |
| #include "chrome/common/media_router/route_request_result.h" |
| +#include "content/public/browser/browser_thread.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| namespace content { |
| @@ -40,9 +42,17 @@ class EventPageTracker; |
| class Extension; |
| } |
| +namespace net { |
| +class URLRequestContextGetter; |
| +} |
| + |
| namespace media_router { |
| +extern const base::Feature kEnableDialLocalDiscovery; |
|
mark a. foltz
2017/05/01 20:32:57
Can these go in media_router_feature.cc and expose
zhaobin
2017/05/03 01:53:59
Done.
|
| +extern const base::Feature kEnableCastDiscovery; |
|
mark a. foltz
2017/05/01 20:32:57
Is it okay to do static initialization of base::Fe
zhaobin
2017/05/03 01:54:00
Code removed. Seems fine. https://cs.chromium.org/
|
| + |
| enum class MediaRouteProviderWakeReason; |
| +class DialMediaSinkService; |
| // MediaRouter implementation that delegates calls to the component extension. |
| // Also handles the suspension and wakeup of the component extension. |
| @@ -214,8 +224,8 @@ class MediaRouterMojoImpl : public MediaRouterBase, |
| // Standard constructor, used by |
| // MediaRouterMojoImplFactory::GetApiForBrowserContext. |
| - explicit MediaRouterMojoImpl( |
| - extensions::EventPageTracker* event_page_tracker); |
| + explicit MediaRouterMojoImpl(extensions::EventPageTracker* event_page_tracker, |
| + content::BrowserContext* context); |
| // Binds |this| to a Mojo interface request, so that clients can acquire a |
| // handle to a MediaRouterMojoImpl instance via the Mojo service connector. |
| @@ -389,6 +399,12 @@ class MediaRouterMojoImpl : public MediaRouterBase, |
| void OnFirewallCheckComplete(bool firewall_can_use_local_ports); |
| #endif |
| + // Start browser side sink discovery. |
| + void StartBrowserSideDiscovery(net::URLRequestContextGetter* request_context); |
|
mark a. foltz
2017/05/01 20:32:57
Just StartDiscovery()? Since this is running in t
zhaobin
2017/05/03 01:53:59
Done.
|
| + |
| + // Invoked when browser side sink disocvery finished. |
|
mark a. foltz
2017/05/01 20:32:57
Typo in discovery
zhaobin
2017/05/03 01:53:59
Done.
|
| + void OnDialMediaSinkDiscovered(const std::vector<MediaSinkInternal>& sinks); |
| + |
| // Requests MRPM to update media sinks. This allows MRPs that only do |
| // discovery on sink queries an opportunity to update discovery results |
| // even if the MRP SinkAvailability is marked UNAVAILABLE. |
| @@ -459,6 +475,13 @@ class MediaRouterMojoImpl : public MediaRouterBase, |
| // extension. |
| std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_; |
| + // Media sink service for DIAL devices. |
| + std::unique_ptr<DialMediaSinkService, |
| + content::BrowserThread::DeleteOnIOThread> |
|
mark a. foltz
2017/05/01 20:32:57
There could be a shutdown race condition here - th
zhaobin
2017/05/03 01:53:59
Per discussion with Derek, we are going to make Di
|
| + dial_media_sink_service_; |
| + |
| + content::BrowserContext* context_; |
| + |
| #if defined(OS_WIN) |
| // A pair of flags to ensure that mDNS discovery is only enabled on Windows |
| // when there will be appropriate context for the user to associate a firewall |