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

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

Issue 1259073004: [Presentation API] Change ListenForSessionMessages API to client-style. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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_session_request.h" 5 #include "chrome/browser/media/router/create_presentation_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 19 matching lines...) Expand all
30 CreatePresentationSessionRequest::~CreatePresentationSessionRequest() { 30 CreatePresentationSessionRequest::~CreatePresentationSessionRequest() {
31 if (!cb_invoked_) { 31 if (!cb_invoked_) {
32 error_cb_.Run(content::PresentationError( 32 error_cb_.Run(content::PresentationError(
33 content::PRESENTATION_ERROR_UNKNOWN, "Unknown error.")); 33 content::PRESENTATION_ERROR_UNKNOWN, "Unknown error."));
34 } 34 }
35 } 35 }
36 36
37 void CreatePresentationSessionRequest::MaybeInvokeSuccessCallback( 37 void CreatePresentationSessionRequest::MaybeInvokeSuccessCallback(
38 const MediaRoute::Id& route_id) { 38 const MediaRoute::Id& route_id) {
39 if (!cb_invoked_) { 39 if (!cb_invoked_) {
40 // Overwrite presentation ID. 40 // Overwrite presentation ID.
mark a. foltz 2015/08/04 23:47:02 Update comment?
imcheng 2015/08/05 21:38:35 I partially reverted the code here since we still
41 success_cb_.Run(content::PresentationSessionInfo( 41 success_cb_.Run(presentation_info_, route_id);
42 presentation_info_.presentation_url,
43 GetPresentationIdAndUrl(route_id).first),
44 route_id);
45 cb_invoked_ = true; 42 cb_invoked_ = true;
46 } 43 }
47 } 44 }
48 45
49 void CreatePresentationSessionRequest::MaybeInvokeErrorCallback( 46 void CreatePresentationSessionRequest::MaybeInvokeErrorCallback(
50 const content::PresentationError& error) { 47 const content::PresentationError& error) {
51 if (!cb_invoked_) { 48 if (!cb_invoked_) {
52 error_cb_.Run(error); 49 error_cb_.Run(error);
53 cb_invoked_ = true; 50 cb_invoked_ = true;
54 } 51 }
55 } 52 }
56 53
57 } // namespace media_router 54 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698