[Media Router] Add CastMediaSinkService

Desktop / Chromium - zhaobin [chromium.org] - 7 July 2017 13:50 EDT

NOTE: those extensions header files and extensions::api:: namespace will go away when https://codereview.chromium.org/2913033003/ lands

Discover process is similar to DialMediaSinkService:- CastMediaSinkService::Start() registers itself with DnsRegistry- CastMediaSinkService::OnDnsSdEvent() gets invoked when Dns services comes back and starts a 3s timer- Start opening channel for each service on IO thread- CastMediaSinkService::OnChannelOpenedOnIOThread() gets invoked when channel open finishes- Post task back to UI thread via CastMediaSinkService::OnChannelOpenOnUIThread()- Create MediaSinkInternal and store it in CastSinkService's sink map- Invoke MediaSinkBase::FetchCompleted() and send sinks to MRP when timer expires

TODO: Unit test Implement CastSocketService::OpenChannel

BUG=687377

Review-Url: https://codereview.chromium.org/2927833002 Cr-Commit-Position: refs/heads/master@{#484979}

b9a2a9b [Media Router] Add CastMediaSinkService
chrome/browser/media/router/discovery/BUILD.gn | 3 +
.../discovery/mdns/cast_media_sink_service.cc | 245 ++++++++++++++++
.../discovery/mdns/cast_media_sink_service.h | 132 +++++++++
.../mdns/cast_media_sink_service_unittest.cc | 309 +++++++++++++++++++++
.../router/discovery/mdns/mock_dns_sd_registry.cc | 2 +-
.../media/router/mojo/media_router_mojo_impl.cc | 31 ++-
.../media/router/mojo/media_router_mojo_impl.h | 4 +
chrome/test/BUILD.gn | 1 +
components/cast_channel/cast_socket_service.h | 13 +-
9 files changed, 723 insertions(+), 17 deletions(-)

Upstream: git.chromium.org


  • Share