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