| 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" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 if (!m_isLocal) { | 77 if (!m_isLocal) { |
| 78 if (m_document) | 78 if (m_document) |
| 79 m_document->addClient(client); | 79 m_document->addClient(client); |
| 80 return; | 80 return; |
| 81 } | 81 } |
| 82 TreeScope* clientScope = client->treeScope(); | 82 TreeScope* clientScope = client->treeScope(); |
| 83 if (!clientScope) | 83 if (!clientScope) |
| 84 return; | 84 return; |
| 85 // Ensure sure we have an observer registered for this tree scope. | 85 // Ensure sure we have an observer registered for this tree scope. |
| 86 auto& scopeObserver = | 86 auto& scopeObserver = |
| 87 m_observers.add(clientScope, nullptr).storedValue->value; | 87 m_observers.insert(clientScope, nullptr).storedValue->value; |
| 88 if (!scopeObserver) | 88 if (!scopeObserver) |
| 89 scopeObserver = new IdObserver(*clientScope, *this); | 89 scopeObserver = new IdObserver(*clientScope, *this); |
| 90 | 90 |
| 91 auto& observer = m_clients.add(client, nullptr).storedValue->value; | 91 auto& observer = m_clients.insert(client, nullptr).storedValue->value; |
| 92 if (!observer) | 92 if (!observer) |
| 93 observer = scopeObserver; | 93 observer = scopeObserver; |
| 94 | 94 |
| 95 DCHECK(observer && scopeObserver); | 95 DCHECK(observer && scopeObserver); |
| 96 | 96 |
| 97 // If the client moved to a different scope, we need to unregister the old | 97 // If the client moved to a different scope, we need to unregister the old |
| 98 // observer and transfer any clients from it before replacing it. Thus any | 98 // observer and transfer any clients from it before replacing it. Thus any |
| 99 // clients that remain to be removed will be transferred to the new observer, | 99 // clients that remain to be removed will be transferred to the new observer, |
| 100 // and hence removed from it instead. | 100 // and hence removed from it instead. |
| 101 if (observer != scopeObserver) { | 101 if (observer != scopeObserver) { |
| (...skipping 88 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 |