| 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 "core/svg/SVGElementProxy.h" | 5 #include "core/svg/SVGElementProxy.h" |
| 6 | 6 |
| 7 #include "core/dom/IdTargetObserver.h" | 7 #include "core/dom/IdTargetObserver.h" |
| 8 #include "core/svg/SVGElement.h" | 8 #include "core/svg/SVGElement.h" |
| 9 #include "core/svg/SVGResourceClient.h" | 9 #include "core/svg/SVGResourceClient.h" |
| 10 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" | 10 #include "platform/loader/fetch/FetchInitiatorTypeNames.h" |
| 11 #include "platform/loader/fetch/FetchRequest.h" | 11 #include "platform/loader/fetch/FetchRequest.h" |
| 12 #include "platform/loader/fetch/ResourceFetcher.h" | 12 #include "platform/loader/fetch/ResourceFetcher.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class SVGElementProxy::IdObserver : public IdTargetObserver { | 16 class SVGElementProxy::IdObserver : public IdTargetObserver { |
| 17 public: | 17 public: |
| 18 IdObserver(TreeScope& treeScope, SVGElementProxy& proxy) | 18 IdObserver(TreeScope& treeScope, SVGElementProxy& proxy) |
| 19 : IdTargetObserver(treeScope.idTargetObserverRegistry(), proxy.id()), | 19 : IdTargetObserver(treeScope.idTargetObserverRegistry(), proxy.id()), |
| 20 m_treeScope(&treeScope) {} | 20 m_treeScope(&treeScope) {} |
| 21 | 21 |
| 22 void addClient(SVGResourceClient* client) { m_clients.add(client); } | 22 void addClient(SVGResourceClient* client) { m_clients.insert(client); } |
| 23 bool removeClient(SVGResourceClient* client) { | 23 bool removeClient(SVGResourceClient* client) { |
| 24 return m_clients.remove(client); | 24 return m_clients.remove(client); |
| 25 } | 25 } |
| 26 bool hasClients() const { return !m_clients.isEmpty(); } | 26 bool hasClients() const { return !m_clients.isEmpty(); } |
| 27 | 27 |
| 28 TreeScope* treeScope() const { return m_treeScope; } | 28 TreeScope* treeScope() const { return m_treeScope; } |
| 29 void transferClients(IdObserver& observer) { | 29 void transferClients(IdObserver& observer) { |
| 30 for (const auto& client : m_clients) | 30 for (const auto& client : m_clients) |
| 31 observer.m_clients.add(client.key, client.value); | 31 observer.m_clients.insert(client.key, client.value); |
| 32 m_clients.clear(); | 32 m_clients.clear(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 DEFINE_INLINE_VIRTUAL_TRACE() { | 35 DEFINE_INLINE_VIRTUAL_TRACE() { |
| 36 visitor->trace(m_clients); | 36 visitor->trace(m_clients); |
| 37 visitor->trace(m_treeScope); | 37 visitor->trace(m_treeScope); |
| 38 IdTargetObserver::trace(visitor); | 38 IdTargetObserver::trace(visitor); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void contentChanged() { | 41 void contentChanged() { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 void SVGElementProxySet::notifyContentChanged(TreeScope& treeScope) { | 190 void SVGElementProxySet::notifyContentChanged(TreeScope& treeScope) { |
| 191 for (SVGElementProxy* proxy : m_elementProxies) | 191 for (SVGElementProxy* proxy : m_elementProxies) |
| 192 proxy->contentChanged(treeScope); | 192 proxy->contentChanged(treeScope); |
| 193 } | 193 } |
| 194 | 194 |
| 195 DEFINE_TRACE(SVGElementProxySet) { | 195 DEFINE_TRACE(SVGElementProxySet) { |
| 196 visitor->trace(m_elementProxies); | 196 visitor->trace(m_elementProxies); |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace blink | 199 } // namespace blink |
| OLD | NEW |