| 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/Resource.h" | 10 #include "core/fetch/Resource.h" |
| 11 #include "platform/weborigin/SecurityPolicy.h" | 11 #include "platform/weborigin/SecurityPolicy.h" |
| 12 #include "wtf/Allocator.h" |
| 12 #include "wtf/text/TextPosition.h" | 13 #include "wtf/text/TextPosition.h" |
| 13 | 14 |
| 14 namespace blink { | 15 namespace blink { |
| 15 | 16 |
| 16 class Document; | 17 class Document; |
| 17 | 18 |
| 18 class PreloadRequest { | 19 class PreloadRequest { |
| 20 WTF_MAKE_FAST_ALLOCATED(PreloadRequest); |
| 19 public: | 21 public: |
| 20 enum RequestType { RequestTypePreload, RequestTypePreconnect }; | 22 enum RequestType { RequestTypePreload, RequestTypePreconnect }; |
| 21 | 23 |
| 22 static PassOwnPtr<PreloadRequest> create(const String& initiatorName, const
TextPosition& initiatorPosition, const String& resourceURL, const KURL& baseURL,
Resource::Type resourceType, const ReferrerPolicy referrerPolicy, const FetchRe
quest::ResourceWidth& resourceWidth = FetchRequest::ResourceWidth(), const Clien
tHintsPreferences& clientHintsPreferences = ClientHintsPreferences(), RequestTyp
e requestType = RequestTypePreload) | 24 static PassOwnPtr<PreloadRequest> create(const String& initiatorName, const
TextPosition& initiatorPosition, const String& resourceURL, const KURL& baseURL,
Resource::Type resourceType, const ReferrerPolicy referrerPolicy, const FetchRe
quest::ResourceWidth& resourceWidth = FetchRequest::ResourceWidth(), const Clien
tHintsPreferences& clientHintsPreferences = ClientHintsPreferences(), RequestTyp
e requestType = RequestTypePreload) |
| 23 { | 25 { |
| 24 return adoptPtr(new PreloadRequest(initiatorName, initiatorPosition, res
ourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, requestT
ype, referrerPolicy)); | 26 return adoptPtr(new PreloadRequest(initiatorName, initiatorPosition, res
ourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, requestT
ype, referrerPolicy)); |
| 25 } | 27 } |
| 26 | 28 |
| 27 bool isSafeToSendToAnotherThread() const; | 29 bool isSafeToSendToAnotherThread() const; |
| 28 | 30 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 ClientHintsPreferences m_clientHintsPreferences; | 93 ClientHintsPreferences m_clientHintsPreferences; |
| 92 RequestType m_requestType; | 94 RequestType m_requestType; |
| 93 ReferrerPolicy m_referrerPolicy; | 95 ReferrerPolicy m_referrerPolicy; |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream; | 98 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream; |
| 97 | 99 |
| 98 } | 100 } |
| 99 | 101 |
| 100 #endif | 102 #endif |
| OLD | NEW |