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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp

Issue 1929493002: Remove unnecessary uses of GarbageCollectedFinalized<>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add two leftover classes needing same treatment Created 4 years, 7 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 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h" 5 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 NotificationArray() = delete; 43 NotificationArray() = delete;
44 }; 44 };
45 45
46 } // namespace 46 } // namespace
47 47
48 ServiceWorkerRegistrationNotifications::ServiceWorkerRegistrationNotifications(E xecutionContext* executionContext, ServiceWorkerRegistration* registration) 48 ServiceWorkerRegistrationNotifications::ServiceWorkerRegistrationNotifications(E xecutionContext* executionContext, ServiceWorkerRegistration* registration)
49 : ContextLifecycleObserver(executionContext), m_registration(registration) 49 : ContextLifecycleObserver(executionContext), m_registration(registration)
50 { 50 {
51 } 51 }
52 52
53 ServiceWorkerRegistrationNotifications::~ServiceWorkerRegistrationNotifications( )
54 {
55 }
56
57 ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptSta te* scriptState, ServiceWorkerRegistration& registration, const String& title, c onst NotificationOptions& options, ExceptionState& exceptionState) 53 ScriptPromise ServiceWorkerRegistrationNotifications::showNotification(ScriptSta te* scriptState, ServiceWorkerRegistration& registration, const String& title, c onst NotificationOptions& options, ExceptionState& exceptionState)
58 { 54 {
59 ExecutionContext* executionContext = scriptState->getExecutionContext(); 55 ExecutionContext* executionContext = scriptState->getExecutionContext();
60 56
61 // If context object's active worker is null, reject promise with a TypeErro r exception. 57 // If context object's active worker is null, reject promise with a TypeErro r exception.
62 if (!registration.active()) 58 if (!registration.active())
63 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "No active registration available on the ServiceWork erRegistration.")); 59 return ScriptPromise::reject(scriptState, V8ThrowException::createTypeEr ror(scriptState->isolate(), "No active registration available on the ServiceWork erRegistration."));
64 60
65 // If permission for notification's origin is not "granted", reject promise with a TypeError exception, and terminate these substeps. 61 // If permission for notification's origin is not "granted", reject promise with a TypeError exception, and terminate these substeps.
66 if (Notification::checkPermission(executionContext) != mojom::PermissionStat us::GRANTED) 62 if (Notification::checkPermission(executionContext) != mojom::PermissionStat us::GRANTED)
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 DCHECK(m_loaders.contains(loader)); 136 DCHECK(m_loaders.contains(loader));
141 137
142 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager(); 138 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager();
143 DCHECK(notificationManager); 139 DCHECK(notificationManager);
144 140
145 notificationManager->showPersistent(WebSecurityOrigin(origin.get()), data, l oader->getResources(), m_registration->webRegistration(), callbacks.leakPtr()); 141 notificationManager->showPersistent(WebSecurityOrigin(origin.get()), data, l oader->getResources(), m_registration->webRegistration(), callbacks.leakPtr());
146 m_loaders.remove(loader); 142 m_loaders.remove(loader);
147 } 143 }
148 144
149 } // namespace blink 145 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698