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

Side by Side Diff: third_party/WebKit/public/platform/WebURLResponse.h

Issue 2117313002: Remove WebURLResponse::initialize() [revised] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cleanups Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebURLResponseTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 19 matching lines...) Expand all
30 30
31 #ifndef WebURLResponse_h 31 #ifndef WebURLResponse_h
32 #define WebURLResponse_h 32 #define WebURLResponse_h
33 33
34 #include "public/platform/WebCString.h" 34 #include "public/platform/WebCString.h"
35 #include "public/platform/WebCommon.h" 35 #include "public/platform/WebCommon.h"
36 #include "public/platform/WebPrivateOwnPtr.h" 36 #include "public/platform/WebPrivateOwnPtr.h"
37 #include "public/platform/WebString.h" 37 #include "public/platform/WebString.h"
38 #include "public/platform/WebVector.h" 38 #include "public/platform/WebVector.h"
39 #include "public/platform/modules/serviceworker/WebServiceWorkerResponseType.h" 39 #include "public/platform/modules/serviceworker/WebServiceWorkerResponseType.h"
40 #include <memory>
40 41
41 namespace blink { 42 namespace blink {
42 43
43 class ResourceResponse; 44 class ResourceResponse;
44 class WebHTTPHeaderVisitor; 45 class WebHTTPHeaderVisitor;
45 class WebHTTPLoadInfo; 46 class WebHTTPLoadInfo;
46 class WebURL; 47 class WebURL;
47 class WebURLLoadTiming; 48 class WebURLLoadTiming;
48 class WebURLResponsePrivate; 49 class WebURLResponsePrivate;
49 50
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 size_t numInvalidScts; 129 size_t numInvalidScts;
129 size_t numValidScts; 130 size_t numValidScts;
130 SignedCertificateTimestampList sctList; 131 SignedCertificateTimestampList sctList;
131 }; 132 };
132 133
133 class ExtraData { 134 class ExtraData {
134 public: 135 public:
135 virtual ~ExtraData() { } 136 virtual ~ExtraData() { }
136 }; 137 };
137 138
138 ~WebURLResponse() { reset(); } 139 BLINK_PLATFORM_EXPORT ~WebURLResponse();
139 140
140 WebURLResponse() : m_private(0) { } 141 BLINK_PLATFORM_EXPORT WebURLResponse();
141 WebURLResponse(const WebURLResponse& r) : m_private(0) { assign(r); } 142 BLINK_PLATFORM_EXPORT WebURLResponse(const WebURLResponse&);
142 WebURLResponse& operator=(const WebURLResponse& r) 143 BLINK_PLATFORM_EXPORT explicit WebURLResponse(const WebURL&);
143 { 144 BLINK_PLATFORM_EXPORT WebURLResponse& operator=(const WebURLResponse&);
144 assign(r);
145 return *this;
146 }
147
148 explicit WebURLResponse(const WebURL& url) : m_private(0)
149 {
150 initialize();
151 setURL(url);
152 }
153
154 BLINK_PLATFORM_EXPORT void initialize();
155 BLINK_PLATFORM_EXPORT void reset();
156 BLINK_PLATFORM_EXPORT void assign(const WebURLResponse&);
157 145
158 BLINK_PLATFORM_EXPORT bool isNull() const; 146 BLINK_PLATFORM_EXPORT bool isNull() const;
159 147
160 BLINK_PLATFORM_EXPORT WebURL url() const; 148 BLINK_PLATFORM_EXPORT WebURL url() const;
161 BLINK_PLATFORM_EXPORT void setURL(const WebURL&); 149 BLINK_PLATFORM_EXPORT void setURL(const WebURL&);
162 150
163 BLINK_PLATFORM_EXPORT unsigned connectionID() const; 151 BLINK_PLATFORM_EXPORT unsigned connectionID() const;
164 BLINK_PLATFORM_EXPORT void setConnectionID(unsigned); 152 BLINK_PLATFORM_EXPORT void setConnectionID(unsigned);
165 153
166 BLINK_PLATFORM_EXPORT bool connectionReused() const; 154 BLINK_PLATFORM_EXPORT bool connectionReused() const;
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 // Extra data associated with the underlying resource response. Resource 286 // Extra data associated with the underlying resource response. Resource
299 // responses can be copied. If non-null, each copy of a resource response 287 // responses can be copied. If non-null, each copy of a resource response
300 // holds a pointer to the extra data, and the extra data pointer will be 288 // holds a pointer to the extra data, and the extra data pointer will be
301 // deleted when the last resource response is destroyed. Setting the extra 289 // deleted when the last resource response is destroyed. Setting the extra
302 // data pointer will cause the underlying resource response to be 290 // data pointer will cause the underlying resource response to be
303 // dissociated from any existing non-null extra data pointer. 291 // dissociated from any existing non-null extra data pointer.
304 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; 292 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const;
305 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); 293 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
306 294
307 protected: 295 protected:
308 BLINK_PLATFORM_EXPORT void assign(WebURLResponsePrivate*); 296 // Permit subclasses to set arbitrary WebURLResponsePrivate pointer as
297 // |m_private|. Parameter must be non-null. |m_owningPrivate| is not set
298 // in this case.
299 BLINK_PLATFORM_EXPORT explicit WebURLResponse(WebURLResponsePrivate*);
309 300
310 private: 301 private:
302 // If this instance owns WebURLResponsePrivate |m_owningPrivate| is
303 // non-null and is pointed by |m_private|.
304 std::unique_ptr<WebURLResponsePrivate> m_owningPrivate;
305
306 // Should never be null.
311 WebURLResponsePrivate* m_private; 307 WebURLResponsePrivate* m_private;
312 }; 308 };
313 309
314 } // namespace blink 310 } // namespace blink
315 311
316 #endif 312 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebURLResponseTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698