| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 #include "platform/exported/WebURLRequestPrivate.h" | 33 #include "platform/exported/WebURLRequestPrivate.h" |
| 34 #include "platform/network/ResourceRequest.h" | 34 #include "platform/network/ResourceRequest.h" |
| 35 #include "public/platform/WebCachePolicy.h" | 35 #include "public/platform/WebCachePolicy.h" |
| 36 #include "public/platform/WebHTTPBody.h" | 36 #include "public/platform/WebHTTPBody.h" |
| 37 #include "public/platform/WebHTTPHeaderVisitor.h" | 37 #include "public/platform/WebHTTPHeaderVisitor.h" |
| 38 #include "public/platform/WebSecurityOrigin.h" | 38 #include "public/platform/WebSecurityOrigin.h" |
| 39 #include "public/platform/WebURL.h" | 39 #include "public/platform/WebURL.h" |
| 40 #include "wtf/Allocator.h" | 40 #include "wtf/Allocator.h" |
| 41 #include "wtf/Noncopyable.h" | 41 #include "wtf/Noncopyable.h" |
| 42 #include "wtf/PtrUtil.h" |
| 43 #include <memory> |
| 42 | 44 |
| 43 namespace blink { | 45 namespace blink { |
| 44 | 46 |
| 45 namespace { | 47 namespace { |
| 46 | 48 |
| 47 class ExtraDataContainer : public ResourceRequest::ExtraData { | 49 class ExtraDataContainer : public ResourceRequest::ExtraData { |
| 48 public: | 50 public: |
| 49 static PassRefPtr<ExtraDataContainer> create(WebURLRequest::ExtraData* extra
Data) { return adoptRef(new ExtraDataContainer(extraData)); } | 51 static PassRefPtr<ExtraDataContainer> create(WebURLRequest::ExtraData* extra
Data) { return adoptRef(new ExtraDataContainer(extraData)); } |
| 50 | 52 |
| 51 ~ExtraDataContainer() override {} | 53 ~ExtraDataContainer() override {} |
| 52 | 54 |
| 53 WebURLRequest::ExtraData* getExtraData() const { return m_extraData.get(); } | 55 WebURLRequest::ExtraData* getExtraData() const { return m_extraData.get(); } |
| 54 | 56 |
| 55 private: | 57 private: |
| 56 explicit ExtraDataContainer(WebURLRequest::ExtraData* extraData) | 58 explicit ExtraDataContainer(WebURLRequest::ExtraData* extraData) |
| 57 : m_extraData(adoptPtr(extraData)) | 59 : m_extraData(wrapUnique(extraData)) |
| 58 { | 60 { |
| 59 } | 61 } |
| 60 | 62 |
| 61 OwnPtr<WebURLRequest::ExtraData> m_extraData; | 63 std::unique_ptr<WebURLRequest::ExtraData> m_extraData; |
| 62 }; | 64 }; |
| 63 | 65 |
| 64 } // namespace | 66 } // namespace |
| 65 | 67 |
| 66 // The standard implementation of WebURLRequestPrivate, which maintains | 68 // The standard implementation of WebURLRequestPrivate, which maintains |
| 67 // ownership of a ResourceRequest instance. | 69 // ownership of a ResourceRequest instance. |
| 68 class WebURLRequestPrivateImpl final : public WebURLRequestPrivate { | 70 class WebURLRequestPrivateImpl final : public WebURLRequestPrivate { |
| 69 USING_FAST_MALLOC(WebURLRequestPrivate); | 71 USING_FAST_MALLOC(WebURLRequestPrivate); |
| 70 public: | 72 public: |
| 71 WebURLRequestPrivateImpl() | 73 WebURLRequestPrivateImpl() |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 // Subclasses may call this directly so a self-assignment check is needed | 487 // Subclasses may call this directly so a self-assignment check is needed |
| 486 // here as well as in the public assign method. | 488 // here as well as in the public assign method. |
| 487 if (m_private == p) | 489 if (m_private == p) |
| 488 return; | 490 return; |
| 489 if (m_private) | 491 if (m_private) |
| 490 m_private->dispose(); | 492 m_private->dispose(); |
| 491 m_private = p; | 493 m_private = p; |
| 492 } | 494 } |
| 493 | 495 |
| 494 } // namespace blink | 496 } // namespace blink |
| OLD | NEW |