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

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

Issue 2108003002: Merge //content/child/permissions into Blink's permissions module. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing presubmits. Created 4 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef PermissionCallback_h
6 #define PermissionCallback_h
7
8 #include "platform/heap/Handle.h"
9 #include "public/platform/modules/permissions/WebPermissionClient.h"
10 #include "public/platform/modules/permissions/WebPermissionStatus.h"
11 #include "public/platform/modules/permissions/WebPermissionType.h"
12 #include "wtf/Allocator.h"
13 #include "wtf/Noncopyable.h"
14
15 namespace blink {
16
17 class ScriptPromiseResolver;
18
19 // PermissionQueryCallback is an implementation of WebPermissionCallbacks
20 // that will resolve the underlying promise depending on the result passed to
21 // the callback. It takes a WebPermissionType in its constructor and will pass
22 // it to the PermissionStatus.
23 class PermissionCallback final : public WebPermissionCallback {
24 USING_FAST_MALLOC(PermissionCallback);
25 WTF_MAKE_NONCOPYABLE(PermissionCallback);
26 public:
27 PermissionCallback(ScriptPromiseResolver*, WebPermissionType);
28 ~PermissionCallback() override;
29
30 void onSuccess(WebPermissionStatus) override;
31 void onError() override;
32
33 private:
34 Persistent<ScriptPromiseResolver> m_resolver;
35 WebPermissionType m_permissionType;
36 };
37
38 } // namespace blink
39
40 #endif // PermissionCallback_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698