Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/notifications/ServiceWorkerRegistrationNotifications.h" | 6 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h" |
| 7 | 7 |
| 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 8 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 9 #include "bindings/core/v8/ExceptionState.h" | 9 #include "bindings/core/v8/ExceptionState.h" |
| 10 #include "bindings/core/v8/ScriptPromiseResolver.h" | 10 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 class NotificationArray { | 31 class NotificationArray { |
| 32 public: | 32 public: |
| 33 using WebType = WebVector<WebPersistentNotificationInfo>; | 33 using WebType = WebVector<WebPersistentNotificationInfo>; |
| 34 | 34 |
| 35 static HeapVector<Member<Notification>> take(ScriptPromiseResolver* resolver , WebType* notificationInfosRaw) | 35 static HeapVector<Member<Notification>> take(ScriptPromiseResolver* resolver , WebType* notificationInfosRaw) |
| 36 { | 36 { |
| 37 OwnPtr<WebType> notificationInfos = adoptPtr(notificationInfosRaw); | 37 OwnPtr<WebType> notificationInfos = adoptPtr(notificationInfosRaw); |
| 38 HeapVector<Member<Notification>> notifications; | 38 HeapVector<Member<Notification>> notifications; |
| 39 | 39 |
| 40 for (const WebPersistentNotificationInfo& notificationInfo : *notificati onInfos) | 40 for (const WebPersistentNotificationInfo& notificationInfo : *notificati onInfos) |
| 41 notifications.append(Notification::create(resolver->executionContext (), notificationInfo.persistentNotificationId, notificationInfo.data)); | 41 notifications.append(Notification::create(resolver->executionContext (), notificationInfo.persistentId, notificationInfo.data)); |
|
johnme
2015/04/10 11:07:51
Shouldn't part 1 (https://codereview.chromium.org/
Peter Beverloo
2015/04/10 11:14:09
Nothing is using this code path yet because the Ch
| |
| 42 | 42 |
| 43 return notifications; | 43 return notifications; |
| 44 } | 44 } |
| 45 | 45 |
| 46 static void dispose(WebType* notificationInfosRaw) | 46 static void dispose(WebType* notificationInfosRaw) |
| 47 { | 47 { |
| 48 delete notificationInfosRaw; | 48 delete notificationInfosRaw; |
| 49 } | 49 } |
| 50 | 50 |
| 51 private: | 51 private: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 WebNotificationGetCallbacks* callbacks = new CallbackPromiseAdapter<Notifica tionArray, void>(resolver); | 110 WebNotificationGetCallbacks* callbacks = new CallbackPromiseAdapter<Notifica tionArray, void>(resolver); |
| 111 | 111 |
| 112 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager(); | 112 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager(); |
| 113 ASSERT(notificationManager); | 113 ASSERT(notificationManager); |
| 114 | 114 |
| 115 notificationManager->getNotifications(options.tag(), serviceWorkerRegistrati on.webRegistration(), callbacks); | 115 notificationManager->getNotifications(options.tag(), serviceWorkerRegistrati on.webRegistration(), callbacks); |
| 116 return promise; | 116 return promise; |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace blink | 119 } // namespace blink |
| OLD | NEW |