| OLD | NEW |
| 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 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" | 5 #include "chrome/browser/media/router/mojo/media_router_mojo_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 const std::string& origin, | 591 const std::string& origin, |
| 592 int tab_id, | 592 int tab_id, |
| 593 const std::vector<MediaRouteResponseCallback>& callbacks, | 593 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 594 base::TimeDelta timeout, | 594 base::TimeDelta timeout, |
| 595 bool incognito) { | 595 bool incognito) { |
| 596 std::string presentation_id = MediaRouterBase::CreatePresentationId(); | 596 std::string presentation_id = MediaRouterBase::CreatePresentationId(); |
| 597 DVLOG_WITH_INSTANCE(1) << "DoCreateRoute " << source_id << "=>" << sink_id | 597 DVLOG_WITH_INSTANCE(1) << "DoCreateRoute " << source_id << "=>" << sink_id |
| 598 << ", presentation ID: " << presentation_id; | 598 << ", presentation ID: " << presentation_id; |
| 599 | 599 |
| 600 media_route_provider_->CreateRoute( | 600 media_route_provider_->CreateRoute( |
| 601 source_id, sink_id, presentation_id, origin, tab_id, | 601 source_id, sink_id, presentation_id, origin, tab_id, timeout, incognito, |
| 602 timeout > base::TimeDelta() ? timeout.InMilliseconds() : 0, incognito, | |
| 603 base::Bind(&MediaRouterMojoImpl::RouteResponseReceived, | 602 base::Bind(&MediaRouterMojoImpl::RouteResponseReceived, |
| 604 base::Unretained(this), presentation_id, incognito, | 603 base::Unretained(this), presentation_id, incognito, |
| 605 callbacks)); | 604 callbacks)); |
| 606 } | 605 } |
| 607 | 606 |
| 608 void MediaRouterMojoImpl::DoJoinRoute( | 607 void MediaRouterMojoImpl::DoJoinRoute( |
| 609 const MediaSource::Id& source_id, | 608 const MediaSource::Id& source_id, |
| 610 const std::string& presentation_id, | 609 const std::string& presentation_id, |
| 611 const std::string& origin, | 610 const std::string& origin, |
| 612 int tab_id, | 611 int tab_id, |
| 613 const std::vector<MediaRouteResponseCallback>& callbacks, | 612 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 614 base::TimeDelta timeout, | 613 base::TimeDelta timeout, |
| 615 bool incognito) { | 614 bool incognito) { |
| 616 DVLOG_WITH_INSTANCE(1) << "DoJoinRoute " << source_id | 615 DVLOG_WITH_INSTANCE(1) << "DoJoinRoute " << source_id |
| 617 << ", presentation ID: " << presentation_id; | 616 << ", presentation ID: " << presentation_id; |
| 618 | 617 |
| 619 media_route_provider_->JoinRoute( | 618 media_route_provider_->JoinRoute( |
| 620 source_id, presentation_id, origin, tab_id, | 619 source_id, presentation_id, origin, tab_id, timeout, incognito, |
| 621 timeout > base::TimeDelta() ? timeout.InMilliseconds() : 0, incognito, | |
| 622 base::Bind(&MediaRouterMojoImpl::RouteResponseReceived, | 620 base::Bind(&MediaRouterMojoImpl::RouteResponseReceived, |
| 623 base::Unretained(this), presentation_id, incognito, | 621 base::Unretained(this), presentation_id, incognito, |
| 624 callbacks)); | 622 callbacks)); |
| 625 } | 623 } |
| 626 | 624 |
| 627 void MediaRouterMojoImpl::DoConnectRouteByRouteId( | 625 void MediaRouterMojoImpl::DoConnectRouteByRouteId( |
| 628 const MediaSource::Id& source_id, | 626 const MediaSource::Id& source_id, |
| 629 const MediaRoute::Id& route_id, | 627 const MediaRoute::Id& route_id, |
| 630 const std::string& origin, | 628 const std::string& origin, |
| 631 int tab_id, | 629 int tab_id, |
| 632 const std::vector<MediaRouteResponseCallback>& callbacks, | 630 const std::vector<MediaRouteResponseCallback>& callbacks, |
| 633 base::TimeDelta timeout, | 631 base::TimeDelta timeout, |
| 634 bool incognito) { | 632 bool incognito) { |
| 635 std::string presentation_id = MediaRouterBase::CreatePresentationId(); | 633 std::string presentation_id = MediaRouterBase::CreatePresentationId(); |
| 636 DVLOG_WITH_INSTANCE(1) << "DoConnectRouteByRouteId " << source_id | 634 DVLOG_WITH_INSTANCE(1) << "DoConnectRouteByRouteId " << source_id |
| 637 << ", route ID: " << route_id | 635 << ", route ID: " << route_id |
| 638 << ", presentation ID: " << presentation_id; | 636 << ", presentation ID: " << presentation_id; |
| 639 | 637 |
| 640 media_route_provider_->ConnectRouteByRouteId( | 638 media_route_provider_->ConnectRouteByRouteId( |
| 641 source_id, route_id, presentation_id, origin, tab_id, | 639 source_id, route_id, presentation_id, origin, tab_id, timeout, incognito, |
| 642 timeout > base::TimeDelta() ? timeout.InMilliseconds() : 0, incognito, | |
| 643 base::Bind(&MediaRouterMojoImpl::RouteResponseReceived, | 640 base::Bind(&MediaRouterMojoImpl::RouteResponseReceived, |
| 644 base::Unretained(this), presentation_id, incognito, | 641 base::Unretained(this), presentation_id, incognito, |
| 645 callbacks)); | 642 callbacks)); |
| 646 } | 643 } |
| 647 | 644 |
| 648 void MediaRouterMojoImpl::DoTerminateRoute(const MediaRoute::Id& route_id) { | 645 void MediaRouterMojoImpl::DoTerminateRoute(const MediaRoute::Id& route_id) { |
| 649 DVLOG_WITH_INSTANCE(1) << "DoTerminateRoute " << route_id; | 646 DVLOG_WITH_INSTANCE(1) << "DoTerminateRoute " << route_id; |
| 650 media_route_provider_->TerminateRoute( | 647 media_route_provider_->TerminateRoute( |
| 651 route_id, | 648 route_id, |
| 652 base::Bind(&MediaRouterMojoImpl::OnTerminateRouteResult, | 649 base::Bind(&MediaRouterMojoImpl::OnTerminateRouteResult, |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 base::Unretained(this), source_id)); | 972 base::Unretained(this), source_id)); |
| 976 } | 973 } |
| 977 | 974 |
| 978 void MediaRouterMojoImpl::DoUpdateMediaSinks( | 975 void MediaRouterMojoImpl::DoUpdateMediaSinks( |
| 979 const MediaSource::Id& source_id) { | 976 const MediaSource::Id& source_id) { |
| 980 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; | 977 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; |
| 981 media_route_provider_->UpdateMediaSinks(source_id); | 978 media_route_provider_->UpdateMediaSinks(source_id); |
| 982 } | 979 } |
| 983 | 980 |
| 984 } // namespace media_router | 981 } // namespace media_router |
| OLD | NEW |