| 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/WebURLResponsePrivate.h" | 33 #include "platform/exported/WebURLResponsePrivate.h" |
| 34 #include "platform/network/ResourceLoadTiming.h" | 34 #include "platform/network/ResourceLoadTiming.h" |
| 35 #include "platform/network/ResourceResponse.h" | 35 #include "platform/network/ResourceResponse.h" |
| 36 #include "public/platform/WebHTTPHeaderVisitor.h" | 36 #include "public/platform/WebHTTPHeaderVisitor.h" |
| 37 #include "public/platform/WebHTTPLoadInfo.h" | 37 #include "public/platform/WebHTTPLoadInfo.h" |
| 38 #include "public/platform/WebString.h" | 38 #include "public/platform/WebString.h" |
| 39 #include "public/platform/WebURL.h" | 39 #include "public/platform/WebURL.h" |
| 40 #include "public/platform/WebURLLoadTiming.h" | 40 #include "public/platform/WebURLLoadTiming.h" |
| 41 #include "wtf/Allocator.h" | 41 #include "wtf/Allocator.h" |
| 42 #include "wtf/PtrUtil.h" | |
| 43 #include "wtf/RefPtr.h" | 42 #include "wtf/RefPtr.h" |
| 44 #include <memory> | |
| 45 | 43 |
| 46 namespace blink { | 44 namespace blink { |
| 47 | 45 |
| 48 namespace { | 46 namespace { |
| 49 | 47 |
| 50 class ExtraDataContainer : public ResourceResponse::ExtraData { | 48 class ExtraDataContainer : public ResourceResponse::ExtraData { |
| 51 public: | 49 public: |
| 52 static PassRefPtr<ExtraDataContainer> create(WebURLResponse::ExtraData* extr
aData) { return adoptRef(new ExtraDataContainer(extraData)); } | 50 static PassRefPtr<ExtraDataContainer> create(WebURLResponse::ExtraData* extr
aData) { return adoptRef(new ExtraDataContainer(extraData)); } |
| 53 | 51 |
| 54 ~ExtraDataContainer() override {} | 52 ~ExtraDataContainer() override {} |
| 55 | 53 |
| 56 WebURLResponse::ExtraData* getExtraData() const { return m_extraData.get();
} | 54 WebURLResponse::ExtraData* getExtraData() const { return m_extraData.get();
} |
| 57 | 55 |
| 58 private: | 56 private: |
| 59 explicit ExtraDataContainer(WebURLResponse::ExtraData* extraData) | 57 explicit ExtraDataContainer(WebURLResponse::ExtraData* extraData) |
| 60 : m_extraData(wrapUnique(extraData)) | 58 : m_extraData(adoptPtr(extraData)) |
| 61 { | 59 { |
| 62 } | 60 } |
| 63 | 61 |
| 64 std::unique_ptr<WebURLResponse::ExtraData> m_extraData; | 62 OwnPtr<WebURLResponse::ExtraData> m_extraData; |
| 65 }; | 63 }; |
| 66 | 64 |
| 67 } // namespace | 65 } // namespace |
| 68 | 66 |
| 69 // The standard implementation of WebURLResponsePrivate, which maintains | 67 // The standard implementation of WebURLResponsePrivate, which maintains |
| 70 // ownership of a ResourceResponse instance. | 68 // ownership of a ResourceResponse instance. |
| 71 class WebURLResponsePrivateImpl final : public WebURLResponsePrivate { | 69 class WebURLResponsePrivateImpl final : public WebURLResponsePrivate { |
| 72 USING_FAST_MALLOC(WebURLResponsePrivateImpl); | 70 USING_FAST_MALLOC(WebURLResponsePrivateImpl); |
| 73 public: | 71 public: |
| 74 WebURLResponsePrivateImpl() | 72 WebURLResponsePrivateImpl() |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 // Subclasses may call this directly so a self-assignment check is needed | 510 // Subclasses may call this directly so a self-assignment check is needed |
| 513 // here as well as in the public assign method. | 511 // here as well as in the public assign method. |
| 514 if (m_private == p) | 512 if (m_private == p) |
| 515 return; | 513 return; |
| 516 if (m_private) | 514 if (m_private) |
| 517 m_private->dispose(); | 515 m_private->dispose(); |
| 518 m_private = p; | 516 m_private = p; |
| 519 } | 517 } |
| 520 | 518 |
| 521 } // namespace blink | 519 } // namespace blink |
| OLD | NEW |