diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/workers/Worker.h')
-rw-r--r-- | src/3rdparty/webkit/WebCore/workers/Worker.h | 29 |
1 files changed, 5 insertions, 24 deletions
diff --git a/src/3rdparty/webkit/WebCore/workers/Worker.h b/src/3rdparty/webkit/WebCore/workers/Worker.h index 1fcc8be..6b8ee63 100644 --- a/src/3rdparty/webkit/WebCore/workers/Worker.h +++ b/src/3rdparty/webkit/WebCore/workers/Worker.h @@ -29,11 +29,11 @@ #if ENABLE(WORKERS) -#include "AtomicStringHash.h" +#include "AbstractWorker.h" #include "ActiveDOMObject.h" +#include "AtomicStringHash.h" #include "EventListener.h" #include "EventTarget.h" -#include "KURL.h" #include "WorkerScriptLoaderClient.h" #include <wtf/OwnPtr.h> #include <wtf/PassRefPtr.h> @@ -49,13 +49,11 @@ namespace WebCore { typedef int ExceptionCode; - class Worker : public RefCounted<Worker>, public ActiveDOMObject, private WorkerScriptLoaderClient, public EventTarget { + class Worker : public AbstractWorker, private WorkerScriptLoaderClient { public: - static PassRefPtr<Worker> create(const String& url, ScriptExecutionContext* context, ExceptionCode& ec) { return adoptRef(new Worker(url, context, ec)); } + static PassRefPtr<Worker> create(const String& url, ScriptExecutionContext* context) { return adoptRef(new Worker(url, context)); } ~Worker(); - virtual ScriptExecutionContext* scriptExecutionContext() const { return ActiveDOMObject::scriptExecutionContext(); } - virtual Worker* toWorker() { return this; } void postMessage(const String&, ExceptionCode&); @@ -70,39 +68,22 @@ namespace WebCore { virtual void stop(); virtual bool hasPendingActivity() const; - virtual void addEventListener(const AtomicString& eventType, PassRefPtr<EventListener>, bool useCapture); - virtual void removeEventListener(const AtomicString& eventType, EventListener*, bool useCapture); - virtual bool dispatchEvent(PassRefPtr<Event>, ExceptionCode&); - - typedef Vector<RefPtr<EventListener> > ListenerVector; - typedef HashMap<AtomicString, ListenerVector> EventListenersMap; - EventListenersMap& eventListeners() { return m_eventListeners; } - - using RefCounted<Worker>::ref; - using RefCounted<Worker>::deref; - void setOnmessage(PassRefPtr<EventListener> eventListener) { m_onMessageListener = eventListener; } EventListener* onmessage() const { return m_onMessageListener.get(); } - void setOnerror(PassRefPtr<EventListener> eventListener) { m_onErrorListener = eventListener; } - EventListener* onerror() const { return m_onErrorListener.get(); } - private: - Worker(const String&, ScriptExecutionContext*, ExceptionCode&); + Worker(const String&, ScriptExecutionContext*); virtual void notifyFinished(); virtual void refEventTarget() { ref(); } virtual void derefEventTarget() { deref(); } - KURL m_scriptURL; OwnPtr<WorkerScriptLoader> m_scriptLoader; WorkerContextProxy* m_contextProxy; // The proxy outlives the worker to perform thread shutdown. RefPtr<EventListener> m_onMessageListener; - RefPtr<EventListener> m_onErrorListener; - EventListenersMap m_eventListeners; }; } // namespace WebCore |