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/Resource.h" | 11 #include "core/fetch/Resource.h" |
11 #include "platform/weborigin/SecurityPolicy.h" | 12 #include "platform/weborigin/SecurityPolicy.h" |
12 #include "wtf/Allocator.h" | 13 #include "wtf/Allocator.h" |
13 #include "wtf/text/TextPosition.h" | 14 #include "wtf/text/TextPosition.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class Document; | 18 class Document; |
18 | 19 |
19 class PreloadRequest { | 20 class PreloadRequest { |
(...skipping 23 matching lines...) Expand all Loading... |
43 Resource::Type resourceType() const { return m_resourceType; } | 44 Resource::Type resourceType() const { return m_resourceType; } |
44 | 45 |
45 const String& resourceURL() const { return m_resourceURL; } | 46 const String& resourceURL() const { return m_resourceURL; } |
46 float resourceWidth() const { return m_resourceWidth.isSet ? m_resourceWidth
.width : 0; } | 47 float resourceWidth() const { return m_resourceWidth.isSet ? m_resourceWidth
.width : 0; } |
47 const KURL& baseURL() const { return m_baseURL; } | 48 const KURL& baseURL() const { return m_baseURL; } |
48 bool isPreconnect() const { return m_requestType == RequestTypePreconnect; } | 49 bool isPreconnect() const { return m_requestType == RequestTypePreconnect; } |
49 bool isCORS() const { return m_isCORSEnabled; } | 50 bool isCORS() const { return m_isCORSEnabled; } |
50 bool isAllowCredentials() const { return m_allowCredentials == AllowStoredCr
edentials; } | 51 bool isAllowCredentials() const { return m_allowCredentials == AllowStoredCr
edentials; } |
51 const ClientHintsPreferences& preferences() const { return m_clientHintsPref
erences; } | 52 const ClientHintsPreferences& preferences() const { return m_clientHintsPref
erences; } |
52 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } | 53 ReferrerPolicy referrerPolicy() const { return m_referrerPolicy; } |
| 54 void setIntegrityMetadata(const IntegrityMetadataSet& metadataSet) |
| 55 { |
| 56 m_integrityMetadata = metadataSet; |
| 57 } |
| 58 IntegrityMetadataSet integrityMetadata() const |
| 59 { |
| 60 return m_integrityMetadata; |
| 61 } |
53 | 62 |
54 private: | 63 private: |
55 PreloadRequest(const String& initiatorName, | 64 PreloadRequest(const String& initiatorName, |
56 const TextPosition& initiatorPosition, | 65 const TextPosition& initiatorPosition, |
57 const String& resourceURL, | 66 const String& resourceURL, |
58 const KURL& baseURL, | 67 const KURL& baseURL, |
59 Resource::Type resourceType, | 68 Resource::Type resourceType, |
60 const FetchRequest::ResourceWidth& resourceWidth, | 69 const FetchRequest::ResourceWidth& resourceWidth, |
61 const ClientHintsPreferences& clientHintsPreferences, | 70 const ClientHintsPreferences& clientHintsPreferences, |
62 RequestType requestType, | 71 RequestType requestType, |
(...skipping 23 matching lines...) Expand all Loading... |
86 String m_charset; | 95 String m_charset; |
87 Resource::Type m_resourceType; | 96 Resource::Type m_resourceType; |
88 bool m_isCORSEnabled; | 97 bool m_isCORSEnabled; |
89 StoredCredentials m_allowCredentials; | 98 StoredCredentials m_allowCredentials; |
90 double m_discoveryTime; | 99 double m_discoveryTime; |
91 FetchRequest::DeferOption m_defer; | 100 FetchRequest::DeferOption m_defer; |
92 FetchRequest::ResourceWidth m_resourceWidth; | 101 FetchRequest::ResourceWidth m_resourceWidth; |
93 ClientHintsPreferences m_clientHintsPreferences; | 102 ClientHintsPreferences m_clientHintsPreferences; |
94 RequestType m_requestType; | 103 RequestType m_requestType; |
95 ReferrerPolicy m_referrerPolicy; | 104 ReferrerPolicy m_referrerPolicy; |
| 105 IntegrityMetadataSet m_integrityMetadata; |
96 }; | 106 }; |
97 | 107 |
98 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream; | 108 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream; |
99 | 109 |
100 } | 110 } |
101 | 111 |
102 #endif | 112 #endif |
OLD | NEW |