Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: Source/core/inspector/InspectorResourceContentLoader.cpp

Issue 527183002: Oilpan: Prepare moving InspectorResourceContentLoader to Oilpan (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698