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

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

Issue 2479703003: Stop preloading scripts that have invalid type/language attributes (Closed)
Patch Set: Created 4 years, 1 month 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"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 return m_clientHintsPreferences; 88 return m_clientHintsPreferences;
89 } 89 }
90 ReferrerPolicy getReferrerPolicy() const { return m_referrerPolicy; } 90 ReferrerPolicy getReferrerPolicy() const { return m_referrerPolicy; }
91 void setIntegrityMetadata(const IntegrityMetadataSet& metadataSet) { 91 void setIntegrityMetadata(const IntegrityMetadataSet& metadataSet) {
92 m_integrityMetadata = metadataSet; 92 m_integrityMetadata = metadataSet;
93 } 93 }
94 const IntegrityMetadataSet& integrityMetadata() const { 94 const IntegrityMetadataSet& integrityMetadata() const {
95 return m_integrityMetadata; 95 return m_integrityMetadata;
96 } 96 }
97 97
98 void setScriptHasInvalidTypeOrLanguage() {
99 m_hasInvalidTypeOrLanguage = true;
100 }
101 bool scriptHasInvalidTypeOrLanguage() { return m_hasInvalidTypeOrLanguage; }
102
103 private: 98 private:
104 PreloadRequest(const String& initiatorName, 99 PreloadRequest(const String& initiatorName,
105 const TextPosition& initiatorPosition, 100 const TextPosition& initiatorPosition,
106 const String& resourceURL, 101 const String& resourceURL,
107 const KURL& baseURL, 102 const KURL& baseURL,
108 Resource::Type resourceType, 103 Resource::Type resourceType,
109 const FetchRequest::ResourceWidth& resourceWidth, 104 const FetchRequest::ResourceWidth& resourceWidth,
110 const ClientHintsPreferences& clientHintsPreferences, 105 const ClientHintsPreferences& clientHintsPreferences,
111 RequestType requestType, 106 RequestType requestType,
112 const ReferrerPolicy referrerPolicy) 107 const ReferrerPolicy referrerPolicy)
(...skipping 20 matching lines...) Expand all
133 Resource::Type m_resourceType; 128 Resource::Type m_resourceType;
134 CrossOriginAttributeValue m_crossOrigin; 129 CrossOriginAttributeValue m_crossOrigin;
135 String m_nonce; 130 String m_nonce;
136 double m_discoveryTime; 131 double m_discoveryTime;
137 FetchRequest::DeferOption m_defer; 132 FetchRequest::DeferOption m_defer;
138 FetchRequest::ResourceWidth m_resourceWidth; 133 FetchRequest::ResourceWidth m_resourceWidth;
139 ClientHintsPreferences m_clientHintsPreferences; 134 ClientHintsPreferences m_clientHintsPreferences;
140 RequestType m_requestType; 135 RequestType m_requestType;
141 ReferrerPolicy m_referrerPolicy; 136 ReferrerPolicy m_referrerPolicy;
142 IntegrityMetadataSet m_integrityMetadata; 137 IntegrityMetadataSet m_integrityMetadata;
143
144 // Used for deprecation warnings.
145 bool m_hasInvalidTypeOrLanguage = false;
146 }; 138 };
147 139
148 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; 140 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream;
149 141
150 } // namespace blink 142 } // namespace blink
151 143
152 #endif 144 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698