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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "modules/geofencing/GeofencingEvent.h" | 44 #include "modules/geofencing/GeofencingEvent.h" |
45 #include "modules/navigatorconnect/AcceptConnectionObserver.h" | 45 #include "modules/navigatorconnect/AcceptConnectionObserver.h" |
46 #include "modules/navigatorconnect/CrossOriginConnectEvent.h" | 46 #include "modules/navigatorconnect/CrossOriginConnectEvent.h" |
47 #include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h" | 47 #include "modules/navigatorconnect/CrossOriginServiceWorkerClient.h" |
48 #include "modules/notifications/Notification.h" | 48 #include "modules/notifications/Notification.h" |
49 #include "modules/notifications/NotificationEvent.h" | 49 #include "modules/notifications/NotificationEvent.h" |
50 #include "modules/push_messaging/PushEvent.h" | 50 #include "modules/push_messaging/PushEvent.h" |
51 #include "modules/push_messaging/PushMessageData.h" | 51 #include "modules/push_messaging/PushMessageData.h" |
52 #include "modules/serviceworkers/ExtendableEvent.h" | 52 #include "modules/serviceworkers/ExtendableEvent.h" |
53 #include "modules/serviceworkers/FetchEvent.h" | 53 #include "modules/serviceworkers/FetchEvent.h" |
54 #include "modules/serviceworkers/InstallEvent.h" | |
55 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" | 54 #include "modules/serviceworkers/ServiceWorkerGlobalScope.h" |
56 #include "modules/serviceworkers/WaitUntilObserver.h" | 55 #include "modules/serviceworkers/WaitUntilObserver.h" |
57 #include "platform/RuntimeEnabledFeatures.h" | 56 #include "platform/RuntimeEnabledFeatures.h" |
58 #include "public/platform/WebCrossOriginServiceWorkerClient.h" | 57 #include "public/platform/WebCrossOriginServiceWorkerClient.h" |
59 #include "public/platform/WebServiceWorkerEventResult.h" | 58 #include "public/platform/WebServiceWorkerEventResult.h" |
60 #include "public/platform/WebServiceWorkerRequest.h" | 59 #include "public/platform/WebServiceWorkerRequest.h" |
61 #include "public/platform/modules/notifications/WebNotificationData.h" | 60 #include "public/platform/modules/notifications/WebNotificationData.h" |
62 #include "public/web/WebSerializedScriptValue.h" | 61 #include "public/web/WebSerializedScriptValue.h" |
63 #include "public/web/WebServiceWorkerContextClient.h" | 62 #include "public/web/WebServiceWorkerContextClient.h" |
64 #include "web/WebEmbeddedWorkerImpl.h" | 63 #include "web/WebEmbeddedWorkerImpl.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 { | 111 { |
113 ASSERT(m_workerGlobalScope); | 112 ASSERT(m_workerGlobalScope); |
114 const AtomicString& type = eventType == WebGeofencingEventTypeEnter ? EventT
ypeNames::geofenceenter : EventTypeNames::geofenceleave; | 113 const AtomicString& type = eventType == WebGeofencingEventTypeEnter ? EventT
ypeNames::geofenceenter : EventTypeNames::geofenceleave; |
115 m_workerGlobalScope->dispatchEvent(GeofencingEvent::create(type, regionID, C
ircularGeofencingRegion::create(regionID, region))); | 114 m_workerGlobalScope->dispatchEvent(GeofencingEvent::create(type, regionID, C
ircularGeofencingRegion::create(regionID, region))); |
116 } | 115 } |
117 | 116 |
118 void ServiceWorkerGlobalScopeProxy::dispatchInstallEvent(int eventID) | 117 void ServiceWorkerGlobalScopeProxy::dispatchInstallEvent(int eventID) |
119 { | 118 { |
120 ASSERT(m_workerGlobalScope); | 119 ASSERT(m_workerGlobalScope); |
121 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Install, eventID); | 120 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Install, eventID); |
122 RefPtrWillBeRawPtr<Event> event(InstallEvent::create(EventTypeNames::install
, InstallEventInit(), observer)); | 121 RefPtrWillBeRawPtr<Event> event(ExtendableEvent::create(EventTypeNames::inst
all, ExtendableEventInit(), observer)); |
123 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); | 122 m_workerGlobalScope->dispatchExtendableEvent(event.release(), observer); |
124 } | 123 } |
125 | 124 |
126 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) | 125 void ServiceWorkerGlobalScopeProxy::dispatchMessageEvent(const WebString& messag
e, const WebMessagePortChannelArray& webChannels) |
127 { | 126 { |
128 ASSERT(m_workerGlobalScope); | 127 ASSERT(m_workerGlobalScope); |
129 | 128 |
130 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray
(m_workerGlobalScope, webChannels); | 129 OwnPtrWillBeRawPtr<MessagePortArray> ports = MessagePort::toMessagePortArray
(m_workerGlobalScope, webChannels); |
131 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); | 130 WebSerializedScriptValue value = WebSerializedScriptValue::fromString(messag
e); |
132 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val
ue)); | 131 m_workerGlobalScope->dispatchEvent(MessageEvent::create(ports.release(), val
ue)); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 222 |
224 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 223 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
225 : m_embeddedWorker(embeddedWorker) | 224 : m_embeddedWorker(embeddedWorker) |
226 , m_document(document) | 225 , m_document(document) |
227 , m_client(client) | 226 , m_client(client) |
228 , m_workerGlobalScope(0) | 227 , m_workerGlobalScope(0) |
229 { | 228 { |
230 } | 229 } |
231 | 230 |
232 } // namespace blink | 231 } // namespace blink |
OLD | NEW |