summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/workers/Worker.h
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-07-31 11:52:57 +1000
committerWarwick Allison <warwick.allison@nokia.com>2009-07-31 11:52:57 +1000
commitaa9cf406d62004519ad54596e1c391f9a6439210 (patch)
treedd562b9c296981f2761b76623911be8496c7af84 /src/3rdparty/webkit/WebCore/workers/Worker.h
parent987aec28b950e1c9817a20a9dd71afc071cd93ea (diff)
parent56b6a5924008ab5cdbae36e9662eddba923acd5e (diff)
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/3rdparty/webkit/WebCore/workers/Worker.h')
-rw-r--r--src/3rdparty/webkit/WebCore/workers/Worker.h29
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 1fcc8be7b..6b8ee63a1 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