WebWorkerClientImpl.h [plain text]
#ifndef WebWorkerClientImpl_h
#define WebWorkerClientImpl_h
#if ENABLE(WORKERS)
#include "ScriptExecutionContext.h"
#include "WorkerContextProxy.h"
#include "WorkerLoaderProxy.h"
#include "WorkerMessagingProxy.h"
#include "WorkerObjectProxy.h"
#include "platform/WebFileSystem.h"
#include "WebWorkerBase.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
namespace WebKit {
class WebWorker;
class WebFrameImpl;
class WebWorkerClientImpl : public WebCore::WorkerContextProxy
, public WebCore::WorkerObjectProxy
, public WebWorkerBase
, public WebCommonWorkerClient {
public:
static WebCore::WorkerContextProxy* createWorkerContextProxy(WebCore::Worker*);
virtual void startWorkerContext(const WebCore::KURL&,
const WTF::String&,
const WTF::String&,
WebCore::WorkerThreadStartMode) OVERRIDE;
virtual void terminateWorkerContext() OVERRIDE;
virtual void postMessageToWorkerContext(
PassRefPtr<WebCore::SerializedScriptValue> message,
PassOwnPtr<WebCore::MessagePortChannelArray> channels) OVERRIDE;
virtual bool hasPendingActivity() const OVERRIDE;
virtual void workerObjectDestroyed() OVERRIDE;
#if ENABLE(INSPECTOR)
virtual void connectToInspector(WebCore::WorkerContextProxy::PageInspector*) OVERRIDE;
virtual void disconnectFromInspector() OVERRIDE;
virtual void sendMessageToInspector(const String&) OVERRIDE;
virtual void postMessageToPageInspector(const String&) OVERRIDE;
virtual void updateInspectorStateCookie(const String&) OVERRIDE;
#endif
virtual void postTaskToLoader(PassOwnPtr<WebCore::ScriptExecutionContext::Task>) OVERRIDE;
virtual bool postTaskForModeToWorkerContext(PassOwnPtr<WebCore::ScriptExecutionContext::Task>, const String& mode) OVERRIDE;
virtual void postMessageToWorkerObject(PassRefPtr<WebCore::SerializedScriptValue>, PassOwnPtr<WebCore::MessagePortChannelArray>) OVERRIDE;
virtual void postExceptionToWorkerObject(const String& errorMessage, int lineNumber, const String& sourceURL) OVERRIDE;
virtual void postConsoleMessageToWorkerObject(WebCore::MessageSource, WebCore::MessageType, WebCore::MessageLevel,
const String& message, int lineNumber, const String& sourceURL) OVERRIDE;
virtual void confirmMessageFromWorkerObject(bool) OVERRIDE;
virtual void reportPendingActivity(bool) OVERRIDE;
virtual void workerContextClosed() OVERRIDE;
virtual void workerContextDestroyed() OVERRIDE;
virtual bool allowDatabase(WebFrame*, const WebString& name, const WebString& displayName, unsigned long estimatedSize) OVERRIDE;
virtual bool allowFileSystem();
virtual void openFileSystem(WebFileSystem::Type, long long size, bool create,
WebFileSystemCallbacks*) OVERRIDE;
virtual bool allowIndexedDB(const WebString& name) OVERRIDE;
virtual WebCommonWorkerClient* commonClient() OVERRIDE { return this; }
virtual WebView* view() const OVERRIDE;
private:
WebWorkerClientImpl(WebCore::Worker*, WebFrameImpl*);
virtual ~WebWorkerClientImpl();
WebCore::WorkerMessagingProxy* m_proxy;
RefPtr<WebCore::ScriptExecutionContext> m_scriptExecutionContext;
WebFrameImpl* m_webFrame;
};
}
#endif // ENABLE(WORKERS)
#endif