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

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

Issue 1156473002: Refactor FrameLoader loading interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 5 years, 6 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
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/css/CSSStyleSheet.h" 8 #include "core/css/CSSStyleSheet.h"
9 #include "core/css/StyleSheetContents.h" 9 #include "core/css/StyleSheetContents.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 LocalFrame* localFrame = toLocalFrame(frame); 91 LocalFrame* localFrame = toLocalFrame(frame);
92 documents.append(localFrame->document()); 92 documents.append(localFrame->document());
93 documents.appendVector(InspectorPageAgent::importsForFrame(localFrame)); 93 documents.appendVector(InspectorPageAgent::importsForFrame(localFrame));
94 } 94 }
95 for (Document* document : documents) { 95 for (Document* document : documents) {
96 HashSet<String> urlsToFetch; 96 HashSet<String> urlsToFetch;
97 97
98 ResourceRequest resourceRequest; 98 ResourceRequest resourceRequest;
99 HistoryItem* item = document->frame() ? document->frame()->loader().curr entItem() : nullptr; 99 HistoryItem* item = document->frame() ? document->frame()->loader().curr entItem() : nullptr;
100 if (item) { 100 if (item) {
101 resourceRequest = FrameLoader::requestFromHistoryItem(item, ReturnCa cheDataDontLoad); 101 resourceRequest =
102 FrameLoader::resourceRequestFromHistoryItem(item, ReturnCacheDat aDontLoad);
102 } else { 103 } else {
103 resourceRequest = document->url(); 104 resourceRequest = document->url();
104 resourceRequest.setCachePolicy(ReturnCacheDataDontLoad); 105 resourceRequest.setCachePolicy(ReturnCacheDataDontLoad);
105 } 106 }
106 resourceRequest.setRequestContext(WebURLRequest::RequestContextInternal) ; 107 resourceRequest.setRequestContext(WebURLRequest::RequestContextInternal) ;
107 108
108 if (!resourceRequest.url().string().isEmpty()) { 109 if (!resourceRequest.url().string().isEmpty()) {
109 urlsToFetch.add(resourceRequest.url().string()); 110 urlsToFetch.add(resourceRequest.url().string());
110 FetchRequest request(resourceRequest, FetchInitiatorTypeNames::inter nal); 111 FetchRequest request(resourceRequest, FetchInitiatorTypeNames::inter nal);
111 ResourcePtr<Resource> resource = document->fetcher()->fetchRawResour ce(request); 112 ResourcePtr<Resource> resource = document->fetcher()->fetchRawResour ce(request);
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 callback->handleEvent(); 195 callback->handleEvent();
195 } 196 }
196 197
197 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client) 198 void InspectorResourceContentLoader::resourceFinished(ResourceClient* client)
198 { 199 {
199 m_pendingResourceClients.remove(client); 200 m_pendingResourceClients.remove(client);
200 checkDone(); 201 checkDone();
201 } 202 }
202 203
203 } // namespace blink 204 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/loader/FrameLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698