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

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

Issue 1234023002: blink: permissions: add plumbing to revoke permissions (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add Runtime flag for permissions Created 5 years, 5 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 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 PermissionQueryCallback_h 5 #ifndef PermissionCallback_h
6 #define PermissionQueryCallback_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/WebCallbacks.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 #include "wtf/PassRefPtr.h" 13 #include "wtf/PassRefPtr.h"
14 #include "wtf/RefPtr.h" 14 #include "wtf/RefPtr.h"
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class ScriptPromiseResolver; 18 class ScriptPromiseResolver;
19 19
20 // PermissionQueryCallback is an implementation of WebPermissionQueryCallbacks 20 // PermissionQueryCallback is an implementation of WebPermissionCallbacks
21 // that will resolve the underlying promise depending on the result passed to 21 // that will resolve the underlying promise depending on the result passed to
22 // the callback. It takes a WebPermissionType in its constructor and will pass 22 // the callback. It takes a WebPermissionType in its constructor and will pass
23 // it to the PermissionStatus. 23 // it to the PermissionStatus.
24 class PermissionQueryCallback final 24 class PermissionCallback final
25 : public WebCallbacks<WebPermissionStatus, void> { 25 : public WebCallbacks<WebPermissionStatus, void> {
26 public: 26 public:
27 explicit PermissionQueryCallback(PassRefPtr<ScriptPromiseResolver>, WebPermi ssionType); 27 explicit PermissionCallback(PassRefPtr<ScriptPromiseResolver>, WebPermission Type);
mlamouri (slow - plz ping) 2015/07/17 13:16:18 nit: can you remove explicit as long as you are he
Lalit Maganti 2015/07/17 13:47:35 Done. I didn't actually know what the explicit key
mlamouri (slow - plz ping) 2015/07/20 14:14:12 The joys of backward compatibility :)
28 ~PermissionQueryCallback() override; 28 ~PermissionCallback() override;
29 29
30 void onSuccess(WebPermissionStatus*) override; 30 void onSuccess(WebPermissionStatus*) override;
31 void onError() override; 31 void onError() override;
32 32
33 private: 33 private:
34 RefPtr<ScriptPromiseResolver> m_resolver; 34 RefPtr<ScriptPromiseResolver> m_resolver;
35 WebPermissionType m_permissionType; 35 WebPermissionType m_permissionType;
36 36
37 WTF_MAKE_NONCOPYABLE(PermissionQueryCallback); 37 WTF_MAKE_NONCOPYABLE(PermissionCallback);
38 }; 38 };
39 39
40 } // namespace blink 40 } // namespace blink
41 41
42 #endif // PermissionQueryCallback_h 42 #endif // PermissionCallback_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698