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

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

Issue 2547703002: [Media Router] Handle multiple Presentation URLs when creating routes (Closed)
Patch Set: fix unittests Created 4 years 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
Index: chrome/browser/media/router/create_presentation_connection_request.cc
diff --git a/chrome/browser/media/router/create_presentation_connection_request.cc b/chrome/browser/media/router/create_presentation_connection_request.cc
index 5bec76d76b16c09f1f84d83d0b91e86e235b7ca2..9dd49c9535ee18a3f68ad9036cef184c7b61813a 100644
--- a/chrome/browser/media/router/create_presentation_connection_request.cc
+++ b/chrome/browser/media/router/create_presentation_connection_request.cc
@@ -15,13 +15,11 @@ namespace media_router {
CreatePresentationConnectionRequest::CreatePresentationConnectionRequest(
const RenderFrameHostId& render_frame_host_id,
- const GURL& presentation_url,
+ const std::vector<GURL>& presentation_urls,
const GURL& frame_url,
const PresentationSessionSuccessCallback& success_cb,
const PresentationSessionErrorCallback& error_cb)
- : presentation_request_(render_frame_host_id,
- {presentation_url},
- frame_url),
+ : presentation_request_(render_frame_host_id, presentation_urls, frame_url),
success_cb_(success_cb),
error_cb_(error_cb),
cb_invoked_(false) {
@@ -38,12 +36,12 @@ CreatePresentationConnectionRequest::~CreatePresentationConnectionRequest() {
void CreatePresentationConnectionRequest::InvokeSuccessCallback(
const std::string& presentation_id,
+ const GURL& presentation_url,
const MediaRoute& route) {
DCHECK(!cb_invoked_);
if (!cb_invoked_) {
success_cb_.Run(
- content::PresentationSessionInfo(
- presentation_request_.presentation_url(), presentation_id),
+ content::PresentationSessionInfo(presentation_url, presentation_id),
route);
cb_invoked_ = true;
}
@@ -66,8 +64,8 @@ void CreatePresentationConnectionRequest::HandleRouteResponse(
presentation_request->InvokeErrorCallback(content::PresentationError(
content::PRESENTATION_ERROR_UNKNOWN, result.error()));
} else {
- presentation_request->InvokeSuccessCallback(result.presentation_id(),
- *result.route());
+ presentation_request->InvokeSuccessCallback(
+ result.presentation_id(), result.presentation_url(), *result.route());
}
}

Powered by Google App Engine
This is Rietveld 408576698