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 "core/inspector/InspectorResourceContentLoader.h" | 5 #include "core/inspector/InspectorResourceContentLoader.h" |
6 | 6 |
7 #include "core/css/CSSStyleSheet.h" | 7 #include "core/css/CSSStyleSheet.h" |
8 #include "core/css/StyleSheetContents.h" | 8 #include "core/css/StyleSheetContents.h" |
9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 for (Document* document : documents) { | 110 for (Document* document : documents) { |
111 HashSet<String> urls_to_fetch; | 111 HashSet<String> urls_to_fetch; |
112 | 112 |
113 ResourceRequest resource_request; | 113 ResourceRequest resource_request; |
114 HistoryItem* item = | 114 HistoryItem* item = |
115 document->Loader() ? document->Loader()->GetHistoryItem() : nullptr; | 115 document->Loader() ? document->Loader()->GetHistoryItem() : nullptr; |
116 if (item) { | 116 if (item) { |
117 resource_request = item->GenerateResourceRequest( | 117 resource_request = item->GenerateResourceRequest( |
118 WebCachePolicy::kReturnCacheDataDontLoad); | 118 WebCachePolicy::kReturnCacheDataDontLoad); |
119 } else { | 119 } else { |
120 resource_request = document->Url(); | 120 resource_request = ResourceRequest(document->Url()); |
121 resource_request.SetCachePolicy(WebCachePolicy::kReturnCacheDataDontLoad); | 121 resource_request.SetCachePolicy(WebCachePolicy::kReturnCacheDataDontLoad); |
122 } | 122 } |
123 resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal); | 123 resource_request.SetRequestContext(WebURLRequest::kRequestContextInternal); |
124 | 124 |
125 if (!resource_request.Url().GetString().IsEmpty()) { | 125 if (!resource_request.Url().GetString().IsEmpty()) { |
126 urls_to_fetch.insert(resource_request.Url().GetString()); | 126 urls_to_fetch.insert(resource_request.Url().GetString()); |
127 FetchParameters params(resource_request, | 127 FetchParameters params(resource_request, |
128 FetchInitiatorTypeNames::internal); | 128 FetchInitiatorTypeNames::internal); |
129 Resource* resource = RawResource::Fetch(params, document->Fetcher()); | 129 Resource* resource = RawResource::Fetch(params, document->Fetcher()); |
130 if (resource) { | 130 if (resource) { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 (*callback)(); | 230 (*callback)(); |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 void InspectorResourceContentLoader::ResourceFinished(ResourceClient* client) { | 234 void InspectorResourceContentLoader::ResourceFinished(ResourceClient* client) { |
235 pending_resource_clients_.erase(client); | 235 pending_resource_clients_.erase(client); |
236 CheckDone(); | 236 CheckDone(); |
237 } | 237 } |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
OLD | NEW |