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

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

Issue 2050123002: Remove OwnPtr from Blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First attempt to land. 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"
15 #include "wtf/text/TextPosition.h" 16 #include "wtf/text/TextPosition.h"
17 #include <memory>
16 18
17 namespace blink { 19 namespace blink {
18 20
19 class Document; 21 class Document;
20 22
21 class PreloadRequest { 23 class PreloadRequest {
22 USING_FAST_MALLOC(PreloadRequest); 24 USING_FAST_MALLOC(PreloadRequest);
23 public: 25 public:
24 enum RequestType { RequestTypePreload, RequestTypePreconnect, RequestTypeLin kRelPreload }; 26 enum RequestType { RequestTypePreload, RequestTypePreconnect, RequestTypeLin kRelPreload };
25 27
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) 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)
27 { 29 {
28 return adoptPtr(new PreloadRequest(initiatorName, initiatorPosition, res ourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, requestT ype, referrerPolicy)); 30 return wrapUnique(new PreloadRequest(initiatorName, initiatorPosition, r esourceURL, baseURL, resourceType, resourceWidth, clientHintsPreferences, reques tType, referrerPolicy));
29 } 31 }
30 32
31 bool isSafeToSendToAnotherThread() const; 33 bool isSafeToSendToAnotherThread() const;
32 34
33 FetchRequest resourceRequest(Document*); 35 FetchRequest resourceRequest(Document*);
34 36
35 const String& charset() const { return m_charset; } 37 const String& charset() const { return m_charset; }
36 double discoveryTime() const { return m_discoveryTime; } 38 double discoveryTime() const { return m_discoveryTime; }
37 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; } 39 void setDefer(FetchRequest::DeferOption defer) { m_defer = defer; }
38 void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); } 40 void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 CrossOriginAttributeValue m_crossOrigin; 99 CrossOriginAttributeValue m_crossOrigin;
98 double m_discoveryTime; 100 double m_discoveryTime;
99 FetchRequest::DeferOption m_defer; 101 FetchRequest::DeferOption m_defer;
100 FetchRequest::ResourceWidth m_resourceWidth; 102 FetchRequest::ResourceWidth m_resourceWidth;
101 ClientHintsPreferences m_clientHintsPreferences; 103 ClientHintsPreferences m_clientHintsPreferences;
102 RequestType m_requestType; 104 RequestType m_requestType;
103 ReferrerPolicy m_referrerPolicy; 105 ReferrerPolicy m_referrerPolicy;
104 IntegrityMetadataSet m_integrityMetadata; 106 IntegrityMetadataSet m_integrityMetadata;
105 }; 107 };
106 108
107 typedef Vector<OwnPtr<PreloadRequest>> PreloadRequestStream; 109 typedef Vector<std::unique_ptr<PreloadRequest>> PreloadRequestStream;
108 110
109 } // namespace blink 111 } // namespace blink
110 112
111 #endif 113 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698