namespace blink {
class WebDataSource;
+class WebServiceWorkerCacheStorage;
class WebServiceWorkerContextProxy;
class WebServiceWorkerNetworkProvider;
class WebServiceWorkerResponse;
class WebString;
-// FIXME: Remove this after chromium-side code is cleaned up.
-#define HAS_SERVICE_WORKER_CONTEXT_DESTROYED 1
-
// This interface is implemented by the client. It is supposed to be created
// on the main thread and then passed on to the worker thread.
// by a newly created WorkerGlobalScope. All methods of this class, except
public:
virtual ~WebServiceWorkerContextClient() { }
+ // ServiceWorker specific method.
+ virtual WebServiceWorkerCacheStorage* cacheStorage() { return 0; }
+
// ServiceWorker specific method. Called when script accesses the
// the |scope| attribute of the ServiceWorkerGlobalScope. Immutable per spec.
virtual WebURL scope() const { return WebURL(); }
+ // If the worker was started with WebEmbeddedWorkerStartData indicating to pause
+ // after download, this method is called after the main script resource has been
+ // downloaded. The scope will not be created and the script will not be loaded until
+ // WebEmbeddedWorker.resumeAfterDownload() is invoked.
+ virtual void didPauseAfterDownload() { }
+
+ // ServiceWorker has prepared everything for script loading and is now ready for inspection.
+ virtual void workerReadyForInspection() { }
+
// A new WorkerGlobalScope is created and started to run on the
// worker thread.
// This also gives back a proxy to the client to talk to the
virtual void saveDevToolsAgentState(const WebString&) { }
// ServiceWorker specific method.
- virtual void didHandleActivateEvent(int eventID, blink::WebServiceWorkerEventResult result) { }
+ virtual void didHandleActivateEvent(int eventID, WebServiceWorkerEventResult result) { }
// ServiceWorker specific method. Called after InstallEvent (dispatched
// via WebServiceWorkerContextProxy) is handled by the ServiceWorker's
// script context.
- virtual void didHandleInstallEvent(int installEventID, blink::WebServiceWorkerEventResult result) { }
+ virtual void didHandleInstallEvent(int installEventID, WebServiceWorkerEventResult result) { }
// ServiceWorker specific methods. Called after FetchEvent is handled by the
// ServiceWorker's script context. When no response is provided, the browser
virtual void didHandleSyncEvent(int syncEventID) { }
// Ownership of the returned object is transferred to the caller.
- virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(blink::WebDataSource*) { return 0; }
+ virtual WebServiceWorkerNetworkProvider* createServiceWorkerNetworkProvider(WebDataSource*) { return 0; }
// Ownership of the passed callbacks is transferred to the callee, callee
// should delete the callbacks after calling either onSuccess or onError.
} // namespace blink
-#endif // WebWorkerContextClient_h
+#endif // WebServiceWorkerContextClient_h