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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return; | 120 return; |
121 IdObserver* observer = entry->value; | 121 IdObserver* observer = entry->value; |
122 DCHECK(observer); | 122 DCHECK(observer); |
123 // If the client is not the last client in the scope, then no further action | 123 // If the client is not the last client in the scope, then no further action |
124 // needs to be taken. | 124 // needs to be taken. |
125 if (!observer->removeClient(client)) | 125 if (!observer->removeClient(client)) |
126 return; | 126 return; |
127 // Unregister and drop the scope association, then drop the client. | 127 // Unregister and drop the scope association, then drop the client. |
128 if (!observer->hasClients()) { | 128 if (!observer->hasClients()) { |
129 observer->unregister(); | 129 observer->unregister(); |
130 m_observers.remove(observer->treeScope()); | 130 m_observers.erase(observer->treeScope()); |
131 } | 131 } |
132 m_clients.remove(entry); | 132 m_clients.remove(entry); |
133 } | 133 } |
134 | 134 |
135 void SVGElementProxy::resolve(Document& document) { | 135 void SVGElementProxy::resolve(Document& document) { |
136 if (m_isLocal || m_id.isEmpty() || m_url.isEmpty()) | 136 if (m_isLocal || m_id.isEmpty() || m_url.isEmpty()) |
137 return; | 137 return; |
138 FetchRequest request(ResourceRequest(m_url), FetchInitiatorTypeNames::css); | 138 FetchRequest request(ResourceRequest(m_url), FetchInitiatorTypeNames::css); |
139 m_document = DocumentResource::fetchSVGDocument(request, document.fetcher()); | 139 m_document = DocumentResource::fetchSVGDocument(request, document.fetcher()); |
140 m_url = String(); | 140 m_url = String(); |
(...skipping 49 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 |