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

Side by Side Diff: Source/modules/push_messaging/PushRegistrationCallbacks.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/PushRegistrationCallbacks.h" 6 #include "modules/push_messaging/PushRegistrationCallbacks.h"
7 7
8 #include "bindings/core/v8/ScriptPromiseResolver.h" 8 #include "bindings/core/v8/ScriptPromiseResolver.h"
9 #include "modules/push_messaging/PushError.h" 9 #include "modules/push_messaging/PushError.h"
10 #include "modules/push_messaging/PushRegistration.h" 10 #include "modules/push_messaging/PushRegistration.h"
11 #include "modules/serviceworkers/ServiceWorkerRegistration.h" 11 #include "modules/serviceworkers/ServiceWorkerRegistration.h"
12 12
13 namespace blink { 13 namespace blink {
14 14
15 PushRegistrationCallbacks::PushRegistrationCallbacks(PassRefPtr<ScriptPromiseRes olver> resolver, ServiceWorkerRegistration* registration) 15 PushRegistrationCallbacks::PushRegistrationCallbacks(PassRefPtrWillBeRawPtr<Scri ptPromiseResolver> resolver, ServiceWorkerRegistration* registration)
16 : m_resolver(resolver) 16 : m_resolver(resolver)
17 , m_serviceWorkerRegistration(registration) 17 , m_serviceWorkerRegistration(registration)
18 { 18 {
19 ASSERT(m_resolver); 19 ASSERT(m_resolver);
20 ASSERT(m_serviceWorkerRegistration); 20 ASSERT(m_serviceWorkerRegistration);
21 } 21 }
22 22
23 PushRegistrationCallbacks::~PushRegistrationCallbacks() 23 PushRegistrationCallbacks::~PushRegistrationCallbacks()
24 { 24 {
25 } 25 }
(...skipping 10 matching lines...) Expand all
36 void PushRegistrationCallbacks::onError(WebPushError* error) 36 void PushRegistrationCallbacks::onError(WebPushError* error)
37 { 37 {
38 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ eDOMObjectsAreStopped()) { 38 if (!m_resolver->executionContext() || m_resolver->executionContext()->activ eDOMObjectsAreStopped()) {
39 PushError::dispose(error); 39 PushError::dispose(error);
40 return; 40 return;
41 } 41 }
42 m_resolver->reject(PushError::take(m_resolver.get(), error)); 42 m_resolver->reject(PushError::take(m_resolver.get(), error));
43 } 43 }
44 44
45 } // namespace blink 45 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698