Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: third_party/WebKit/Source/platform/exported/WebPrerender.cpp

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 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 14 matching lines...) Expand all
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 #include "public/platform/WebPrerender.h" 31 #include "public/platform/WebPrerender.h"
32 32
33 #include "platform/Prerender.h" 33 #include "platform/Prerender.h"
34 #include "wtf/PassRefPtr.h" 34 #include "wtf/PassRefPtr.h"
35 #include "wtf/PtrUtil.h"
36 #include <memory>
37 35
38 namespace blink { 36 namespace blink {
39 37
40 namespace { 38 namespace {
41 39
42 class ExtraDataContainer : public Prerender::ExtraData { 40 class ExtraDataContainer : public Prerender::ExtraData {
43 public: 41 public:
44 static PassRefPtr<ExtraDataContainer> create(WebPrerender::ExtraData* extraD ata) { return adoptRef(new ExtraDataContainer(extraData)); } 42 static PassRefPtr<ExtraDataContainer> create(WebPrerender::ExtraData* extraD ata) { return adoptRef(new ExtraDataContainer(extraData)); }
45 43
46 ~ExtraDataContainer() override {} 44 ~ExtraDataContainer() override {}
47 45
48 WebPrerender::ExtraData* getExtraData() const { return m_extraData.get(); } 46 WebPrerender::ExtraData* getExtraData() const { return m_extraData.get(); }
49 47
50 private: 48 private:
51 explicit ExtraDataContainer(WebPrerender::ExtraData* extraData) 49 explicit ExtraDataContainer(WebPrerender::ExtraData* extraData)
52 : m_extraData(wrapUnique(extraData)) 50 : m_extraData(adoptPtr(extraData))
53 { 51 {
54 } 52 }
55 53
56 std::unique_ptr<WebPrerender::ExtraData> m_extraData; 54 OwnPtr<WebPrerender::ExtraData> m_extraData;
57 }; 55 };
58 56
59 } // namespace 57 } // namespace
60 58
61 WebPrerender::WebPrerender(Prerender* prerender) 59 WebPrerender::WebPrerender(Prerender* prerender)
62 : m_private(prerender) 60 : m_private(prerender)
63 { 61 {
64 } 62 }
65 63
66 const Prerender* WebPrerender::toPrerender() const 64 const Prerender* WebPrerender::toPrerender() const
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 { 128 {
131 m_private->didSendLoadForPrerender(); 129 m_private->didSendLoadForPrerender();
132 } 130 }
133 131
134 void WebPrerender::didSendDOMContentLoadedForPrerender() 132 void WebPrerender::didSendDOMContentLoadedForPrerender()
135 { 133 {
136 m_private->didSendDOMContentLoadedForPrerender(); 134 m_private->didSendDOMContentLoadedForPrerender();
137 } 135 }
138 136
139 } // namespace blink 137 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698