OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PresentationController.h" | 5 #include "modules/presentation/PresentationController.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/LocalFrame.h" | 8 #include "core/frame/LocalFrame.h" |
9 #include "modules/presentation/PresentationConnection.h" | 9 #include "modules/presentation/PresentationConnection.h" |
10 #include "public/platform/modules/presentation/WebPresentationClient.h" | 10 #include "public/platform/modules/presentation/WebPresentationClient.h" |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 m_connections.add(connection); | 141 m_connections.add(connection); |
142 } | 142 } |
143 | 143 |
144 void PresentationController::contextDestroyed() { | 144 void PresentationController::contextDestroyed() { |
145 if (m_client) { | 145 if (m_client) { |
146 m_client->setController(nullptr); | 146 m_client->setController(nullptr); |
147 m_client = nullptr; | 147 m_client = nullptr; |
148 } | 148 } |
149 } | 149 } |
150 | 150 |
151 PresentationConnection* PresentationController::findExistingConnection( | |
152 const blink::WebVector<blink::WebURL>& presentationUrls, | |
153 const blink::WebString& presentationId) { | |
154 for (const auto& connection : m_connections) { | |
155 for (const auto& presentationUrl : presentationUrls) { | |
156 if (connection->getState() != | |
157 WebPresentationConnectionState::Terminated && | |
158 connection->matches(presentationId, presentationUrl)) | |
159 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.
| |
160 } | |
161 } | |
162 return nullptr; | |
163 } | |
164 | |
151 PresentationConnection* PresentationController::findConnection( | 165 PresentationConnection* PresentationController::findConnection( |
152 WebPresentationConnectionClient* connectionClient) { | 166 WebPresentationConnectionClient* connectionClient) { |
153 for (const auto& connection : m_connections) { | 167 for (const auto& connection : m_connections) { |
154 if (connection->matches(connectionClient)) | 168 if (connection->matches(connectionClient)) |
155 return connection.get(); | 169 return connection.get(); |
156 } | 170 } |
157 | 171 |
158 return nullptr; | 172 return nullptr; |
159 } | 173 } |
160 | 174 |
161 } // namespace blink | 175 } // namespace blink |
OLD | NEW |