#ifndef WebEmbeddedWorkerImpl_h
#define WebEmbeddedWorkerImpl_h
-#include "WebContentSecurityPolicy.h"
-#include "WebEmbeddedWorker.h"
-#include "WebEmbeddedWorkerStartData.h"
-#include "WebFrameClient.h"
-
-namespace WebCore {
-class WorkerScriptLoader;
-class WorkerThread;
-}
+#include "public/web/WebContentSecurityPolicy.h"
+#include "public/web/WebEmbeddedWorker.h"
+#include "public/web/WebEmbeddedWorkerStartData.h"
+#include "public/web/WebFrameClient.h"
namespace blink {
class ServiceWorkerGlobalScopeProxy;
class WebServiceWorkerNetworkProvider;
class WebView;
+class WorkerScriptLoader;
+class WorkerThread;
-class WebEmbeddedWorkerImpl FINAL :
- public WebEmbeddedWorker,
- public WebFrameClient {
+class WebEmbeddedWorkerImpl FINAL
+ : public WebEmbeddedWorker
+ , public WebFrameClient {
WTF_MAKE_NONCOPYABLE(WebEmbeddedWorkerImpl);
public:
WebEmbeddedWorkerImpl(
PassOwnPtr<WebWorkerPermissionClientProxy>);
virtual ~WebEmbeddedWorkerImpl();
+ // Terminate all WebEmbeddedWorkerImpl for testing purposes.
+ // Note that this only schedules termination and
+ // does not synchronously wait for it to complete.
+ static void terminateAll();
+
// WebEmbeddedWorker overrides.
virtual void startWorkerContext(const WebEmbeddedWorkerStartData&) OVERRIDE;
+ virtual void resumeAfterDownload() OVERRIDE;
virtual void terminateWorkerContext() OVERRIDE;
+ virtual void resumeWorkerContext() OVERRIDE;
+ virtual void attachDevTools() OVERRIDE;
+ virtual void reattachDevTools(const WebString& savedState) OVERRIDE;
+ virtual void detachDevTools() OVERRIDE;
+ virtual void dispatchDevToolsMessage(const WebString&) OVERRIDE;
private:
class Loader;
// WebFrameClient overrides.
virtual void willSendRequest(
- WebFrame*, unsigned identifier, WebURLRequest&,
+ WebLocalFrame*, unsigned identifier, WebURLRequest&,
const WebURLResponse& redirectResponse) OVERRIDE;
- virtual void didFinishDocumentLoad(WebFrame*) OVERRIDE;
+ virtual void didFinishDocumentLoad(WebLocalFrame*) OVERRIDE;
void onScriptLoaderFinished();
+ void startWorkerThread();
WebEmbeddedWorkerStartData m_workerStartData;
- // These are kept until startWorkerContext is called, and then passed on
- // to WorkerContext.
OwnPtr<WebServiceWorkerContextClient> m_workerContextClient;
+
+ // This is kept until startWorkerContext is called, and then passed on
+ // to WorkerContext.
OwnPtr<WebWorkerPermissionClientProxy> m_permissionClient;
// We retain ownership of this one which is for use on the
// Kept around only while main script loading is ongoing.
OwnPtr<Loader> m_mainScriptLoader;
- RefPtr<WebCore::WorkerThread> m_workerThread;
+ RefPtr<WorkerThread> m_workerThread;
OwnPtr<LoaderProxy> m_loaderProxy;
OwnPtr<ServiceWorkerGlobalScopeProxy> m_workerGlobalScopeProxy;
WebFrame* m_mainFrame;
bool m_askedToTerminate;
+
+ enum {
+ DontPauseAfterDownload,
+ DoPauseAfterDownload,
+ IsPausedAfterDownload
+ } m_pauseAfterDownloadState;
};
} // namespace blink