OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 case Resource::kImportResource: | 210 case Resource::kImportResource: |
211 resource = RawResource::FetchImport(params, Fetcher()); | 211 resource = RawResource::FetchImport(params, Fetcher()); |
212 break; | 212 break; |
213 case Resource::kRaw: | 213 case Resource::kRaw: |
214 resource = RawResource::Fetch(params, Fetcher()); | 214 resource = RawResource::Fetch(params, Fetcher()); |
215 break; | 215 break; |
216 default: | 216 default: |
217 NOTREACHED(); | 217 NOTREACHED(); |
218 } | 218 } |
219 | 219 |
220 // CSP layout tests verify that preloads are subject to access checks by | |
221 // seeing if they are in the `preload started` list. Therefore do not add | |
222 // them to the list if the load is immediately denied. | |
223 if (resource && !resource->GetResourceError().IsAccessCheck()) | |
224 Fetcher()->PreloadStarted(resource); | |
225 return resource; | 220 return resource; |
226 } | 221 } |
227 | 222 |
228 void DocumentLoader::SetServiceWorkerNetworkProvider( | 223 void DocumentLoader::SetServiceWorkerNetworkProvider( |
229 std::unique_ptr<WebServiceWorkerNetworkProvider> provider) { | 224 std::unique_ptr<WebServiceWorkerNetworkProvider> provider) { |
230 service_worker_network_provider_ = std::move(provider); | 225 service_worker_network_provider_ = std::move(provider); |
231 } | 226 } |
232 | 227 |
233 void DocumentLoader::SetSourceLocation( | 228 void DocumentLoader::SetSourceLocation( |
234 std::unique_ptr<SourceLocation> source_location) { | 229 std::unique_ptr<SourceLocation> source_location) { |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 InstallNewDocumentReason::kJavascriptURL, | 1103 InstallNewDocumentReason::kJavascriptURL, |
1109 kForceSynchronousParsing, KURL()); | 1104 kForceSynchronousParsing, KURL()); |
1110 if (!source.IsNull()) | 1105 if (!source.IsNull()) |
1111 writer_->AppendReplacingData(source); | 1106 writer_->AppendReplacingData(source); |
1112 EndWriting(); | 1107 EndWriting(); |
1113 } | 1108 } |
1114 | 1109 |
1115 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1110 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
1116 | 1111 |
1117 } // namespace blink | 1112 } // namespace blink |
OLD | NEW |