OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID,
int64_t notificationID, const WebNotificationData& data) | 134 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID,
int64_t notificationID, const WebNotificationData& data) |
135 { | 135 { |
136 ASSERT(m_workerGlobalScope); | 136 ASSERT(m_workerGlobalScope); |
137 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::NotificationClick, eventID); | 137 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::NotificationClick, eventID); |
138 NotificationEventInit eventInit; | 138 NotificationEventInit eventInit; |
139 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica
tionID, data)); | 139 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica
tionID, data)); |
140 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no
tificationclick, eventInit, observer)); | 140 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no
tificationclick, eventInit, observer)); |
141 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | 141 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
142 } | 142 } |
143 | 143 |
144 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID,
const WebString& notificationID, const WebNotificationData& data) | |
145 { | |
146 ASSERT(m_workerGlobalScope); | |
147 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::NotificationClick, eventID); | |
148 NotificationEventInit eventInit; | |
149 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica
tionID, data)); | |
150 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no
tificationclick, eventInit, observer)); | |
151 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | |
152 } | |
153 | |
154 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
ng& data) | 144 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
ng& data) |
155 { | 145 { |
156 ASSERT(m_workerGlobalScope); | 146 ASSERT(m_workerGlobalScope); |
157 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Push, eventID); | 147 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Push, eventID); |
158 RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, Push
MessageData::create(data), observer)); | 148 RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, Push
MessageData::create(data), observer)); |
159 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | 149 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
160 } | 150 } |
161 | 151 |
162 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID) | 152 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID) |
163 { | 153 { |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 | 222 |
233 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 223 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
234 : m_embeddedWorker(embeddedWorker) | 224 : m_embeddedWorker(embeddedWorker) |
235 , m_document(document) | 225 , m_document(document) |
236 , m_client(client) | 226 , m_client(client) |
237 , m_workerGlobalScope(0) | 227 , m_workerGlobalScope(0) |
238 { | 228 { |
239 } | 229 } |
240 | 230 |
241 } // namespace blink | 231 } // namespace blink |
OLD | NEW |