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

Side by Side Diff: third_party/WebKit/Source/modules/presentation/PresentationConnectionList.cpp

Issue 2355723004: [Presentation API] 1-UA: send message between controller and receiver page (Closed)
Patch Set: Merge with changes in Issue 2343013002 Created 4 years, 3 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "modules/presentation/PresentationConnectionList.h" 5 #include "modules/presentation/PresentationConnectionList.h"
6 6
7 #include "core/frame/UseCounter.h" 7 #include "core/frame/UseCounter.h"
8 #include "modules/EventTargetModules.h" 8 #include "modules/EventTargetModules.h"
9 #include "modules/presentation/PresentationConnection.h" 9 #include "modules/presentation/PresentationConnection.h"
10 #include "modules/presentation/PresentationConnectionAvailableEvent.h" 10 #include "modules/presentation/PresentationConnectionAvailableEvent.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 { 47 {
48 dispatchEvent(PresentationConnectionAvailableEvent::create( 48 dispatchEvent(PresentationConnectionAvailableEvent::create(
49 EventTypeNames::connectionavailable, connection)); 49 EventTypeNames::connectionavailable, connection));
50 } 50 }
51 51
52 bool PresentationConnectionList::isEmpty() 52 bool PresentationConnectionList::isEmpty()
53 { 53 {
54 return m_connections.isEmpty(); 54 return m_connections.isEmpty();
55 } 55 }
56 56
57 PresentationConnection* PresentationConnectionList::findConnection(WebPresentati onConnectionClient* connectionClient)
58 {
59 for (const auto& connection : m_connections) {
60 if (connection->matches(connectionClient))
61 return connection.get();
62 }
63
64 return nullptr;
65 }
66
57 DEFINE_TRACE(PresentationConnectionList) 67 DEFINE_TRACE(PresentationConnectionList)
58 { 68 {
59 visitor->trace(m_connections); 69 visitor->trace(m_connections);
60 ContextLifecycleObserver::trace(visitor); 70 ContextLifecycleObserver::trace(visitor);
61 EventTargetWithInlineData::trace(visitor); 71 EventTargetWithInlineData::trace(visitor);
62 } 72 }
63 73
64 } // namespace blink 74 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698