Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/PreloadRequest.h |
| diff --git a/third_party/WebKit/Source/core/html/parser/PreloadRequest.h b/third_party/WebKit/Source/core/html/parser/PreloadRequest.h |
| index 3b5722e5c01b10eb24cfb89c77f39959128f56a8..2c4ceeb42b157b064dfd182ac1ee1359ecd5fea2 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/PreloadRequest.h |
| +++ b/third_party/WebKit/Source/core/html/parser/PreloadRequest.h |
| @@ -30,6 +30,8 @@ class PreloadRequest { |
| RequestTypeLinkRelPreload |
| }; |
| + // TODO(csharrison): Move the implementation to the cpp file when html |
| + // gets its own testing source set in html/BUILD.gn. |
| static std::unique_ptr<PreloadRequest> create( |
|
Yoav Weiss
2016/10/24 15:00:32
Usually `create()` doesn't fail in normal circumst
Charlie Harrison
2016/10/24 17:39:48
Done.
|
| const String& initiatorName, |
| const TextPosition& initiatorPosition, |
| @@ -42,6 +44,11 @@ class PreloadRequest { |
| const ClientHintsPreferences& clientHintsPreferences = |
| ClientHintsPreferences(), |
| RequestType requestType = RequestTypePreload) { |
| + // Never preload data or ref urls. |
| + if (resourceURL.isEmpty() || resourceURL.startsWith("#") || |
|
Yoav Weiss
2016/10/24 14:43:54
Are absolute ref URLs an issue? What would happen
Charlie Harrison
2016/10/24 14:49:31
I think absolute ref URLs are okay because we real
Yoav Weiss
2016/10/24 15:00:32
Thanks. Clarifying that in the comment would be in
Charlie Harrison
2016/10/24 17:39:48
Done.
|
| + protocolIs(resourceURL, "data")) { |
| + return nullptr; |
| + } |
| return wrapUnique(new PreloadRequest( |
| initiatorName, initiatorPosition, resourceURL, baseURL, resourceType, |
| resourceWidth, clientHintsPreferences, requestType, referrerPolicy)); |