| 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 ASSERT(m_resources.isEmpty()); |
| 159 } |
| 160 |
| 161 void InspectorResourceContentLoader::trace(Visitor* visitor) |
| 162 { |
| 163 visitor->trace(m_callbacks); |
| 164 visitor->trace(m_page); |
| 165 } |
| 166 |
| 167 void InspectorResourceContentLoader::dispose() |
| 168 { |
| 158 stop(); | 169 stop(); |
| 159 } | 170 } |
| 160 | 171 |
| 161 void InspectorResourceContentLoader::stop() | 172 void InspectorResourceContentLoader::stop() |
| 162 { | 173 { |
| 163 HashSet<ResourceClient*> pendingResourceClients; | 174 HashSet<ResourceClient*> pendingResourceClients; |
| 164 m_pendingResourceClients.swap(pendingResourceClients); | 175 m_pendingResourceClients.swap(pendingResourceClients); |
| 165 for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.be
gin(); it != pendingResourceClients.end(); ++it) | 176 for (HashSet<ResourceClient*>::const_iterator it = pendingResourceClients.be
gin(); it != pendingResourceClients.end(); ++it) |
| 166 (*it)->m_loader = 0; | 177 (*it)->m_loader = 0; |
| 167 m_resources.clear(); | 178 m_resources.clear(); |
| (...skipping 16 matching lines...) Expand all Loading... |
| 184 (*it)->handleEvent(); | 195 (*it)->handleEvent(); |
| 185 } | 196 } |
| 186 | 197 |
| 187 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) | 198 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) |
| 188 { | 199 { |
| 189 m_pendingResourceClients.remove(client); | 200 m_pendingResourceClients.remove(client); |
| 190 checkDone(); | 201 checkDone(); |
| 191 } | 202 } |
| 192 | 203 |
| 193 } // namespace blink | 204 } // namespace blink |
| OLD | NEW |