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