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

Side by Side Diff: third_party/WebKit/Source/platform/ContentSettingCallbacks.h

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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ContentSettingCallbacks_h 5 #ifndef ContentSettingCallbacks_h
6 #define ContentSettingCallbacks_h 6 #define ContentSettingCallbacks_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/Allocator.h" 9 #include "wtf/Allocator.h"
10 #include "wtf/Functional.h" 10 #include "wtf/Functional.h"
11 #include "wtf/Noncopyable.h" 11 #include "wtf/Noncopyable.h"
12 #include <memory> 12 #include "wtf/OwnPtr.h"
13 #include "wtf/PassOwnPtr.h"
13 14
14 namespace blink { 15 namespace blink {
15 16
16 class PLATFORM_EXPORT ContentSettingCallbacks { 17 class PLATFORM_EXPORT ContentSettingCallbacks {
17 USING_FAST_MALLOC(ContentSettingCallbacks); 18 USING_FAST_MALLOC(ContentSettingCallbacks);
18 WTF_MAKE_NONCOPYABLE(ContentSettingCallbacks); 19 WTF_MAKE_NONCOPYABLE(ContentSettingCallbacks);
19 public: 20 public:
20 static std::unique_ptr<ContentSettingCallbacks> create(std::unique_ptr<SameT hreadClosure> allowed, std::unique_ptr<SameThreadClosure> denied); 21 static PassOwnPtr<ContentSettingCallbacks> create(std::unique_ptr<SameThread Closure> allowed, std::unique_ptr<SameThreadClosure> denied);
21 virtual ~ContentSettingCallbacks() { } 22 virtual ~ContentSettingCallbacks() { }
22 23
23 void onAllowed() { (*m_allowed)(); } 24 void onAllowed() { (*m_allowed)(); }
24 void onDenied() { (*m_denied)(); } 25 void onDenied() { (*m_denied)(); }
25 26
26 private: 27 private:
27 ContentSettingCallbacks(std::unique_ptr<SameThreadClosure> allowed, std::uni que_ptr<SameThreadClosure> denied); 28 ContentSettingCallbacks(std::unique_ptr<SameThreadClosure> allowed, std::uni que_ptr<SameThreadClosure> denied);
28 29
29 std::unique_ptr<SameThreadClosure> m_allowed; 30 std::unique_ptr<SameThreadClosure> m_allowed;
30 std::unique_ptr<SameThreadClosure> m_denied; 31 std::unique_ptr<SameThreadClosure> m_denied;
31 }; 32 };
32 33
33 } // namespace blink 34 } // namespace blink
34 35
35 #endif // ContentSettingCallbacks_h 36 #endif // ContentSettingCallbacks_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/CalculationValue.h ('k') | third_party/WebKit/Source/platform/ContentSettingCallbacks.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698