OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef PushPermissionRequestCallback_h | |
6 #define PushPermissionRequestCallback_h | |
7 | |
8 #include "platform/heap/Handle.h" | |
9 #include "public/platform/WebCallback.h" | |
10 #include "wtf/Noncopyable.h" | |
11 #include "wtf/PassRefPtr.h" | |
12 #include "wtf/RefPtr.h" | |
13 | |
14 namespace blink { | |
15 | |
16 class PushManager; | |
17 class ScriptPromiseResolver; | |
18 class WebPushClient; | |
19 class WebServiceWorkerProvider; | |
20 | |
21 class PushPermissionRequestCallback final : public WebCallback { | |
22 WTF_MAKE_NONCOPYABLE(PushPermissionRequestCallback); | |
23 | |
24 public: | |
25 // Since |PushManager| is oilpan garbage collected this will keep it alive. | |
26 // Does not take ownership of |WebPushClient|. | |
27 // Since |ScriptPromiseResolver| is ref counted this will keep it alive. | |
28 // Does not take ownership of |WebServiceWorkerProvider|. | |
29 PushPermissionRequestCallback(PushManager*, WebPushClient*, PassRefPtr<Scrip
tPromiseResolver>, WebServiceWorkerProvider*); | |
30 ~PushPermissionRequestCallback() override; | |
31 | |
32 void run() override; | |
33 | |
34 private: | |
35 Persistent<PushManager> m_manager; | |
36 WebPushClient* m_client; | |
37 RefPtr<ScriptPromiseResolver> m_resolver; | |
38 WebServiceWorkerProvider* m_serviceWorkerProvider; | |
39 }; | |
40 | |
41 } // namespace blink | |
42 | |
43 #endif // PushPermissionRequestCallback_h | |
OLD | NEW |