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

Side by Side Diff: Source/modules/push_messaging/PushSubscriptionCallbacks.h

Issue 1233173002: Have ScriptPromiseResolver on the Oilpan heap always. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix webusb ScriptPromiseResolver usage Created 5 years, 4 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 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 PushSubscriptionCallbacks_h 5 #ifndef PushSubscriptionCallbacks_h
6 #define PushSubscriptionCallbacks_h 6 #define PushSubscriptionCallbacks_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 "wtf/Noncopyable.h" 10 #include "wtf/Noncopyable.h"
11 #include "wtf/PassRefPtr.h"
12 #include "wtf/RefPtr.h"
13 11
14 namespace blink { 12 namespace blink {
15 13
16 class ServiceWorkerRegistration; 14 class ServiceWorkerRegistration;
17 class ScriptPromiseResolver; 15 class ScriptPromiseResolver;
18 struct WebPushError; 16 struct WebPushError;
19 struct WebPushSubscription; 17 struct WebPushSubscription;
20 18
21 // PushSubscriptionCallbacks is an implementation of WebPushSubscriptionCallback s 19 // PushSubscriptionCallbacks is an implementation of WebPushSubscriptionCallback s
22 // that will resolve the underlying promise depending on the result passed to 20 // that will resolve the underlying promise depending on the result passed to
23 // the callback. It takes a ServiceWorkerRegistration in its constructor and 21 // the callback. It takes a ServiceWorkerRegistration in its constructor and
24 // will pass it to the PushSubscription. 22 // will pass it to the PushSubscription.
25 class PushSubscriptionCallbacks final : public WebCallbacks<WebPushSubscription* , WebPushError*> { 23 class PushSubscriptionCallbacks final : public WebCallbacks<WebPushSubscription* , WebPushError*> {
26 WTF_MAKE_NONCOPYABLE(PushSubscriptionCallbacks); 24 WTF_MAKE_NONCOPYABLE(PushSubscriptionCallbacks);
27 public: 25 public:
28 PushSubscriptionCallbacks(PassRefPtrWillBeRawPtr<ScriptPromiseResolver>, Ser viceWorkerRegistration*); 26 PushSubscriptionCallbacks(ScriptPromiseResolver*, ServiceWorkerRegistration* );
29 ~PushSubscriptionCallbacks() override; 27 ~PushSubscriptionCallbacks() override;
30 28
31 void onSuccess(WebPushSubscription*) override; 29 void onSuccess(WebPushSubscription*) override;
32 void onError(WebPushError*) override; 30 void onError(WebPushError*) override;
33 31
34 private: 32 private:
35 RefPtrWillBePersistent<ScriptPromiseResolver> m_resolver; 33 Persistent<ScriptPromiseResolver> m_resolver;
36 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration; 34 Persistent<ServiceWorkerRegistration> m_serviceWorkerRegistration;
37 }; 35 };
38 36
39 } // namespace blink 37 } // namespace blink
40 38
41 #endif // PushSubscriptionCallbacks_h 39 #endif // PushSubscriptionCallbacks_h
OLDNEW
« no previous file with comments | « Source/modules/push_messaging/PushSubscription.cpp ('k') | Source/modules/push_messaging/PushSubscriptionCallbacks.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698