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

Unified Diff: third_party/WebKit/Source/modules/presentation/PresentationController.cpp

Issue 2602523002: [Presentation API] Resolve PresentationRequest::reconnect() with existing presentation connection i… (Closed)
Patch Set: remove getExecutionContext() null check in PresentationRequest::reconnect() Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/presentation/PresentationController.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationController.cpp b/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
index 0655e0f254525e3df322ba8b9831597af6b08c24..4044b27f0c71042b69a1a1a20369227f986f3aae 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
@@ -136,6 +136,21 @@ void PresentationController::contextDestroyed() {
}
}
+PresentationConnection* PresentationController::findExistingConnection(
+ const blink::WebVector<blink::WebURL>& presentationUrls,
+ const blink::WebString& presentationId) {
+ for (const auto& connection : m_connections) {
+ for (const auto& presentationUrl : presentationUrls) {
+ if (connection->getState() !=
+ WebPresentationConnectionState::Terminated &&
+ connection->matches(presentationId, presentationUrl)) {
+ return connection.get();
+ }
+ }
+ }
+ return nullptr;
+}
+
PresentationConnection* PresentationController::findConnection(
const WebPresentationSessionInfo& sessionInfo) {
for (const auto& connection : m_connections) {

Powered by Google App Engine
This is Rietveld 408576698