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); |
220 return resource; | 225 return resource; |
221 } | 226 } |
222 | 227 |
223 void DocumentLoader::SetServiceWorkerNetworkProvider( | 228 void DocumentLoader::SetServiceWorkerNetworkProvider( |
224 std::unique_ptr<WebServiceWorkerNetworkProvider> provider) { | 229 std::unique_ptr<WebServiceWorkerNetworkProvider> provider) { |
225 service_worker_network_provider_ = std::move(provider); | 230 service_worker_network_provider_ = std::move(provider); |
226 } | 231 } |
227 | 232 |
228 void DocumentLoader::SetSourceLocation( | 233 void DocumentLoader::SetSourceLocation( |
229 std::unique_ptr<SourceLocation> source_location) { | 234 std::unique_ptr<SourceLocation> source_location) { |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 InstallNewDocumentReason::kJavascriptURL, | 1108 InstallNewDocumentReason::kJavascriptURL, |
1104 kForceSynchronousParsing, KURL()); | 1109 kForceSynchronousParsing, KURL()); |
1105 if (!source.IsNull()) | 1110 if (!source.IsNull()) |
1106 writer_->AppendReplacingData(source); | 1111 writer_->AppendReplacingData(source); |
1107 EndWriting(); | 1112 EndWriting(); |
1108 } | 1113 } |
1109 | 1114 |
1110 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); | 1115 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); |
1111 | 1116 |
1112 } // namespace blink | 1117 } // namespace blink |
OLD | NEW |