| 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/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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |