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

Side by Side Diff: Source/modules/push_messaging/PushRegistration.cpp

Issue 783423003: Make ScriptPromiseResolver RefCountedWillBeRefCountedGarbageCollected. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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 #include "config.h" 5 #include "config.h"
6 #include "modules/push_messaging/PushRegistration.h" 6 #include "modules/push_messaging/PushRegistration.h"
7 7
8 #include "bindings/core/v8/CallbackPromiseAdapter.h" 8 #include "bindings/core/v8/CallbackPromiseAdapter.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "modules/push_messaging/PushError.h" 10 #include "modules/push_messaging/PushError.h"
(...skipping 22 matching lines...) Expand all
33 , m_serviceWorkerRegistration(registration) 33 , m_serviceWorkerRegistration(registration)
34 { 34 {
35 } 35 }
36 36
37 PushRegistration::~PushRegistration() 37 PushRegistration::~PushRegistration()
38 { 38 {
39 } 39 }
40 40
41 ScriptPromise PushRegistration::unregister(ScriptState* scriptState) 41 ScriptPromise PushRegistration::unregister(ScriptState* scriptState)
42 { 42 {
43 RefPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scrip tState); 43 RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver:: create(scriptState);
44 ScriptPromise promise = resolver->promise(); 44 ScriptPromise promise = resolver->promise();
45 45
46 WebPushProvider* webPushProvider = Platform::current()->pushProvider(); 46 WebPushProvider* webPushProvider = Platform::current()->pushProvider();
47 ASSERT(webPushProvider); 47 ASSERT(webPushProvider);
48 48
49 webPushProvider->unregister(m_serviceWorkerRegistration->webRegistration(), new CallbackPromiseAdapter<bool, PushError>(resolver)); 49 webPushProvider->unregister(m_serviceWorkerRegistration->webRegistration(), new CallbackPromiseAdapter<bool, PushError>(resolver));
50 return promise; 50 return promise;
51 } 51 }
52 52
53 void PushRegistration::trace(Visitor* visitor) 53 void PushRegistration::trace(Visitor* visitor)
54 { 54 {
55 visitor->trace(m_serviceWorkerRegistration); 55 visitor->trace(m_serviceWorkerRegistration);
56 } 56 }
57 57
58 } // namespace blink 58 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698