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

Side by Side Diff: Source/modules/permissions/PermissionCallback.h

Issue 1317243002: [VR, Permission] Use appopriate type parameters for WebCallbacks (1/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | Source/modules/permissions/PermissionCallback.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 PermissionCallback_h 5 #ifndef PermissionCallback_h
6 #define PermissionCallback_h 6 #define PermissionCallback_h
7 7
8 #include "platform/heap/Handle.h" 8 #include "platform/heap/Handle.h"
9 #include "public/platform/WebCallbacks.h" 9 #include "public/platform/modules/permissions/WebPermissionClient.h"
10 #include "public/platform/modules/permissions/WebPermissionStatus.h" 10 #include "public/platform/modules/permissions/WebPermissionStatus.h"
11 #include "public/platform/modules/permissions/WebPermissionType.h" 11 #include "public/platform/modules/permissions/WebPermissionType.h"
12 #include "wtf/Noncopyable.h" 12 #include "wtf/Noncopyable.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 class ScriptPromiseResolver; 16 class ScriptPromiseResolver;
17 17
18 // PermissionQueryCallback is an implementation of WebPermissionCallbacks 18 // PermissionQueryCallback is an implementation of WebPermissionCallbacks
19 // that will resolve the underlying promise depending on the result passed to 19 // that will resolve the underlying promise depending on the result passed to
20 // the callback. It takes a WebPermissionType in its constructor and will pass 20 // the callback. It takes a WebPermissionType in its constructor and will pass
21 // it to the PermissionStatus. 21 // it to the PermissionStatus.
22 class PermissionCallback final 22 class PermissionCallback final : public WebPermissionCallback {
23 : public WebCallbacks<WebPermissionStatus*, void> {
24 public: 23 public:
25 PermissionCallback(ScriptPromiseResolver*, WebPermissionType); 24 PermissionCallback(ScriptPromiseResolver*, WebPermissionType);
26 ~PermissionCallback() override; 25 ~PermissionCallback() override;
27 26
28 void onSuccess(WebPermissionStatus*) override; 27 void onSuccess(WebPermissionStatus) override;
29 void onError() override; 28 void onError() override;
30 29
31 private: 30 private:
32 Persistent<ScriptPromiseResolver> m_resolver; 31 Persistent<ScriptPromiseResolver> m_resolver;
33 WebPermissionType m_permissionType; 32 WebPermissionType m_permissionType;
34 33
35 WTF_MAKE_NONCOPYABLE(PermissionCallback); 34 WTF_MAKE_NONCOPYABLE(PermissionCallback);
36 }; 35 };
37 36
38 } // namespace blink 37 } // namespace blink
39 38
40 #endif // PermissionCallback_h 39 #endif // PermissionCallback_h
OLDNEW
« no previous file with comments | « no previous file | Source/modules/permissions/PermissionCallback.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698