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

Side by Side Diff: chrome/browser/ui/webui/media_router/media_router_ui.cc

Issue 2433283005: [Media Router] Use origin instead of URL for frame. (Closed)
Patch Set: Remove DCHECK in media_router_ui.cc Created 4 years, 1 month 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
« no previous file with comments | « chrome/browser/media/router/presentation_service_delegate_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/media_router/media_router_ui.h" 5 #include "chrome/browser/ui/webui/media_router/media_router_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <unordered_map> 9 #include <unordered_map>
10 #include <utility> 10 #include <utility>
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 bool for_default_source = cast_mode == MediaCastMode::DEFAULT; 414 bool for_default_source = cast_mode == MediaCastMode::DEFAULT;
415 if (for_default_source && !presentation_request_) { 415 if (for_default_source && !presentation_request_) {
416 DLOG(ERROR) << "Requested to create a route for presentation, but " 416 DLOG(ERROR) << "Requested to create a route for presentation, but "
417 << "presentation request is missing."; 417 << "presentation request is missing.";
418 return false; 418 return false;
419 } 419 }
420 420
421 current_route_request_id_ = ++route_request_counter_; 421 current_route_request_id_ = ++route_request_counter_;
422 *origin = for_default_source ? presentation_request_->frame_url().GetOrigin() 422 *origin = for_default_source ? presentation_request_->frame_url().GetOrigin()
423 : GURL(chrome::kChromeUIMediaRouterURL); 423 : GURL(chrome::kChromeUIMediaRouterURL);
424 DCHECK(origin->is_valid());
425
426 DVLOG(1) << "DoCreateRoute: origin: " << *origin; 424 DVLOG(1) << "DoCreateRoute: origin: " << *origin;
427 425
428 // There are 3 cases. In cases (1) and (3) the MediaRouterUI will need to be 426 // There are 3 cases. In cases (1) and (3) the MediaRouterUI will need to be
429 // notified. In case (2) the dialog will be closed. 427 // notified. In case (2) the dialog will be closed.
430 // (1) Non-presentation route request (e.g., mirroring). No additional 428 // (1) Non-presentation route request (e.g., mirroring). No additional
431 // notification necessary. 429 // notification necessary.
432 // (2) Presentation route request for a Presentation API startSession call. 430 // (2) Presentation route request for a Presentation API startSession call.
433 // The startSession (CreatePresentationConnectionRequest) will need to be 431 // The startSession (CreatePresentationConnectionRequest) will need to be
434 // answered with the route response. 432 // answered with the route response.
435 // (3) Browser-initiated presentation route request. If successful, 433 // (3) Browser-initiated presentation route request. If successful,
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
692 base::Time::Now() - start_time_); 690 base::Time::Now() - start_time_);
693 start_time_ = base::Time(); 691 start_time_ = base::Time();
694 } 692 }
695 } 693 }
696 694
697 void MediaRouterUI::UpdateMaxDialogHeight(int height) { 695 void MediaRouterUI::UpdateMaxDialogHeight(int height) {
698 handler_->UpdateMaxDialogHeight(height); 696 handler_->UpdateMaxDialogHeight(height);
699 } 697 }
700 698
701 } // namespace media_router 699 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/presentation_service_delegate_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698