| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 #include "bindings/core/v8/WorkerScriptController.h" | 34 #include "bindings/core/v8/WorkerScriptController.h" |
| 35 #include "core/dom/CrossThreadTask.h" | 35 #include "core/dom/CrossThreadTask.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/dom/ExecutionContext.h" | 37 #include "core/dom/ExecutionContext.h" |
| 38 #include "core/dom/MessagePort.h" | 38 #include "core/dom/MessagePort.h" |
| 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/push_messaging/PushEvent.h" | 42 #include "modules/push_messaging/PushEvent.h" |
| 43 #include "modules/serviceworkers/ExtendableEvent.h" |
| 43 #include "modules/serviceworkers/FetchEvent.h" | 44 #include "modules/serviceworkers/FetchEvent.h" |
| 44 #include "modules/serviceworkers/InstallEvent.h" | 45 #include "modules/serviceworkers/InstallEvent.h" |
| 45 #include "modules/serviceworkers/InstallPhaseEvent.h" | |
| 46 #include "modules/serviceworkers/WaitUntilObserver.h" | 46 #include "modules/serviceworkers/WaitUntilObserver.h" |
| 47 #include "platform/RuntimeEnabledFeatures.h" | 47 #include "platform/RuntimeEnabledFeatures.h" |
| 48 #include "public/platform/WebServiceWorkerRequest.h" | 48 #include "public/platform/WebServiceWorkerRequest.h" |
| 49 #include "public/web/WebSerializedScriptValue.h" | 49 #include "public/web/WebSerializedScriptValue.h" |
| 50 #include "public/web/WebServiceWorkerContextClient.h" | 50 #include "public/web/WebServiceWorkerContextClient.h" |
| 51 #include "web/WebEmbeddedWorkerImpl.h" | 51 #include "web/WebEmbeddedWorkerImpl.h" |
| 52 #include "wtf/Functional.h" | 52 #include "wtf/Functional.h" |
| 53 #include "wtf/PassOwnPtr.h" | 53 #include "wtf/PassOwnPtr.h" |
| 54 | 54 |
| 55 namespace blink { | 55 namespace blink { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 70 observer->willDispatchEvent(); | 70 observer->willDispatchEvent(); |
| 71 m_workerGlobalScope->dispatchEvent(InstallEvent::create(EventTypeNames::inst
all, EventInit(), observer)); | 71 m_workerGlobalScope->dispatchEvent(InstallEvent::create(EventTypeNames::inst
all, EventInit(), observer)); |
| 72 observer->didDispatchEvent(); | 72 observer->didDispatchEvent(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void ServiceWorkerGlobalScopeProxy::dispatchActivateEvent(int eventID) | 75 void ServiceWorkerGlobalScopeProxy::dispatchActivateEvent(int eventID) |
| 76 { | 76 { |
| 77 ASSERT(m_workerGlobalScope); | 77 ASSERT(m_workerGlobalScope); |
| 78 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Activate, eventID); | 78 WaitUntilObserver* observer = WaitUntilObserver::create(m_workerGlobalScope,
WaitUntilObserver::Activate, eventID); |
| 79 observer->willDispatchEvent(); | 79 observer->willDispatchEvent(); |
| 80 m_workerGlobalScope->dispatchEvent(InstallPhaseEvent::create(EventTypeNames:
:activate, EventInit(), observer)); | 80 m_workerGlobalScope->dispatchEvent(ExtendableEvent::create(EventTypeNames::a
ctivate, EventInit(), observer)); |
| 81 observer->didDispatchEvent(); | 81 observer->didDispatchEvent(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer
viceWorkerRequest& webRequest) | 84 void ServiceWorkerGlobalScopeProxy::dispatchFetchEvent(int eventID, const WebSer
viceWorkerRequest& webRequest) |
| 85 { | 85 { |
| 86 ASSERT(m_workerGlobalScope); | 86 ASSERT(m_workerGlobalScope); |
| 87 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc
ope, eventID); | 87 RespondWithObserver* observer = RespondWithObserver::create(m_workerGlobalSc
ope, eventID); |
| 88 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) { | 88 if (!RuntimeEnabledFeatures::serviceWorkerOnFetchEnabled()) { |
| 89 observer->didDispatchEvent(); | 89 observer->didDispatchEvent(); |
| 90 return; | 90 return; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 165 |
| 166 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) | 166 ServiceWorkerGlobalScopeProxy::ServiceWorkerGlobalScopeProxy(WebEmbeddedWorkerIm
pl& embeddedWorker, Document& document, WebServiceWorkerContextClient& client) |
| 167 : m_embeddedWorker(embeddedWorker) | 167 : m_embeddedWorker(embeddedWorker) |
| 168 , m_document(document) | 168 , m_document(document) |
| 169 , m_client(client) | 169 , m_client(client) |
| 170 , m_workerGlobalScope(0) | 170 , m_workerGlobalScope(0) |
| 171 { | 171 { |
| 172 } | 172 } |
| 173 | 173 |
| 174 } // namespace blink | 174 } // namespace blink |
| OLD | NEW |