OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
6 #include "core/inspector/InspectorResourceContentLoader.h" | 6 #include "core/inspector/InspectorResourceContentLoader.h" |
7 | 7 |
8 #include "core/FetchInitiatorTypeNames.h" | 8 #include "core/FetchInitiatorTypeNames.h" |
9 #include "core/css/CSSStyleSheet.h" | 9 #include "core/css/CSSStyleSheet.h" |
10 #include "core/css/StyleSheetContents.h" | 10 #include "core/css/StyleSheetContents.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 void InspectorResourceContentLoader::ensureResourcesContentLoaded(PassOwnPtrWill BeRawPtr<VoidCallback> callback) | 148 void InspectorResourceContentLoader::ensureResourcesContentLoaded(PassOwnPtrWill BeRawPtr<VoidCallback> callback) |
149 { | 149 { |
150 if (!m_started) | 150 if (!m_started) |
151 start(); | 151 start(); |
152 m_callbacks.append(callback); | 152 m_callbacks.append(callback); |
153 checkDone(); | 153 checkDone(); |
154 } | 154 } |
155 | 155 |
156 InspectorResourceContentLoader::~InspectorResourceContentLoader() | 156 InspectorResourceContentLoader::~InspectorResourceContentLoader() |
157 { | 157 { |
158 stop(); | 158 stop(); |
haraken
2014/09/02 07:19:00
stop() touches m_callbacks. We're not allowed to t
keishi
2014/09/02 09:08:51
Moved cleanup to dispose method.
| |
159 } | 159 } |
160 | 160 |
161 void InspectorResourceContentLoader::trace(Visitor* visitor) | |
162 { | |
163 visitor->trace(m_callbacks); | |
164 visitor->trace(m_page); | |
165 } | |
166 | |
161 void InspectorResourceContentLoader::stop() | 167 void InspectorResourceContentLoader::stop() |
162 { | 168 { |
163 HashSet<ResourceClient*> pendingResourceClients; | 169 HashSet<ResourceClient*> pendingResourceClients; |
164 m_pendingResourceClients.swap(pendingResourceClients); | 170 m_pendingResourceClients.swap(pendingResourceClients); |
165 for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.be gin(); it != pendingResourceClients.end(); ++it) | 171 for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.be gin(); it != pendingResourceClients.end(); ++it) |
166 (*it)->m_loader = 0; | 172 (*it)->m_loader = 0; |
167 m_resources.clear(); | 173 m_resources.clear(); |
168 // Make sure all callbacks are called to prevent infinite waiting time. | 174 // Make sure all callbacks are called to prevent infinite waiting time. |
169 checkDone(); | 175 checkDone(); |
170 } | 176 } |
(...skipping 13 matching lines...) Expand all Loading... | |
184 (*it)->handleEvent(); | 190 (*it)->handleEvent(); |
185 } | 191 } |
186 | 192 |
187 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) | 193 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) |
188 { | 194 { |
189 m_pendingResourceClients.remove(client); | 195 m_pendingResourceClients.remove(client); |
190 checkDone(); | 196 checkDone(); |
191 } | 197 } |
192 | 198 |
193 } // namespace blink | 199 } // namespace blink |
OLD | NEW |