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

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

Issue 1202963004: Gets presentation ID from route ID upon route creation, and overrides previous presentation ID with… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « no previous file | chrome/browser/media/router/create_session_request_unittest.cc » ('j') | 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/media/router/create_session_request.h" 5 #include "chrome/browser/media/router/create_session_request.h"
6 6
7 #include "chrome/browser/media/router/media_source_helper.h" 7 #include "chrome/browser/media/router/media_source_helper.h"
8 8
9 using content::PresentationSessionInfo; 9 using content::PresentationSessionInfo;
10 using content::PresentationError; 10 using content::PresentationError;
(...skipping 13 matching lines...) Expand all
24 error_cb_(error_cb), 24 error_cb_(error_cb),
25 cb_invoked_(false) { 25 cb_invoked_(false) {
26 } 26 }
27 27
28 CreateSessionRequest::~CreateSessionRequest() { 28 CreateSessionRequest::~CreateSessionRequest() {
29 } 29 }
30 30
31 void CreateSessionRequest::MaybeInvokeSuccessCallback( 31 void CreateSessionRequest::MaybeInvokeSuccessCallback(
32 const MediaRoute::Id& route_id) { 32 const MediaRoute::Id& route_id) {
33 if (!cb_invoked_) { 33 if (!cb_invoked_) {
34 success_cb_.Run(presentation_info_, route_id); 34 // Overwrite presentation ID.
35 success_cb_.Run(content::PresentationSessionInfo(
36 presentation_info_.presentation_url,
37 GetPresentationIdAndUrl(route_id).first),
38 route_id);
35 cb_invoked_ = true; 39 cb_invoked_ = true;
36 } 40 }
37 } 41 }
38 42
39 void CreateSessionRequest::MaybeInvokeErrorCallback( 43 void CreateSessionRequest::MaybeInvokeErrorCallback(
40 const content::PresentationError& error) { 44 const content::PresentationError& error) {
41 if (!cb_invoked_) { 45 if (!cb_invoked_) {
42 error_cb_.Run(error); 46 error_cb_.Run(error);
43 cb_invoked_ = true; 47 cb_invoked_ = true;
44 } 48 }
45 } 49 }
46 50
47 } // namespace media_router 51 } // namespace media_router
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/media/router/create_session_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698