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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 147 |
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 { |
haraken
2014/09/02 09:15:40
Shall we add some ASSERT to check that stop() has
keishi
2014/09/02 11:10:21
Done.
| |
158 } | |
159 | |
160 void InspectorResourceContentLoader::trace(Visitor* visitor) | |
161 { | |
162 visitor->trace(m_callbacks); | |
163 visitor->trace(m_page); | |
164 } | |
165 | |
166 void InspectorResourceContentLoader::dispose() | |
167 { | |
158 stop(); | 168 stop(); |
159 } | 169 } |
160 | 170 |
161 void InspectorResourceContentLoader::stop() | 171 void InspectorResourceContentLoader::stop() |
162 { | 172 { |
163 HashSet<ResourceClient*> pendingResourceClients; | 173 HashSet<ResourceClient*> pendingResourceClients; |
164 m_pendingResourceClients.swap(pendingResourceClients); | 174 m_pendingResourceClients.swap(pendingResourceClients); |
165 for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.be gin(); it != pendingResourceClients.end(); ++it) | 175 for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.be gin(); it != pendingResourceClients.end(); ++it) |
166 (*it)->m_loader = 0; | 176 (*it)->m_loader = 0; |
167 m_resources.clear(); | 177 m_resources.clear(); |
(...skipping 16 matching lines...) Expand all Loading... | |
184 (*it)->handleEvent(); | 194 (*it)->handleEvent(); |
185 } | 195 } |
186 | 196 |
187 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) | 197 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) |
188 { | 198 { |
189 m_pendingResourceClients.remove(client); | 199 m_pendingResourceClients.remove(client); |
190 checkDone(); | 200 checkDone(); |
191 } | 201 } |
192 | 202 |
193 } // namespace blink | 203 } // namespace blink |
OLD | NEW |