OLD | NEW |
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 28 matching lines...) Expand all Loading... |
39 #include "public/platform/modules/serviceworker/WebServiceWorkerResponseType.h" | 39 #include "public/platform/modules/serviceworker/WebServiceWorkerResponseType.h" |
40 #include <memory> | 40 #include <memory> |
41 | 41 |
42 namespace blink { | 42 namespace blink { |
43 | 43 |
44 class ResourceResponse; | 44 class ResourceResponse; |
45 class WebHTTPHeaderVisitor; | 45 class WebHTTPHeaderVisitor; |
46 class WebHTTPLoadInfo; | 46 class WebHTTPLoadInfo; |
47 class WebURL; | 47 class WebURL; |
48 class WebURLLoadTiming; | 48 class WebURLLoadTiming; |
49 class WebURLResponsePrivate; | |
50 | 49 |
51 class WebURLResponse { | 50 class WebURLResponse { |
52 public: | 51 public: |
53 enum HTTPVersion { HTTPVersionUnknown, | 52 enum HTTPVersion { HTTPVersionUnknown, |
54 HTTPVersion_0_9, | 53 HTTPVersion_0_9, |
55 HTTPVersion_1_0, | 54 HTTPVersion_1_0, |
56 HTTPVersion_1_1, | 55 HTTPVersion_1_1, |
57 HTTPVersion_2_0 }; | 56 HTTPVersion_2_0 }; |
58 enum SecurityStyle { | 57 enum SecurityStyle { |
59 SecurityStyleUnknown, | 58 SecurityStyleUnknown, |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 284 |
286 // Extra data associated with the underlying resource response. Resource | 285 // Extra data associated with the underlying resource response. Resource |
287 // responses can be copied. If non-null, each copy of a resource response | 286 // responses can be copied. If non-null, each copy of a resource response |
288 // holds a pointer to the extra data, and the extra data pointer will be | 287 // holds a pointer to the extra data, and the extra data pointer will be |
289 // deleted when the last resource response is destroyed. Setting the extra | 288 // deleted when the last resource response is destroyed. Setting the extra |
290 // data pointer will cause the underlying resource response to be | 289 // data pointer will cause the underlying resource response to be |
291 // dissociated from any existing non-null extra data pointer. | 290 // dissociated from any existing non-null extra data pointer. |
292 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; | 291 BLINK_PLATFORM_EXPORT ExtraData* getExtraData() const; |
293 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); | 292 BLINK_PLATFORM_EXPORT void setExtraData(ExtraData*); |
294 | 293 |
| 294 #if INSIDE_BLINK |
295 protected: | 295 protected: |
296 // Permit subclasses to set arbitrary WebURLResponsePrivate pointer as | 296 // Permit subclasses to set arbitrary ResourceResponse pointer as |
297 // |m_private|. Parameter must be non-null. |m_owningPrivate| is not set | 297 // |m_resourceResponse|. Parameter must be non-null. |
298 // in this case. | 298 // |m_ownedResourceResponse| is not set in this case. |
299 BLINK_PLATFORM_EXPORT explicit WebURLResponse(WebURLResponsePrivate*); | 299 BLINK_PLATFORM_EXPORT explicit WebURLResponse(ResourceResponse*); |
| 300 #endif |
300 | 301 |
301 private: | 302 private: |
302 // If this instance owns WebURLResponsePrivate |m_owningPrivate| is | 303 struct ResourceResponseContainer; |
303 // non-null and is pointed by |m_private|. | 304 |
304 std::unique_ptr<WebURLResponsePrivate> m_owningPrivate; | 305 // If this instance owns a ResourceResponse then |m_ownedResourceResponse| |
| 306 // is non-null and |m_resourceResponse| points to the ResourceResponse |
| 307 // instance it contains. |
| 308 std::unique_ptr<ResourceResponseContainer> m_ownedResourceResponse; |
305 | 309 |
306 // Should never be null. | 310 // Should never be null. |
307 WebURLResponsePrivate* m_private; | 311 ResourceResponse* m_resourceResponse; |
308 }; | 312 }; |
309 | 313 |
310 } // namespace blink | 314 } // namespace blink |
311 | 315 |
312 #endif | 316 #endif |
OLD | NEW |