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

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: resolve code review comments from haraken, Mark, and mlamouri Created 4 years 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 65d4edecad0fbfcede0a233126b2afe3d2d6efb7..d7687dbe4e2a64d5ca13493894240bcca894f2c9 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationController.cpp
@@ -148,6 +148,20 @@ 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();
mlamouri (slow - plz ping) 2017/01/03 12:02:11 style: you need { } because the condition is more
zhaobin 2017/01/03 20:12:07 Done.
+ }
+ }
+ return nullptr;
+}
+
PresentationConnection* PresentationController::findConnection(
WebPresentationConnectionClient* connectionClient) {
for (const auto& connection : m_connections) {

Powered by Google App Engine
This is Rietveld 408576698