| 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 } |
| 101 | 104 |
| 102 private: | 105 private: |
| 103 PreloadRequest(const String& initiator_name, | 106 PreloadRequest(const String& initiator_name, |
| 104 const TextPosition& initiator_position, | 107 const TextPosition& initiator_position, |
| 105 const String& resource_url, | 108 const String& resource_url, |
| 106 const KURL& base_url, | 109 const KURL& base_url, |
| 107 Resource::Type resource_type, | 110 Resource::Type resource_type, |
| 108 const FetchParameters::ResourceWidth& resource_width, | 111 const FetchParameters::ResourceWidth& resource_width, |
| 109 const ClientHintsPreferences& client_hints_preferences, | 112 const ClientHintsPreferences& client_hints_preferences, |
| 110 RequestType request_type, | 113 RequestType request_type, |
| 111 const ReferrerPolicy referrer_policy, | 114 const ReferrerPolicy referrer_policy, |
| 112 ReferrerSource referrer_source) | 115 ReferrerSource referrer_source) |
| 113 : initiator_name_(initiator_name), | 116 : initiator_name_(initiator_name), |
| 114 initiator_position_(initiator_position), | 117 initiator_position_(initiator_position), |
| 115 resource_url_(resource_url.IsolatedCopy()), | 118 resource_url_(resource_url.IsolatedCopy()), |
| 116 base_url_(base_url.Copy()), | 119 base_url_(base_url.Copy()), |
| 117 resource_type_(resource_type), | 120 resource_type_(resource_type), |
| 118 cross_origin_(kCrossOriginAttributeNotSet), | 121 cross_origin_(kCrossOriginAttributeNotSet), |
| 119 discovery_time_(MonotonicallyIncreasingTime()), | 122 discovery_time_(MonotonicallyIncreasingTime()), |
| 120 defer_(FetchParameters::kNoDefer), | 123 defer_(FetchParameters::kNoDefer), |
| 121 resource_width_(resource_width), | 124 resource_width_(resource_width), |
| 122 client_hints_preferences_(client_hints_preferences), | 125 client_hints_preferences_(client_hints_preferences), |
| 123 request_type_(request_type), | 126 request_type_(request_type), |
| 124 referrer_policy_(referrer_policy), | 127 referrer_policy_(referrer_policy), |
| 125 referrer_source_(referrer_source) {} | 128 referrer_source_(referrer_source), |
| 129 from_insertion_scanner_(false) {} |
| 126 | 130 |
| 127 KURL CompleteURL(Document*); | 131 KURL CompleteURL(Document*); |
| 128 | 132 |
| 129 String initiator_name_; | 133 String initiator_name_; |
| 130 TextPosition initiator_position_; | 134 TextPosition initiator_position_; |
| 131 String resource_url_; | 135 String resource_url_; |
| 132 KURL base_url_; | 136 KURL base_url_; |
| 133 String charset_; | 137 String charset_; |
| 134 Resource::Type resource_type_; | 138 Resource::Type resource_type_; |
| 135 CrossOriginAttributeValue cross_origin_; | 139 CrossOriginAttributeValue cross_origin_; |
| 136 String nonce_; | 140 String nonce_; |
| 137 double discovery_time_; | 141 double discovery_time_; |
| 138 FetchParameters::DeferOption defer_; | 142 FetchParameters::DeferOption defer_; |
| 139 FetchParameters::ResourceWidth resource_width_; | 143 FetchParameters::ResourceWidth resource_width_; |
| 140 ClientHintsPreferences client_hints_preferences_; | 144 ClientHintsPreferences client_hints_preferences_; |
| 141 RequestType request_type_; | 145 RequestType request_type_; |
| 142 ReferrerPolicy referrer_policy_; | 146 ReferrerPolicy referrer_policy_; |
| 143 ReferrerSource referrer_source_; | 147 ReferrerSource referrer_source_; |
| 144 IntegrityMetadataSet integrity_metadata_; | 148 IntegrityMetadataSet integrity_metadata_; |
| 149 bool from_insertion_scanner_; |
| 145 }; | 150 }; |
| 146 | 151 |
| 147 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; | 152 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; |
| 148 | 153 |
| 149 } // namespace blink | 154 } // namespace blink |
| 150 | 155 |
| 151 #endif | 156 #endif |
| OLD | NEW |