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