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 28 matching lines...) Expand all Loading... |
39 #include "core/events/MessageEvent.h" | 39 #include "core/events/MessageEvent.h" |
40 #include "core/inspector/ConsoleMessage.h" | 40 #include "core/inspector/ConsoleMessage.h" |
41 #include "core/workers/WorkerGlobalScope.h" | 41 #include "core/workers/WorkerGlobalScope.h" |
42 #include "modules/background_sync/SyncEvent.h" | 42 #include "modules/background_sync/SyncEvent.h" |
43 #include "modules/fetch/Headers.h" | 43 #include "modules/fetch/Headers.h" |
44 #include "modules/geofencing/CircularGeofencingRegion.h" | 44 #include "modules/geofencing/CircularGeofencingRegion.h" |
45 #include "modules/geofencing/GeofencingEvent.h" | 45 #include "modules/geofencing/GeofencingEvent.h" |
46 #include "modules/navigatorconnect/AcceptConnectionObserver.h" | 46 #include "modules/navigatorconnect/AcceptConnectionObserver.h" |
47 #include "modules/navigatorconnect/CrossOriginConnectEvent.h" | 47 #include "modules/navigatorconnect/CrossOriginConnectEvent.h" |
48 #include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h" | 48 #include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h" |
| 49 #include "modules/navigatorconnect/ServicePortCollection.h" |
| 50 #include "modules/navigatorconnect/WorkerNavigatorServices.h" |
49 #include "modules/notifications/Notification.h" | 51 #include "modules/notifications/Notification.h" |
50 #include "modules/notifications/NotificationEvent.h" | 52 #include "modules/notifications/NotificationEvent.h" |
51 #include "modules/push_messaging/PushEvent.h" | 53 #include "modules/push_messaging/PushEvent.h" |
52 #include "modules/push_messaging/PushMessageData.h" | 54 #include "modules/push_messaging/PushMessageData.h" |
53 #include "modules/serviceworkers/ExtendableEvent.h" | 55 #include "modules/serviceworkers/ExtendableEvent.h" |
54 #include "modules/serviceworkers/FetchEvent.h" | 56 #include "modules/serviceworkers/FetchEvent.h" |
55 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" | 57 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
56 #include "modules/serviceworkers/StashedMessagePort.h" | 58 #include "modules/serviceworkers/StashedMessagePort.h" |
57 #include "modules/serviceworkers/StashedPortCollection.h" | 59 #include "modules/serviceworkers/StashedPortCollection.h" |
58 #include "modules/serviceworkers/WaitUntilObserver.h" | 60 #include "modules/serviceworkers/WaitUntilObserver.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 145 } |
144 | 146 |
145 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
ng& data) | 147 void ServiceWorkerGlobalScopeProxy::dispatchPushEvent(int eventID, const WebStri
ng& data) |
146 { | 148 { |
147 ASSERT(m_workerGlobalScope); | 149 ASSERT(m_workerGlobalScope); |
148 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Push, eventID); | 150 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Push, eventID); |
149 RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, Push
MessageData::create(data), observer)); | 151 RefPtrWillBeRawPtr<Event> event(PushEvent::create(EventTypeNames::push, Push
MessageData::create(data), observer)); |
150 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | 152 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
151 } | 153 } |
152 | 154 |
| 155 void ServiceWorkerGlobalScopeProxy::dispatchServicePortConnectEvent(WebServicePo
rtConnectEventCallbacks* rawCallbacks, const WebURL& targetURL, const WebString&
origin, WebServicePortID portID) |
| 156 { |
| 157 ASSERT(m_workerGlobalScope); |
| 158 OwnPtr<WebServicePortConnectEventCallbacks> callbacks = adoptPtr(rawCallback
s); |
| 159 ServicePortCollection* collection = WorkerNavigatorServices::services(m_work
erGlobalScope, *m_workerGlobalScope->navigator()); |
| 160 collection->dispatchConnectEvent(callbacks.release(), targetURL, origin, por
tID); |
| 161 } |
| 162 |
153 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID) | 163 void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(int eventID) |
154 { | 164 { |
155 ASSERT(m_workerGlobalScope); | 165 ASSERT(m_workerGlobalScope); |
156 if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) { | 166 if (!RuntimeEnabledFeatures::backgroundSyncEnabled()) { |
157 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSync
Event(eventID, WebServiceWorkerEventResultCompleted); | 167 ServiceWorkerGlobalScopeClient::from(m_workerGlobalScope)->didHandleSync
Event(eventID, WebServiceWorkerEventResultCompleted); |
158 return; | 168 return; |
159 } | 169 } |
160 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Sync, eventID); | 170 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Sync, eventID); |
161 // TODO(chasej) - Send registration as in crbug.com/482066 | 171 // TODO(chasej) - Send registration as in crbug.com/482066 |
162 RefPtrWillBeRawPtr<Event> event(SyncEvent::create(EventTypeNames::sync, null
ptr /* registration */, observer)); | 172 RefPtrWillBeRawPtr<Event> event(SyncEvent::create(EventTypeNames::sync, null
ptr /* registration */, observer)); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 245 |
236 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 246 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
237 : m_embeddedWorker(embeddedWorker) | 247 : m_embeddedWorker(embeddedWorker) |
238 , m_document(document) | 248 , m_document(document) |
239 , m_client(client) | 249 , m_client(client) |
240 , m_workerGlobalScope(0) | 250 , m_workerGlobalScope(0) |
241 { | 251 { |
242 } | 252 } |
243 | 253 |
244 } // namespace blink | 254 } // namespace blink |
OLD | NEW |