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

Side by Side Diff: third_party/WebKit/Source/core/loader/DocumentLoader.cpp

Issue 2834733003: Separate preaload matching from MemoryCache (Closed)
Patch Set: fix Created 3 years, 7 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
OLDNEW
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
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 865 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 InstallNewDocumentReason::kJavascriptURL, 1095 InstallNewDocumentReason::kJavascriptURL,
1101 kForceSynchronousParsing, KURL()); 1096 kForceSynchronousParsing, KURL());
1102 if (!source.IsNull()) 1097 if (!source.IsNull())
1103 writer_->AppendReplacingData(source); 1098 writer_->AppendReplacingData(source);
1104 EndWriting(); 1099 EndWriting();
1105 } 1100 }
1106 1101
1107 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader); 1102 DEFINE_WEAK_IDENTIFIER_MAP(DocumentLoader);
1108 1103
1109 } // namespace blink 1104 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698