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

Side by Side Diff: Source/platform/PermissionCallbacks.h

Issue 705003002: Change the return type of WTF::bind() to |OwnPtr<Function>| (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Reflect comments from yhirano Created 6 years, 1 month 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
« no previous file with comments | « Source/modules/filesystem/LocalFileSystem.cpp ('k') | Source/platform/PermissionCallbacks.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 PermissionCallbacks_h 5 #ifndef PermissionCallbacks_h
6 #define PermissionCallbacks_h 6 #define PermissionCallbacks_h
7 7
8 #include "platform/PlatformExport.h" 8 #include "platform/PlatformExport.h"
9 #include "wtf/Functional.h" 9 #include "wtf/Functional.h"
10 #include "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
11 #include "wtf/OwnPtr.h"
11 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
12 13
13 namespace blink { 14 namespace blink {
14 15
15 class PLATFORM_EXPORT PermissionCallbacks { 16 class PLATFORM_EXPORT PermissionCallbacks {
16 WTF_MAKE_NONCOPYABLE(PermissionCallbacks); 17 WTF_MAKE_NONCOPYABLE(PermissionCallbacks);
17 public: 18 public:
18 static PassOwnPtr<PermissionCallbacks> create(const Closure& allowed, const Closure& denied); 19 static PassOwnPtr<PermissionCallbacks> create(PassOwnPtr<Closure> allowed, P assOwnPtr<Closure> denied);
19 virtual ~PermissionCallbacks() { } 20 virtual ~PermissionCallbacks() { }
20 21
21 void onAllowed() { m_allowed(); } 22 void onAllowed() { (*m_allowed)(); }
22 void onDenied() { m_denied(); } 23 void onDenied() { (*m_denied)(); }
23 24
24 private: 25 private:
25 PermissionCallbacks(const Closure& allowed, const Closure& denied); 26 PermissionCallbacks(PassOwnPtr<Closure> allowed, PassOwnPtr<Closure> denied) ;
26 27
27 Closure m_allowed; 28 OwnPtr<Closure> m_allowed;
28 Closure m_denied; 29 OwnPtr<Closure> m_denied;
29 }; 30 };
30 31
31 } // namespace blink 32 } // namespace blink
32 33
33 #endif // PermissionCallbacks_h 34 #endif // PermissionCallbacks_h
OLDNEW
« no previous file with comments | « Source/modules/filesystem/LocalFileSystem.cpp ('k') | Source/platform/PermissionCallbacks.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698