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

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

Issue 2874483002: [Presentation API] Remove closed connections from PresentationConnectionList (Closed)
Patch Set: rebase with master Created 3 years, 7 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/PresentationConnectionList.cpp
diff --git a/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp b/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp
index cf4f2f2456fdb9064a8b30600399f1de293c54eb..cee3ca5bb27873e4f34b5e547fb645da8f89bff8 100644
--- a/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp
+++ b/third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp
@@ -40,6 +40,17 @@ void PresentationConnectionList::AddConnection(
connections_.push_back(connection);
}
+bool PresentationConnectionList::RemoveConnection(
+ WebPresentationConnection* connection) {
+ for (size_t i = 0; i < connections_.size(); i++) {
+ if (connections_[i] == connection) {
+ connections_.erase(i);
+ return true;
+ }
+ }
+ return false;
+}
+
void PresentationConnectionList::DispatchConnectionAvailableEvent(
PresentationConnection* connection) {
DispatchEvent(PresentationConnectionAvailableEvent::Create(

Powered by Google App Engine
This is Rietveld 408576698