OLD | NEW |
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 28 matching lines...) Expand all Loading... |
39 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; } | 39 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; } |
40 void setCharset(const String& charset) { m_charset = charset.isolatedCopy();
} | 40 void setCharset(const String& charset) { m_charset = charset.isolatedCopy();
} |
41 void setCrossOrigin(CrossOriginAttributeValue crossOrigin) | 41 void setCrossOrigin(CrossOriginAttributeValue crossOrigin) |
42 { | 42 { |
43 m_crossOrigin = crossOrigin; | 43 m_crossOrigin = crossOrigin; |
44 } | 44 } |
45 CrossOriginAttributeValue crossOrigin() const | 45 CrossOriginAttributeValue crossOrigin() const |
46 { | 46 { |
47 return m_crossOrigin; | 47 return m_crossOrigin; |
48 } | 48 } |
| 49 |
| 50 void setNonce(const String& nonce) { m_nonce = nonce.isolatedCopy(); } |
| 51 const String& nonce() const { return m_nonce; } |
| 52 |
49 Resource::Type resourceType() const { return m_resourceType; } | 53 Resource::Type resourceType() const { return m_resourceType; } |
50 | 54 |
51 const String& resourceURL() const { return m_resourceURL; } | 55 const String& resourceURL() const { return m_resourceURL; } |
52 float resourceWidth() const { return m_resourceWidth.isSet ? m_resourceWidth
.width : 0; } | 56 float resourceWidth() const { return m_resourceWidth.isSet ? m_resourceWidth
.width : 0; } |
53 const KURL& baseURL() const { return m_baseURL; } | 57 const KURL& baseURL() const { return m_baseURL; } |
54 bool isPreconnect() const { return m_requestType == RequestTypePreconnect; } | 58 bool isPreconnect() const { return m_requestType == RequestTypePreconnect; } |
55 const ClientHintsPreferences& preferences() const { return m_clientHintsPref
erences; } | 59 const ClientHintsPreferences& preferences() const { return m_clientHintsPref
erences; } |
56 ReferrerPolicy getReferrerPolicy() const { return m_referrerPolicy; } | 60 ReferrerPolicy getReferrerPolicy() const { return m_referrerPolicy; } |
57 void setIntegrityMetadata(const IntegrityMetadataSet& metadataSet) | 61 void setIntegrityMetadata(const IntegrityMetadataSet& metadataSet) |
58 { | 62 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 94 |
91 KURL completeURL(Document*); | 95 KURL completeURL(Document*); |
92 | 96 |
93 String m_initiatorName; | 97 String m_initiatorName; |
94 TextPosition m_initiatorPosition; | 98 TextPosition m_initiatorPosition; |
95 String m_resourceURL; | 99 String m_resourceURL; |
96 KURL m_baseURL; | 100 KURL m_baseURL; |
97 String m_charset; | 101 String m_charset; |
98 Resource::Type m_resourceType; | 102 Resource::Type m_resourceType; |
99 CrossOriginAttributeValue m_crossOrigin; | 103 CrossOriginAttributeValue m_crossOrigin; |
| 104 String m_nonce; |
100 double m_discoveryTime; | 105 double m_discoveryTime; |
101 FetchRequest::DeferOption m_defer; | 106 FetchRequest::DeferOption m_defer; |
102 FetchRequest::ResourceWidth m_resourceWidth; | 107 FetchRequest::ResourceWidth m_resourceWidth; |
103 ClientHintsPreferences m_clientHintsPreferences; | 108 ClientHintsPreferences m_clientHintsPreferences; |
104 RequestType m_requestType; | 109 RequestType m_requestType; |
105 ReferrerPolicy m_referrerPolicy; | 110 ReferrerPolicy m_referrerPolicy; |
106 IntegrityMetadataSet m_integrityMetadata; | 111 IntegrityMetadataSet m_integrityMetadata; |
107 }; | 112 }; |
108 | 113 |
109 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; | 114 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; |
110 | 115 |
111 } // namespace blink | 116 } // namespace blink |
112 | 117 |
113 #endif | 118 #endif |
OLD | NEW |