#include "core/dom/ExecutionContext.h"
#include "core/workers/WorkerLoaderProxy.h"
#include "core/workers/WorkerReportingProxy.h"
+#include "core/workers/WorkerScriptLoaderClient.h"
#include "core/workers/WorkerThread.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefPtr.h"
#include "wtf/WeakPtr.h"
+namespace WebCore {
+class ResourceResponse;
+}
+
namespace blink {
class WebApplicationCacheHost;
class WebApplicationCacheHostClient;
// WebCore::WorkerLoaderProxy methods:
virtual void postTaskToLoader(PassOwnPtr<WebCore::ExecutionContextTask>) OVERRIDE;
- virtual bool postTaskForModeToWorkerGlobalScope(
- PassOwnPtr<WebCore::ExecutionContextTask>, const WTF::String& mode) OVERRIDE;
+ virtual bool postTaskToWorkerGlobalScope(PassOwnPtr<WebCore::ExecutionContextTask>) OVERRIDE;
// WebFrameClient methods to support resource loading thru the 'shadow page'.
virtual WebApplicationCacheHost* createApplicationCacheHost(WebFrame*, WebApplicationCacheHostClient*) OVERRIDE;
+ virtual void didFinishDocumentLoad(WebFrame*) OVERRIDE;
// WebSharedWorker methods:
- virtual void startWorkerContext(const WebURL&, const WebString& name, const WebString& userAgent, const WebString& sourceCode, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType, long long cacheId) OVERRIDE;
+ virtual void startWorkerContext(const WebURL&, const WebString& name, const WebString& contentSecurityPolicy, WebContentSecurityPolicyType) OVERRIDE;
virtual void connect(WebMessagePortChannel*) OVERRIDE;
virtual void terminateWorkerContext() OVERRIDE;
virtual void clientDestroyed() OVERRIDE;
virtual void dispatchDevToolsMessage(const WebString&) OVERRIDE;
private:
+ class Loader;
+
virtual ~WebSharedWorkerImpl();
WebSharedWorkerClient* client() { return m_client->get(); }
// Creates the shadow loader used for worker network requests.
void initializeLoader(const WebURL&);
+ void didReceiveScriptLoaderResponse();
+ void onScriptLoaderFinished();
static void connectTask(WebCore::ExecutionContext*, PassOwnPtr<WebMessagePortChannel>);
// Tasks that are run on the main thread.
void workerGlobalScopeDestroyedOnMainThread();
// 'shadow page' - created to proxy loading requests from the worker.
+ RefPtr<WebCore::ExecutionContext> m_loadingDocument;
WebView* m_webView;
WebFrame* m_mainFrame;
bool m_askedToTerminate;
WeakPtr<WebSharedWorkerClient> m_clientWeakPtr;
bool m_pauseWorkerContextOnStart;
+ bool m_attachDevToolsOnStart;
+
+ // Kept around only while main script loading is ongoing.
+ OwnPtr<Loader> m_mainScriptLoader;
+ WebURL m_url;
+ WebString m_name;
+ WebString m_contentSecurityPolicy;
+ WebContentSecurityPolicyType m_policyType;
};
} // namespace blink