Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: third_party/WebKit/Source/core/html/parser/PreloadRequest.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/IntegrityMetadata.h"
11 #include "core/fetch/Resource.h" 11 #include "core/fetch/Resource.h"
12 #include "platform/CrossOriginAttributeValue.h" 12 #include "platform/CrossOriginAttributeValue.h"
13 #include "platform/weborigin/SecurityPolicy.h" 13 #include "platform/weborigin/SecurityPolicy.h"
14 #include "wtf/Allocator.h" 14 #include "wtf/Allocator.h"
15 #include "wtf/PtrUtil.h"
16 #include "wtf/text/TextPosition.h" 15 #include "wtf/text/TextPosition.h"
17 #include <memory>
18 16
19 namespace blink { 17 namespace blink {
20 18
21 class Document; 19 class Document;
22 20
23 class PreloadRequest { 21 class PreloadRequest {
24 USING_FAST_MALLOC(PreloadRequest); 22 USING_FAST_MALLOC(PreloadRequest);
25 public: 23 public:
26 enum RequestType { RequestTypePreload, RequestTypePreconnect, RequestTypeLin kRelPreload }; 24 enum RequestType { RequestTypePreload, RequestTypePreconnect, RequestTypeLin kRelPreload };
27 25
28 static std::unique_ptr<PreloadRequest> create(const String& initiatorName, c onst TextPosition& initiatorPosition, const String& resourceURL, const KURL& bas eURL, Resource::Type resourceType, const ReferrerPolicy referrerPolicy, const Fe tchRequest::ResourceWidth& resourceWidth = FetchRequest::ResourceWidth(), const ClientHintsPreferences& clientHintsPreferences = ClientHintsPreferences(), Reque stType requestType = RequestTypePreload) 26 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)
29 { 27 {
30 return wrapUnique(new PreloadRequest(initiatorName, initiatorPosition, r esourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, reques tType, referrerPolicy)); 28 return adoptPtr(new PreloadRequest(initiatorName, initiatorPosition, res ourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, requestT ype, referrerPolicy));
31 } 29 }
32 30
33 bool isSafeToSendToAnotherThread() const; 31 bool isSafeToSendToAnotherThread() const;
34 32
35 FetchRequest resourceRequest(Document*); 33 FetchRequest resourceRequest(Document*);
36 34
37 const String& charset() const { return m_charset; } 35 const String& charset() const { return m_charset; }
38 double discoveryTime() const { return m_discoveryTime; } 36 double discoveryTime() const { return m_discoveryTime; }
39 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; } 37 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; }
40 void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); } 38 void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 CrossOriginAttributeValue m_crossOrigin; 97 CrossOriginAttributeValue m_crossOrigin;
100 double m_discoveryTime; 98 double m_discoveryTime;
101 FetchRequest::DeferOption m_defer; 99 FetchRequest::DeferOption m_defer;
102 FetchRequest::ResourceWidth m_resourceWidth; 100 FetchRequest::ResourceWidth m_resourceWidth;
103 ClientHintsPreferences m_clientHintsPreferences; 101 ClientHintsPreferences m_clientHintsPreferences;
104 RequestType m_requestType; 102 RequestType m_requestType;
105 ReferrerPolicy m_referrerPolicy; 103 ReferrerPolicy m_referrerPolicy;
106 IntegrityMetadataSet m_integrityMetadata; 104 IntegrityMetadataSet m_integrityMetadata;
107 }; 105 };
108 106
109 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream; 107 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream;
110 108
111 } // namespace blink 109 } // namespace blink
112 110
113 #endif 111 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698