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

Side by Side Diff: chrome/browser/media/router/presentation_service_delegate_impl.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
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/presentation_service_delegate_impl.h" 5 #include "chrome/browser/media/router/presentation_service_delegate_impl.h"
6 6
7 #include <string> 7 #include <string>
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 int render_process_id = render_frame_host->GetProcess()->GetID(); 48 int render_process_id = render_frame_host->GetProcess()->GetID();
49 int render_frame_id = render_frame_host->GetRoutingID(); 49 int render_frame_id = render_frame_host->GetRoutingID();
50 return RenderFrameHostId(render_process_id, render_frame_id); 50 return RenderFrameHostId(render_process_id, render_frame_id);
51 } 51 }
52 52
53 // Gets the last committed URL for the render frame specified by 53 // Gets the last committed URL for the render frame specified by
54 // |render_frame_host_id|. 54 // |render_frame_host_id|.
55 GURL GetLastCommittedURLForFrame(RenderFrameHostId render_frame_host_id) { 55 GURL GetLastCommittedURLForFrame(RenderFrameHostId render_frame_host_id) {
56 RenderFrameHost* render_frame_host = RenderFrameHost::FromID( 56 RenderFrameHost* render_frame_host = RenderFrameHost::FromID(
57 render_frame_host_id.first, render_frame_host_id.second); 57 render_frame_host_id.first, render_frame_host_id.second);
58 return render_frame_host ? render_frame_host->GetLastCommittedURL() : GURL(); 58 // TODO(crbug.com/632623): Use url::Origin in place of GURL for origins
59 return render_frame_host
60 ? render_frame_host->GetLastCommittedOrigin().GetURL()
61 : GURL();
59 } 62 }
60 63
61 // Observes messages originating from the MediaSink connected to a MediaRoute 64 // Observes messages originating from the MediaSink connected to a MediaRoute
62 // that represents a presentation. Converts the messages into 65 // that represents a presentation. Converts the messages into
63 // content::PresentationSessionMessages and dispatches them via the provided 66 // content::PresentationSessionMessages and dispatches them via the provided
64 // PresentationSessionMessageCallback. 67 // PresentationSessionMessageCallback.
65 class PresentationSessionMessagesObserver : public RouteMessageObserver { 68 class PresentationSessionMessagesObserver : public RouteMessageObserver {
66 public: 69 public:
67 // |message_cb|: The callback to invoke whenever messages are received. 70 // |message_cb|: The callback to invoke whenever messages are received.
68 // |route_id|: ID of MediaRoute to listen for messages. 71 // |route_id|: ID of MediaRoute to listen for messages.
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
958 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest( 961 bool PresentationServiceDelegateImpl::HasScreenAvailabilityListenerForTest(
959 int render_process_id, 962 int render_process_id,
960 int render_frame_id, 963 int render_frame_id,
961 const MediaSource::Id& source_id) const { 964 const MediaSource::Id& source_id) const {
962 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id); 965 RenderFrameHostId render_frame_host_id(render_process_id, render_frame_id);
963 return frame_manager_->HasScreenAvailabilityListenerForTest( 966 return frame_manager_->HasScreenAvailabilityListenerForTest(
964 render_frame_host_id, source_id); 967 render_frame_host_id, source_id);
965 } 968 }
966 969
967 } // namespace media_router 970 } // namespace media_router
OLDNEW
« no previous file with comments | « chrome/browser/media/router/presentation_request.h ('k') | chrome/browser/ui/webui/media_router/media_router_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698