| 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 <memory> | 8 #include <memory> |
| 9 #include "core/CoreExport.h" | 9 #include "core/CoreExport.h" |
| 10 #include "platform/CrossOriginAttributeValue.h" | 10 #include "platform/CrossOriginAttributeValue.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const ClientHintsPreferences& Preferences() const { | 91 const ClientHintsPreferences& Preferences() const { |
| 92 return client_hints_preferences_; | 92 return client_hints_preferences_; |
| 93 } | 93 } |
| 94 ReferrerPolicy GetReferrerPolicy() const { return referrer_policy_; } | 94 ReferrerPolicy GetReferrerPolicy() const { return referrer_policy_; } |
| 95 void SetIntegrityMetadata(const IntegrityMetadataSet& metadata_set) { | 95 void SetIntegrityMetadata(const IntegrityMetadataSet& metadata_set) { |
| 96 integrity_metadata_ = metadata_set; | 96 integrity_metadata_ = metadata_set; |
| 97 } | 97 } |
| 98 const IntegrityMetadataSet& IntegrityMetadata() const { | 98 const IntegrityMetadataSet& IntegrityMetadata() const { |
| 99 return integrity_metadata_; | 99 return integrity_metadata_; |
| 100 } | 100 } |
| 101 void SetFromInsertionScanner(const bool from_insertion_scanner) { | |
| 102 from_insertion_scanner_ = from_insertion_scanner; | |
| 103 } | |
| 104 | 101 |
| 105 private: | 102 private: |
| 106 PreloadRequest(const String& initiator_name, | 103 PreloadRequest(const String& initiator_name, |
| 107 const TextPosition& initiator_position, | 104 const TextPosition& initiator_position, |
| 108 const String& resource_url, | 105 const String& resource_url, |
| 109 const KURL& base_url, | 106 const KURL& base_url, |
| 110 Resource::Type resource_type, | 107 Resource::Type resource_type, |
| 111 const FetchParameters::ResourceWidth& resource_width, | 108 const FetchParameters::ResourceWidth& resource_width, |
| 112 const ClientHintsPreferences& client_hints_preferences, | 109 const ClientHintsPreferences& client_hints_preferences, |
| 113 RequestType request_type, | 110 RequestType request_type, |
| 114 const ReferrerPolicy referrer_policy, | 111 const ReferrerPolicy referrer_policy, |
| 115 ReferrerSource referrer_source) | 112 ReferrerSource referrer_source) |
| 116 : initiator_name_(initiator_name), | 113 : initiator_name_(initiator_name), |
| 117 initiator_position_(initiator_position), | 114 initiator_position_(initiator_position), |
| 118 resource_url_(resource_url.IsolatedCopy()), | 115 resource_url_(resource_url.IsolatedCopy()), |
| 119 base_url_(base_url.Copy()), | 116 base_url_(base_url.Copy()), |
| 120 resource_type_(resource_type), | 117 resource_type_(resource_type), |
| 121 cross_origin_(kCrossOriginAttributeNotSet), | 118 cross_origin_(kCrossOriginAttributeNotSet), |
| 122 discovery_time_(MonotonicallyIncreasingTime()), | 119 discovery_time_(MonotonicallyIncreasingTime()), |
| 123 defer_(FetchParameters::kNoDefer), | 120 defer_(FetchParameters::kNoDefer), |
| 124 resource_width_(resource_width), | 121 resource_width_(resource_width), |
| 125 client_hints_preferences_(client_hints_preferences), | 122 client_hints_preferences_(client_hints_preferences), |
| 126 request_type_(request_type), | 123 request_type_(request_type), |
| 127 referrer_policy_(referrer_policy), | 124 referrer_policy_(referrer_policy), |
| 128 referrer_source_(referrer_source), | 125 referrer_source_(referrer_source) {} |
| 129 from_insertion_scanner_(false) {} | |
| 130 | 126 |
| 131 KURL CompleteURL(Document*); | 127 KURL CompleteURL(Document*); |
| 132 | 128 |
| 133 String initiator_name_; | 129 String initiator_name_; |
| 134 TextPosition initiator_position_; | 130 TextPosition initiator_position_; |
| 135 String resource_url_; | 131 String resource_url_; |
| 136 KURL base_url_; | 132 KURL base_url_; |
| 137 String charset_; | 133 String charset_; |
| 138 Resource::Type resource_type_; | 134 Resource::Type resource_type_; |
| 139 CrossOriginAttributeValue cross_origin_; | 135 CrossOriginAttributeValue cross_origin_; |
| 140 String nonce_; | 136 String nonce_; |
| 141 double discovery_time_; | 137 double discovery_time_; |
| 142 FetchParameters::DeferOption defer_; | 138 FetchParameters::DeferOption defer_; |
| 143 FetchParameters::ResourceWidth resource_width_; | 139 FetchParameters::ResourceWidth resource_width_; |
| 144 ClientHintsPreferences client_hints_preferences_; | 140 ClientHintsPreferences client_hints_preferences_; |
| 145 RequestType request_type_; | 141 RequestType request_type_; |
| 146 ReferrerPolicy referrer_policy_; | 142 ReferrerPolicy referrer_policy_; |
| 147 ReferrerSource referrer_source_; | 143 ReferrerSource referrer_source_; |
| 148 IntegrityMetadataSet integrity_metadata_; | 144 IntegrityMetadataSet integrity_metadata_; |
| 149 bool from_insertion_scanner_; | |
| 150 }; | 145 }; |
| 151 | 146 |
| 152 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; | 147 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; |
| 153 | 148 |
| 154 } // namespace blink | 149 } // namespace blink |
| 155 | 150 |
| 156 #endif | 151 #endif |
| OLD | NEW |