| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef WrappedResourceResponse_h | 31 #ifndef WrappedResourceResponse_h |
| 32 #define WrappedResourceResponse_h | 32 #define WrappedResourceResponse_h |
| 33 | 33 |
| 34 #include "platform/exported/WebURLResponsePrivate.h" | |
| 35 #include "public/platform/WebURLResponse.h" | 34 #include "public/platform/WebURLResponse.h" |
| 36 #include "wtf/Allocator.h" | 35 #include "wtf/Noncopyable.h" |
| 37 | 36 |
| 38 namespace blink { | 37 namespace blink { |
| 39 | 38 |
| 40 // WrappedResourceResponse doesn't take ownership of given ResourceResponse, | 39 // WrappedResourceResponse doesn't take ownership of given ResourceResponse, |
| 41 // but just holds a pointer to it. It is not copyable (as WebURLResponsePrivate | 40 // but just holds a pointer to it. It is not copyable. |
| 42 // is non-copyable). | |
| 43 class WrappedResourceResponse : public WebURLResponse { | 41 class WrappedResourceResponse : public WebURLResponse { |
| 42 WTF_MAKE_NONCOPYABLE(WrappedResourceResponse); |
| 44 public: | 43 public: |
| 45 ~WrappedResourceResponse() {} | 44 ~WrappedResourceResponse() {} |
| 46 | 45 |
| 47 explicit WrappedResourceResponse(ResourceResponse& resourceResponse) | 46 explicit WrappedResourceResponse(ResourceResponse& resourceResponse) |
| 48 : WebURLResponse(&m_handle) | 47 : WebURLResponse(&resourceResponse) |
| 49 { | 48 { |
| 50 m_handle.m_resourceResponse = &resourceResponse; | |
| 51 } | 49 } |
| 52 | 50 |
| 53 explicit WrappedResourceResponse(const ResourceResponse& resourceResponse) | 51 explicit WrappedResourceResponse(const ResourceResponse& resourceResponse) |
| 54 : WrappedResourceResponse(const_cast<ResourceResponse&>(resourceResponse
)) | 52 : WrappedResourceResponse(const_cast<ResourceResponse&>(resourceResponse
)) |
| 55 { | 53 { |
| 56 } | 54 } |
| 57 | |
| 58 private: | |
| 59 // This is pointed by m_private. | |
| 60 WebURLResponsePrivate m_handle; | |
| 61 }; | 55 }; |
| 62 | 56 |
| 63 } // namespace blink | 57 } // namespace blink |
| 64 | 58 |
| 65 #endif | 59 #endif |
| OLD | NEW |