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

Side by Side Diff: chrome/browser/media/router/mojo/media_router_mojo_impl.h

Issue 2927833002: [Media Router] Add CastMediaSinkService (Closed)
Patch Set: fix tsan and mac unit test failures 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <deque> 10 #include <deque>
(...skipping 26 matching lines...) Expand all
37 class BrowserContext; 37 class BrowserContext;
38 } 38 }
39 39
40 namespace extensions { 40 namespace extensions {
41 class Extension; 41 class Extension;
42 } 42 }
43 43
44 namespace media_router { 44 namespace media_router {
45 45
46 enum class MediaRouteProviderWakeReason; 46 enum class MediaRouteProviderWakeReason;
47 class CastMediaSinkService;
47 class DialMediaSinkServiceProxy; 48 class DialMediaSinkServiceProxy;
48 class EventPageRequestManager; 49 class EventPageRequestManager;
49 50
50 // MediaRouter implementation that delegates calls to the component extension. 51 // MediaRouter implementation that delegates calls to the component extension.
51 // Also handles the suspension and wakeup of the component extension. 52 // Also handles the suspension and wakeup of the component extension.
52 // Lives on the UI thread. 53 // Lives on the UI thread.
53 class MediaRouterMojoImpl : public MediaRouterBase, 54 class MediaRouterMojoImpl : public MediaRouterBase,
54 public mojom::MediaRouter { 55 public mojom::MediaRouter {
55 public: 56 public:
56 ~MediaRouterMojoImpl() override; 57 ~MediaRouterMojoImpl() override;
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 // The last reported sink availability from the media route provider manager. 405 // The last reported sink availability from the media route provider manager.
405 mojom::MediaRouter::SinkAvailability availability_; 406 mojom::MediaRouter::SinkAvailability availability_;
406 407
407 // Stores route controllers that can be used to send media commands to the 408 // Stores route controllers that can be used to send media commands to the
408 // extension. 409 // extension.
409 std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_; 410 std::unordered_map<MediaRoute::Id, MediaRouteController*> route_controllers_;
410 411
411 // Media sink service for DIAL devices. 412 // Media sink service for DIAL devices.
412 scoped_refptr<DialMediaSinkServiceProxy> dial_media_sink_service_proxy_; 413 scoped_refptr<DialMediaSinkServiceProxy> dial_media_sink_service_proxy_;
413 414
415 // Media sink service for CAST devices.
416 scoped_refptr<CastMediaSinkService> cast_media_sink_service_;
417
414 content::BrowserContext* const context_; 418 content::BrowserContext* const context_;
415 419
416 // Request manager responsible for waking the component extension and calling 420 // Request manager responsible for waking the component extension and calling
417 // the requests to it. 421 // the requests to it.
418 EventPageRequestManager* const event_page_request_manager_; 422 EventPageRequestManager* const event_page_request_manager_;
419 423
420 // A flag to ensure that we record the provider version once, during the 424 // A flag to ensure that we record the provider version once, during the
421 // initial event page wakeup attempt. 425 // initial event page wakeup attempt.
422 bool provider_version_was_recorded_ = false; 426 bool provider_version_was_recorded_ = false;
423 427
424 #if defined(OS_WIN) 428 #if defined(OS_WIN)
425 // A pair of flags to ensure that mDNS discovery is only enabled on Windows 429 // A pair of flags to ensure that mDNS discovery is only enabled on Windows
426 // when there will be appropriate context for the user to associate a firewall 430 // when there will be appropriate context for the user to associate a firewall
427 // prompt with Media Router. |should_enable_mdns_discovery_| can only go from 431 // prompt with Media Router. |should_enable_mdns_discovery_| can only go from
428 // |false| to |true|. On Windows, |is_mdns_enabled_| is set to |false| in 432 // |false| to |true|. On Windows, |is_mdns_enabled_| is set to |false| in
429 // RegisterMediaRouteProvider and only set to |true| when we successfully call 433 // RegisterMediaRouteProvider and only set to |true| when we successfully call
430 // the extension to enable mDNS. 434 // the extension to enable mDNS.
431 bool is_mdns_enabled_ = false; 435 bool is_mdns_enabled_ = false;
432 bool should_enable_mdns_discovery_ = false; 436 bool should_enable_mdns_discovery_ = false;
433 #endif 437 #endif
434 438
435 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_; 439 base::WeakPtrFactory<MediaRouterMojoImpl> weak_factory_;
436 440
437 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl); 441 DISALLOW_COPY_AND_ASSIGN(MediaRouterMojoImpl);
438 }; 442 };
439 443
440 } // namespace media_router 444 } // namespace media_router
441 445
442 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_ 446 #endif // CHROME_BROWSER_MEDIA_ROUTER_MOJO_MEDIA_ROUTER_MOJO_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698