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

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

Issue 1971893002: [MediaRouter] Update JoinRoute behavior to allow non-local routes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to imcheng@ comment Created 4 years, 7 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 #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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 const std::vector<MediaRouteResponseCallback>& callbacks, 338 const std::vector<MediaRouteResponseCallback>& callbacks,
339 base::TimeDelta timeout, 339 base::TimeDelta timeout,
340 bool off_the_record) { 340 bool off_the_record) {
341 DCHECK(thread_checker_.CalledOnValidThread()); 341 DCHECK(thread_checker_.CalledOnValidThread());
342 342
343 std::unique_ptr<RouteRequestResult> error_result; 343 std::unique_ptr<RouteRequestResult> error_result;
344 if (!origin.is_valid()) { 344 if (!origin.is_valid()) {
345 DVLOG_WITH_INSTANCE(1) << "Invalid origin: " << origin; 345 DVLOG_WITH_INSTANCE(1) << "Invalid origin: " << origin;
346 error_result = RouteRequestResult::FromError( 346 error_result = RouteRequestResult::FromError(
347 "Invalid origin", RouteRequestResult::INVALID_ORIGIN); 347 "Invalid origin", RouteRequestResult::INVALID_ORIGIN);
348 } else if (!HasLocalRoute()) { 348 } else if (!HasJoinableRoute()) {
349 DVLOG_WITH_INSTANCE(1) << "No local routes"; 349 DVLOG_WITH_INSTANCE(1) << "No joinable routes";
350 error_result = RouteRequestResult::FromError( 350 error_result = RouteRequestResult::FromError(
351 "Route not found", RouteRequestResult::ROUTE_NOT_FOUND); 351 "Route not found", RouteRequestResult::ROUTE_NOT_FOUND);
352 } 352 }
353 353
354 if (error_result) { 354 if (error_result) {
355 for (const MediaRouteResponseCallback& callback : callbacks) 355 for (const MediaRouteResponseCallback& callback : callbacks)
356 callback.Run(*error_result); 356 callback.Run(*error_result);
357 return; 357 return;
358 } 358 }
359 359
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1037 base::Unretained(this), source_id)); 1037 base::Unretained(this), source_id));
1038 } 1038 }
1039 1039
1040 void MediaRouterMojoImpl::DoUpdateMediaSinks( 1040 void MediaRouterMojoImpl::DoUpdateMediaSinks(
1041 const MediaSource::Id& source_id) { 1041 const MediaSource::Id& source_id) {
1042 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id; 1042 DVLOG_WITH_INSTANCE(1) << "DoUpdateMediaSinks" << source_id;
1043 media_route_provider_->UpdateMediaSinks(source_id); 1043 media_route_provider_->UpdateMediaSinks(source_id);
1044 } 1044 }
1045 1045
1046 } // namespace media_router 1046 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/media_router_base.cc ('k') | chrome/browser/media/router/mojo/media_router_mojo_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698