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

Side by Side Diff: content/renderer/presentation/presentation_dispatcher.cc

Issue 1208083004: Presentation API: ignore presentation id passed to startSession(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments 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 | « content/renderer/presentation/presentation_dispatcher.h ('k') | no next file » | 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 "content/renderer/presentation/presentation_dispatcher.h" 5 #include "content/renderer/presentation/presentation_dispatcher.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (watched) 107 if (watched)
108 presentation_service_->ListenForScreenAvailability(); 108 presentation_service_->ListenForScreenAvailability();
109 else 109 else
110 presentation_service_->StopListeningForScreenAvailability(); 110 presentation_service_->StopListeningForScreenAvailability();
111 } 111 }
112 112
113 void PresentationDispatcher::startSession( 113 void PresentationDispatcher::startSession(
114 const blink::WebString& presentationUrl, 114 const blink::WebString& presentationUrl,
115 const blink::WebString& presentationId, 115 const blink::WebString& presentationId,
116 blink::WebPresentationSessionClientCallbacks* callback) { 116 blink::WebPresentationSessionClientCallbacks* callback) {
117 startSession(presentationUrl, callback);
118 }
119
120 void PresentationDispatcher::startSession(
121 const blink::WebString& presentationUrl,
122 blink::WebPresentationSessionClientCallbacks* callback) {
117 DCHECK(callback); 123 DCHECK(callback);
118 ConnectToPresentationServiceIfNeeded(); 124 ConnectToPresentationServiceIfNeeded();
119 125
120 // The dispatcher owns the service so |this| will be valid when 126 // The dispatcher owns the service so |this| will be valid when
121 // OnSessionCreated() is called. |callback| needs to be alive and also needs 127 // OnSessionCreated() is called. |callback| needs to be alive and also needs
122 // to be destroyed so we transfer its ownership to the mojo callback. 128 // to be destroyed so we transfer its ownership to the mojo callback.
123 presentation_service_->StartSession( 129 presentation_service_->StartSession(
124 presentationUrl.utf8(), 130 presentationUrl.utf8(),
125 presentationId.utf8(),
126 base::Bind(&PresentationDispatcher::OnSessionCreated, 131 base::Bind(&PresentationDispatcher::OnSessionCreated,
127 base::Unretained(this), 132 base::Unretained(this),
128 base::Owned(callback))); 133 base::Owned(callback)));
129 } 134 }
130 135
131 void PresentationDispatcher::joinSession( 136 void PresentationDispatcher::joinSession(
132 const blink::WebString& presentationUrl, 137 const blink::WebString& presentationUrl,
133 const blink::WebString& presentationId, 138 const blink::WebString& presentationId,
134 blink::WebPresentationSessionClientCallbacks* callback) { 139 blink::WebPresentationSessionClientCallbacks* callback) {
135 DCHECK(callback); 140 DCHECK(callback);
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 if (should_listen) { 481 if (should_listen) {
477 listening_state_ = ListeningState::Waiting; 482 listening_state_ = ListeningState::Waiting;
478 presentation_service_->ListenForScreenAvailability(); 483 presentation_service_->ListenForScreenAvailability();
479 } else { 484 } else {
480 listening_state_ = ListeningState::Inactive; 485 listening_state_ = ListeningState::Inactive;
481 presentation_service_->StopListeningForScreenAvailability(); 486 presentation_service_->StopListeningForScreenAvailability();
482 } 487 }
483 } 488 }
484 489
485 } // namespace content 490 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/presentation/presentation_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698