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

Side by Side Diff: chrome/browser/media/router/create_presentation_connection_request.cc

Issue 2264153002: [Presentation API] Add support for multiple URLs in PresentationRequest on Media Router UI side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Mark's comments, add unit test for CMWMS Created 4 years, 3 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/create_presentation_connection_request.h" 5 #include "chrome/browser/media/router/create_presentation_connection_request.h"
6 6
7 #include <memory>
mark a. foltz 2016/09/02 23:00:37 This should go in the .h
takumif 2016/09/06 21:53:20 Done.
8
7 #include "chrome/browser/media/router/media_source_helper.h" 9 #include "chrome/browser/media/router/media_source_helper.h"
8 #include "chrome/browser/media/router/route_request_result.h" 10 #include "chrome/browser/media/router/route_request_result.h"
9 11
10 using content::PresentationSessionInfo; 12 using content::PresentationSessionInfo;
11 using content::PresentationError; 13 using content::PresentationError;
12 14
13 namespace media_router { 15 namespace media_router {
14 16
15 CreatePresentationConnectionRequest::CreatePresentationConnectionRequest( 17 CreatePresentationConnectionRequest::CreatePresentationConnectionRequest(
16 const RenderFrameHostId& render_frame_host_id, 18 const RenderFrameHostId& render_frame_host_id,
17 const std::string& presentation_url, 19 const std::string& presentation_url,
18 const GURL& frame_url, 20 const GURL& frame_url,
19 const PresentationSessionSuccessCallback& success_cb, 21 const PresentationSessionSuccessCallback& success_cb,
20 const PresentationSessionErrorCallback& error_cb) 22 const PresentationSessionErrorCallback& error_cb)
21 : presentation_request_(render_frame_host_id, presentation_url, frame_url), 23 : presentation_request_(
24 render_frame_host_id, {presentation_url}, frame_url),
22 success_cb_(success_cb), 25 success_cb_(success_cb),
23 error_cb_(error_cb), 26 error_cb_(error_cb),
24 cb_invoked_(false) { 27 cb_invoked_(false) {
25 DCHECK(!success_cb.is_null()); 28 DCHECK(!success_cb.is_null());
26 DCHECK(!error_cb.is_null()); 29 DCHECK(!error_cb.is_null());
27 } 30 }
28 31
29 CreatePresentationConnectionRequest::~CreatePresentationConnectionRequest() { 32 CreatePresentationConnectionRequest::~CreatePresentationConnectionRequest() {
30 if (!cb_invoked_) { 33 if (!cb_invoked_) {
31 error_cb_.Run(content::PresentationError( 34 error_cb_.Run(content::PresentationError(
(...skipping 30 matching lines...) Expand all
62 if (!result.route()) { 65 if (!result.route()) {
63 presentation_request->InvokeErrorCallback(content::PresentationError( 66 presentation_request->InvokeErrorCallback(content::PresentationError(
64 content::PRESENTATION_ERROR_UNKNOWN, result.error())); 67 content::PRESENTATION_ERROR_UNKNOWN, result.error()));
65 } else { 68 } else {
66 presentation_request->InvokeSuccessCallback( 69 presentation_request->InvokeSuccessCallback(
67 result.presentation_id(), result.route()->media_route_id()); 70 result.presentation_id(), result.route()->media_route_id());
68 } 71 }
69 } 72 }
70 73
71 } // namespace media_router 74 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698