| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |