Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(267)

Side by Side Diff: Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 588383002: Service Workers: InstallPhaseEvent -> ExtendableEvent (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698