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

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: 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
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 WebURLResponse& operator=(const WebURLResponse&);
143 {
144 assign(r);
145 return *this;
146 }
147 144
148 explicit WebURLResponse(const WebURL& url) : m_private(0) 145 BLINK_PLATFORM_EXPORT explicit WebURLResponse(const WebURL&);
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 146
158 BLINK_PLATFORM_EXPORT bool isNull() const; 147 BLINK_PLATFORM_EXPORT bool isNull() const;
159 148
160 BLINK_PLATFORM_EXPORT WebURL url() const; 149 BLINK_PLATFORM_EXPORT WebURL url() const;
161 BLINK_PLATFORM_EXPORT void setURL(const WebURL&); 150 BLINK_PLATFORM_EXPORT void setURL(const WebURL&);
162 151
163 BLINK_PLATFORM_EXPORT unsigned connectionID() const; 152 BLINK_PLATFORM_EXPORT unsigned connectionID() const;
164 BLINK_PLATFORM_EXPORT void setConnectionID(unsigned); 153 BLINK_PLATFORM_EXPORT void setConnectionID(unsigned);
165 154
166 BLINK_PLATFORM_EXPORT bool connectionReused() const; 155 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 287 // Extra data associated with the underlying resource response. Resource
299 // responses can be copied. If non-null, each copy of a resource response 288 // 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 289 // 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 290 // deleted when the last resource response is destroyed. Setting the extra
302 // data pointer will cause the underlying resource response to be 291 // data pointer will cause the underlying resource response to be
303 // dissociated from any existing non-null extra data pointer. 292 // dissociated from any existing non-null extra data pointer.
304 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; 293 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const;
305 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); 294 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*);
306 295
307 protected: 296 protected:
308 BLINK_PLATFORM_EXPORT void assign(WebURLResponsePrivate*); 297 // Permit subclasses to avoid allocating a default instance of |m_private|
298 // on construction. Parameter must be non-null. |m_owningPrivate| is set to
299 // false in this case.
300 BLINK_PLATFORM_EXPORT explicit WebURLResponse(WebURLResponsePrivate*);
309 301
310 private: 302 private:
311 WebURLResponsePrivate* m_private; 303 WebURLResponsePrivate* m_private;
304 bool m_owningPrivate;
312 }; 305 };
313 306
314 } // namespace blink 307 } // namespace blink
315 308
316 #endif 309 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698