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

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

Issue 898593002: DevTools: use per-LocalFrame instrumenting agents instead of per-Page ones. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fixed assertion Created 5 years, 10 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 resourceFinished(const_cast<CSSStyleSheetResource*>(resource)); 66 resourceFinished(const_cast<CSSStyleSheetResource*>(resource));
67 } 67 }
68 68
69 void InspectorResourceContentLoader::ResourceClient::notifyFinished(Resource* re source) 69 void InspectorResourceContentLoader::ResourceClient::notifyFinished(Resource* re source)
70 { 70 {
71 if (resource->type() == Resource::CSSStyleSheet) 71 if (resource->type() == Resource::CSSStyleSheet)
72 return; 72 return;
73 resourceFinished(resource); 73 resourceFinished(resource);
74 } 74 }
75 75
76 InspectorResourceContentLoader::InspectorResourceContentLoader(Page* page) 76 InspectorResourceContentLoader::InspectorResourceContentLoader(LocalFrame* inspe ctedFrame)
77 : m_allRequestsStarted(false) 77 : m_allRequestsStarted(false)
78 , m_started(false) 78 , m_started(false)
79 , m_page(page) 79 , m_inspectedFrame(inspectedFrame)
80 { 80 {
81 } 81 }
82 82
83 void InspectorResourceContentLoader::start() 83 void InspectorResourceContentLoader::start()
84 { 84 {
85 m_started = true; 85 m_started = true;
86 Vector<Document*> documents; 86 Vector<Document*> documents;
87 for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree().traver seNext()) { 87 for (Frame* frame = m_inspectedFrame; frame; frame = frame->tree().traverseN ext(m_inspectedFrame)) {
88 if (!frame->isLocalFrame()) 88 if (!frame->isLocalFrame())
89 continue; 89 continue;
90 LocalFrame* localFrame = toLocalFrame(frame); 90 LocalFrame* localFrame = toLocalFrame(frame);
91 documents.append(localFrame->document()); 91 documents.append(localFrame->document());
92 documents.appendVector(InspectorPageAgent::importsForFrame(localFrame)); 92 documents.appendVector(InspectorPageAgent::importsForFrame(localFrame));
93 } 93 }
94 for (Document* document : documents) { 94 for (Document* document : documents) {
95 HashSet<String> urlsToFetch; 95 HashSet<String> urlsToFetch;
96 96
97 ResourceRequest resourceRequest; 97 ResourceRequest resourceRequest;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 152 }
153 153
154 InspectorResourceContentLoader::~InspectorResourceContentLoader() 154 InspectorResourceContentLoader::~InspectorResourceContentLoader()
155 { 155 {
156 ASSERT(m_resources.isEmpty()); 156 ASSERT(m_resources.isEmpty());
157 } 157 }
158 158
159 void InspectorResourceContentLoader::trace(Visitor* visitor) 159 void InspectorResourceContentLoader::trace(Visitor* visitor)
160 { 160 {
161 visitor->trace(m_callbacks); 161 visitor->trace(m_callbacks);
162 visitor->trace(m_page); 162 visitor->trace(m_inspectedFrame);
163 } 163 }
164 164
165 void InspectorResourceContentLoader::dispose() 165 void InspectorResourceContentLoader::dispose()
166 { 166 {
167 stop(); 167 stop();
168 } 168 }
169 169
170 void InspectorResourceContentLoader::stop() 170 void InspectorResourceContentLoader::stop()
171 { 171 {
172 HashSet<ResourceClient*> pendingResourceClients; 172 HashSet<ResourceClient*> pendingResourceClients;
(...skipping 20 matching lines...) Expand all
193 callback->handleEvent(); 193 callback->handleEvent();
194 } 194 }
195 195
196 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) 196 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client)
197 { 197 {
198 m_pendingResourceClients.remove(client); 198 m_pendingResourceClients.remove(client);
199 checkDone(); 199 checkDone();
200 } 200 }
201 201
202 } // namespace blink 202 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorResourceContentLoader.h ('k') | Source/core/inspector/InspectorTimelineAgent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698