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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 126 |
127 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) | 127 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) |
128 { | 128 { |
129 ASSERT(m_workerGlobalScope); | 129 ASSERT(m_workerGlobalScope); |
130 | 130 |
131 MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScop
e, webChannels); | 131 MessagePortArray* ports = MessagePort::toMessagePortArray(m_workerGlobalScop
e, webChannels); |
132 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); | 132 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); |
133 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports, value)); | 133 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports, value)); |
134 } | 134 } |
135 | 135 |
136 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID,
int64_t notificationID, const WebNotificationData& data) | |
137 { | |
138 dispatchNotificationClickEvent(eventID, notificationID, data, -1 /* actionIn
dex */); | |
139 } | |
140 | |
141 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID,
int64_t notificationID, const WebNotificationData& data, int actionIndex) | 136 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(int eventID,
int64_t notificationID, const WebNotificationData& data, int actionIndex) |
142 { | 137 { |
143 ASSERT(m_workerGlobalScope); | 138 ASSERT(m_workerGlobalScope); |
144 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::NotificationClick, eventID); | 139 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::NotificationClick, eventID); |
145 NotificationEventInit eventInit; | 140 NotificationEventInit eventInit; |
146 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica
tionID, data)); | 141 eventInit.setNotification(Notification::create(m_workerGlobalScope, notifica
tionID, data)); |
147 if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size())) | 142 if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size())) |
148 eventInit.setAction(data.actions[actionIndex].action); | 143 eventInit.setAction(data.actions[actionIndex].action); |
149 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no
tificationclick, eventInit, observer)); | 144 RefPtrWillBeRawPtr<Event> event(NotificationEvent::create(EventTypeNames::no
tificationclick, eventInit, observer)); |
150 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | 145 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 229 |
235 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 230 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
236 : m_embeddedWorker(embeddedWorker) | 231 : m_embeddedWorker(embeddedWorker) |
237 , m_document(document) | 232 , m_document(document) |
238 , m_client(client) | 233 , m_client(client) |
239 , m_workerGlobalScope(0) | 234 , m_workerGlobalScope(0) |
240 { | 235 { |
241 } | 236 } |
242 | 237 |
243 } // namespace blink | 238 } // namespace blink |
OLD | NEW |