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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/PreloadRequest.h

Issue 1563263002: Add HTMLPreloadScanner support for <link rel=preload> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a test as well as 2 bugs that other tests revealed Created 4 years, 11 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef PreloadRequest_h 5 #ifndef PreloadRequest_h
6 #define PreloadRequest_h 6 #define PreloadRequest_h
7 7
8 #include "core/fetch/ClientHintsPreferences.h" 8 #include "core/fetch/ClientHintsPreferences.h"
9 #include "core/fetch/FetchRequest.h" 9 #include "core/fetch/FetchRequest.h"
10 #include "core/fetch/IntegrityMetadata.h" 10 #include "core/fetch/IntegrityMetadata.h"
11 #include "core/fetch/Resource.h" 11 #include "core/fetch/Resource.h"
12 #include "platform/CrossOriginAttributeValue.h" 12 #include "platform/CrossOriginAttributeValue.h"
13 #include "platform/weborigin/SecurityPolicy.h" 13 #include "platform/weborigin/SecurityPolicy.h"
14 #include "wtf/Allocator.h" 14 #include "wtf/Allocator.h"
15 #include "wtf/text/TextPosition.h" 15 #include "wtf/text/TextPosition.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 class Document; 19 class Document;
20 20
21 class PreloadRequest { 21 class PreloadRequest {
22 USING_FAST_MALLOC(PreloadRequest); 22 USING_FAST_MALLOC(PreloadRequest);
23 public: 23 public:
24 enum RequestType { RequestTypePreload, RequestTypePreconnect }; 24 enum RequestType { RequestTypePreload, RequestTypePreconnect, RequestTypeLin kRelPreload };
25 25
26 static PassOwnPtr<PreloadRequest> create(const String& initiatorName, const TextPosition& initiatorPosition, const String& resourceURL, const KURL& baseURL, Resource::Type resourceType, const ReferrerPolicy referrerPolicy, const FetchRe quest::ResourceWidth& resourceWidth = FetchRequest::ResourceWidth(), const Clien tHintsPreferences& clientHintsPreferences = ClientHintsPreferences(), RequestTyp e requestType = RequestTypePreload) 26 static PassOwnPtr<PreloadRequest> create(const String& initiatorName, const TextPosition& initiatorPosition, const String& resourceURL, const KURL& baseURL, Resource::Type resourceType, const ReferrerPolicy referrerPolicy, const FetchRe quest::ResourceWidth& resourceWidth = FetchRequest::ResourceWidth(), const Clien tHintsPreferences& clientHintsPreferences = ClientHintsPreferences(), RequestTyp e requestType = RequestTypePreload)
27 { 27 {
28 return adoptPtr(new PreloadRequest(initiatorName, initiatorPosition, res ourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, requestT ype, referrerPolicy)); 28 return adoptPtr(new PreloadRequest(initiatorName, initiatorPosition, res ourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, requestT ype, referrerPolicy));
29 } 29 }
30 30
31 bool isSafeToSendToAnotherThread() const; 31 bool isSafeToSendToAnotherThread() const;
32 32
33 FetchRequest resourceRequest(Document*); 33 FetchRequest resourceRequest(Document*);
34 34
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 RequestType m_requestType; 102 RequestType m_requestType;
103 ReferrerPolicy m_referrerPolicy; 103 ReferrerPolicy m_referrerPolicy;
104 IntegrityMetadataSet m_integrityMetadata; 104 IntegrityMetadataSet m_integrityMetadata;
105 }; 105 };
106 106
107 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream; 107 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream;
108 108
109 } 109 }
110 110
111 #endif 111 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698