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

Unified Diff: chrome/browser/media/router/presentation_service_delegate_impl.cc

Issue 2468363006: [Presentation API] cleanup: pass in MediaRoute instead of MediaRoute::Id to PresentationServiceDele… (Closed)
Patch Set: merge with master 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/router/presentation_service_delegate_impl.cc
diff --git a/chrome/browser/media/router/presentation_service_delegate_impl.cc b/chrome/browser/media/router/presentation_service_delegate_impl.cc
index 91a9badfb4c827e61ad3dbf7a605ea7e11b34af2..bab07ce555771a9f4e02dd140d5341133842d783 100644
--- a/chrome/browser/media/router/presentation_service_delegate_impl.cc
+++ b/chrome/browser/media/router/presentation_service_delegate_impl.cc
@@ -144,7 +144,7 @@ class PresentationFrame {
void OnPresentationSessionStarted(
const content::PresentationSessionInfo& session,
- const MediaRoute::Id& route_id);
+ const MediaRoute& route);
void OnPresentationServiceDelegateDestroyed() const;
void set_delegate_observer(DelegateObserver* observer) {
@@ -199,8 +199,9 @@ void PresentationFrame::OnPresentationServiceDelegateDestroyed() const {
void PresentationFrame::OnPresentationSessionStarted(
const content::PresentationSessionInfo& session,
- const MediaRoute::Id& route_id) {
- presentation_id_to_route_id_[session.presentation_id] = route_id;
+ const MediaRoute& route) {
+ presentation_id_to_route_id_[session.presentation_id] =
+ route.media_route_id();
}
const MediaRoute::Id PresentationFrame::GetRouteId(
@@ -384,11 +385,11 @@ class PresentationFrameManager {
void OnPresentationSessionStarted(
const RenderFrameHostId& render_frame_host_id,
const content::PresentationSessionInfo& session,
- const MediaRoute::Id& route_id);
+ const MediaRoute& route);
void OnDefaultPresentationSessionStarted(
const PresentationRequest& request,
const content::PresentationSessionInfo& session,
- const MediaRoute::Id& route_id);
+ const MediaRoute& route);
const MediaRoute::Id GetRouteId(const RenderFrameHostId& render_frame_host_id,
const std::string& presentation_id) const;
@@ -455,18 +456,18 @@ PresentationFrameManager::~PresentationFrameManager() {
void PresentationFrameManager::OnPresentationSessionStarted(
const RenderFrameHostId& render_frame_host_id,
const content::PresentationSessionInfo& session,
- const MediaRoute::Id& route_id) {
+ const MediaRoute& route) {
auto* presentation_frame = GetOrAddPresentationFrame(render_frame_host_id);
- presentation_frame->OnPresentationSessionStarted(session, route_id);
+ presentation_frame->OnPresentationSessionStarted(session, route);
}
void PresentationFrameManager::OnDefaultPresentationSessionStarted(
const PresentationRequest& request,
const content::PresentationSessionInfo& session,
- const MediaRoute::Id& route_id) {
+ const MediaRoute& route) {
const auto it = presentation_frames_.find(request.render_frame_host_id());
if (it != presentation_frames_.end())
- it->second->OnPresentationSessionStarted(session, route_id);
+ it->second->OnPresentationSessionStarted(session, route);
if (default_presentation_request_ &&
default_presentation_request_->Equals(request)) {
@@ -749,7 +750,7 @@ void PresentationServiceDelegateImpl::OnJoinRouteResponse(
result.presentation_id());
frame_manager_->OnPresentationSessionStarted(
RenderFrameHostId(render_process_id, render_frame_id), session,
- result.route()->media_route_id());
+ *result.route());
success_cb.Run(session);
}
}
@@ -760,14 +761,13 @@ void PresentationServiceDelegateImpl::OnStartSessionSucceeded(
const content::PresentationSessionStartedCallback& success_cb,
const content::PresentationSessionInfo& new_session,
const MediaRoute& route) {
- const MediaRoute::Id& route_id = route.media_route_id();
DVLOG(1) << "OnStartSessionSucceeded: "
- << "route_id: " << route_id
+ << "route_id: " << route.media_route_id()
<< ", presentation URL: " << new_session.presentation_url
<< ", presentation ID: " << new_session.presentation_id;
frame_manager_->OnPresentationSessionStarted(
RenderFrameHostId(render_process_id, render_frame_id), new_session,
- route_id);
+ route);
success_cb.Run(new_session);
}
@@ -927,7 +927,7 @@ void PresentationServiceDelegateImpl::OnRouteResponse(
content::PresentationSessionInfo session_info(
presentation_request.presentation_url(), result.presentation_id());
frame_manager_->OnDefaultPresentationSessionStarted(
- presentation_request, session_info, result.route()->media_route_id());
+ presentation_request, session_info, *result.route());
}
void PresentationServiceDelegateImpl::AddDefaultPresentationRequestObserver(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698