summaryrefslogtreecommitdiffstats
path: root/WebCore/workers
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
committerFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
commit5f1ab04193ad0130ca8204aadaceae083aca9881 (patch)
tree5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/workers
parent194315e5a908cc8ed67d597010544803eef1ac59 (diff)
downloadexternal_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2
Get WebKit r44544.
Diffstat (limited to 'WebCore/workers')
-rw-r--r--WebCore/workers/WorkerContext.cpp53
-rw-r--r--WebCore/workers/WorkerContext.h56
-rw-r--r--WebCore/workers/WorkerContext.idl39
-rw-r--r--WebCore/workers/WorkerLoaderProxy.h64
-rw-r--r--WebCore/workers/WorkerMessagingProxy.cpp14
-rw-r--r--WebCore/workers/WorkerMessagingProxy.h11
-rw-r--r--WebCore/workers/WorkerThread.cpp9
-rw-r--r--WebCore/workers/WorkerThread.h11
8 files changed, 196 insertions, 61 deletions
diff --git a/WebCore/workers/WorkerContext.cpp b/WebCore/workers/WorkerContext.cpp
index 69ef472..0b8778a 100644
--- a/WebCore/workers/WorkerContext.cpp
+++ b/WebCore/workers/WorkerContext.cpp
@@ -42,12 +42,12 @@
#include "ScriptSourceCode.h"
#include "ScriptValue.h"
#include "SecurityOrigin.h"
-#include "ThreadableLoader.h"
#include "WorkerImportScriptsClient.h"
#include "WorkerLocation.h"
#include "WorkerNavigator.h"
#include "WorkerObjectProxy.h"
#include "WorkerThread.h"
+#include "WorkerThreadableLoader.h"
#include "XMLHttpRequestException.h"
#include <wtf/RefPtr.h>
@@ -56,9 +56,9 @@ namespace WebCore {
WorkerContext::WorkerContext(const KURL& url, const String& userAgent, WorkerThread* thread)
: m_url(url)
, m_userAgent(userAgent)
- , m_location(WorkerLocation::create(url))
, m_script(new WorkerScriptController(this))
, m_thread(thread)
+ , m_closing(false)
{
setSecurityOrigin(SecurityOrigin::create(url));
}
@@ -67,7 +67,7 @@ WorkerContext::~WorkerContext()
{
ASSERT(currentThread() == m_thread->threadID());
- m_thread->workerObjectProxy()->workerContextDestroyed();
+ m_thread->workerObjectProxy().workerContextDestroyed();
}
ScriptExecutionContext* WorkerContext::scriptExecutionContext() const
@@ -92,7 +92,7 @@ KURL WorkerContext::completeURL(const String& url) const
if (url.isNull())
return KURL();
// Always use UTF-8 in Workers.
- return KURL(m_location->url(), url);
+ return KURL(m_url, url);
}
String WorkerContext::userAgent(const KURL&) const
@@ -100,6 +100,22 @@ String WorkerContext::userAgent(const KURL&) const
return m_userAgent;
}
+WorkerLocation* WorkerContext::location() const
+{
+ if (!m_location)
+ m_location = WorkerLocation::create(m_url);
+ return m_location.get();
+}
+
+void WorkerContext::close()
+{
+ if (m_closing)
+ return;
+
+ m_closing = true;
+ m_thread->stop();
+}
+
WorkerNavigator* WorkerContext::navigator() const
{
if (!m_navigator)
@@ -120,12 +136,12 @@ bool WorkerContext::hasPendingActivity() const
void WorkerContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL)
{
- m_thread->workerObjectProxy()->postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
+ m_thread->workerObjectProxy().postExceptionToWorkerObject(errorMessage, lineNumber, sourceURL);
}
void WorkerContext::addMessage(MessageDestination destination, MessageSource source, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceURL)
{
- m_thread->workerObjectProxy()->postConsoleMessageToWorkerObject(destination, source, level, message, lineNumber, sourceURL);
+ m_thread->workerObjectProxy().postConsoleMessageToWorkerObject(destination, source, level, message, lineNumber, sourceURL);
}
void WorkerContext::resourceRetrievedByXMLHttpRequest(unsigned long, const ScriptString&)
@@ -142,7 +158,10 @@ void WorkerContext::scriptImported(unsigned long, const String&)
void WorkerContext::postMessage(const String& message)
{
- m_thread->workerObjectProxy()->postMessageToWorkerObject(message);
+ if (m_closing)
+ return;
+
+ m_thread->workerObjectProxy().postMessageToWorkerObject(message);
}
void WorkerContext::addEventListener(const AtomicString& eventType, PassRefPtr<EventListener> eventListener, bool)
@@ -201,18 +220,30 @@ void WorkerContext::postTask(PassRefPtr<Task> task)
thread()->runLoop().postTask(task);
}
-int WorkerContext::installTimeout(ScheduledAction* action, int timeout, bool singleShot)
+int WorkerContext::setTimeout(ScheduledAction* action, int timeout)
+{
+ return DOMTimer::install(scriptExecutionContext(), action, timeout, true);
+}
+
+void WorkerContext::clearTimeout(int timeoutId)
+{
+ DOMTimer::removeById(scriptExecutionContext(), timeoutId);
+}
+
+int WorkerContext::setInterval(ScheduledAction* action, int timeout)
{
- return DOMTimer::install(scriptExecutionContext(), action, timeout, singleShot);
+ return DOMTimer::install(scriptExecutionContext(), action, timeout, false);
}
-void WorkerContext::removeTimeout(int timeoutId)
+void WorkerContext::clearInterval(int timeoutId)
{
DOMTimer::removeById(scriptExecutionContext(), timeoutId);
}
void WorkerContext::dispatchMessage(const String& message)
{
+ // Since close() stops the thread event loop, this should not ever get called while closing.
+ ASSERT(!m_closing);
RefPtr<Event> evt = MessageEvent::create(message, "", "", 0, 0);
if (m_onmessageListener.get()) {
@@ -247,7 +278,7 @@ void WorkerContext::importScripts(const Vector<String>& urls, const String& call
request.setHTTPMethod("GET");
request.setHTTPOrigin(securityOrigin);
WorkerImportScriptsClient client(scriptExecutionContext(), *it, callerURL, callerLine);
- ThreadableLoader::loadResourceSynchronously(scriptExecutionContext(), request, client);
+ WorkerThreadableLoader::loadResourceSynchronously(this, request, client, AllowStoredCredentials, AllowDifferentRedirectOrigin);
// If the fetching attempt failed, throw a NETWORK_ERR exception and abort all these steps.
if (client.failed()) {
diff --git a/WebCore/workers/WorkerContext.h b/WebCore/workers/WorkerContext.h
index 39a5b9b..ce782f8 100644
--- a/WebCore/workers/WorkerContext.h
+++ b/WebCore/workers/WorkerContext.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2008 Apple Inc. All Rights Reserved.
+ * Copyright (C) 2008, 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -57,6 +57,8 @@ namespace WebCore {
virtual bool isWorkerContext() const { return true; }
+ virtual WorkerContext* toWorkerContext() { return this; }
+
virtual ScriptExecutionContext* scriptExecutionContext() const;
const KURL& url() const { return m_url; }
@@ -64,11 +66,9 @@ namespace WebCore {
virtual String userAgent(const KURL&) const;
- WorkerLocation* location() const { return m_location.get(); }
- WorkerNavigator* navigator() const;
-
WorkerScriptController* script() { return m_script.get(); }
void clearScript() { return m_script.clear(); }
+
WorkerThread* thread() { return m_thread; }
bool hasPendingActivity() const;
@@ -78,46 +78,64 @@ namespace WebCore {
virtual void resourceRetrievedByXMLHttpRequest(unsigned long identifier, const ScriptString& sourceString);
virtual void scriptImported(unsigned long identifier, const String& sourceString);
- virtual WorkerContext* toWorkerContext() { return this; }
-
- void postMessage(const String& message);
virtual void postTask(PassRefPtr<Task>); // Executes the task on context's thread asynchronously.
- int installTimeout(ScheduledAction*, int timeout, bool singleShot);
- void removeTimeout(int timeoutId);
- void dispatchMessage(const String&);
+ // WorkerGlobalScope
+ WorkerContext* self() { return this; }
+ WorkerLocation* location() const;
+ void close();
- 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&);
+ // WorkerUtils
+ void importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode&);
+ WorkerNavigator* navigator() const;
+
+ // DedicatedWorkerGlobalScope
+ void postMessage(const String& message);
void setOnmessage(PassRefPtr<EventListener> eventListener) { m_onmessageListener = eventListener; }
EventListener* onmessage() const { return m_onmessageListener.get(); }
+ // Timers
+ int setTimeout(ScheduledAction*, int timeout);
+ void clearTimeout(int timeoutId);
+ int setInterval(ScheduledAction*, int timeout);
+ void clearInterval(int timeoutId);
+
+ // EventTarget
+ 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; }
- void importScripts(const Vector<String>& urls, const String& callerURL, int callerLine, ExceptionCode&);
-
+ void dispatchMessage(const String&);
+
+ // These methods are used for GC marking. See JSWorkerContext::mark() in
+ // JSWorkerContextCustom.cpp.
+ WorkerNavigator* optionalNavigator() const { return m_navigator.get(); }
+ WorkerLocation* optionalLocation() const { return m_location.get(); }
+
using RefCounted<WorkerContext>::ref;
using RefCounted<WorkerContext>::deref;
private:
+ WorkerContext(const KURL&, const String&, WorkerThread*);
+
virtual void refScriptExecutionContext() { ref(); }
virtual void derefScriptExecutionContext() { deref(); }
virtual void refEventTarget() { ref(); }
virtual void derefEventTarget() { deref(); }
- WorkerContext(const KURL&, const String&, WorkerThread*);
-
virtual const KURL& virtualURL() const;
virtual KURL virtualCompleteURL(const String&) const;
KURL m_url;
String m_userAgent;
- RefPtr<WorkerLocation> m_location;
+
+ mutable RefPtr<WorkerLocation> m_location;
mutable RefPtr<WorkerNavigator> m_navigator;
OwnPtr<WorkerScriptController> m_script;
@@ -125,6 +143,8 @@ namespace WebCore {
RefPtr<EventListener> m_onmessageListener;
EventListenersMap m_eventListeners;
+
+ bool m_closing;
};
} // namespace WebCore
diff --git a/WebCore/workers/WorkerContext.idl b/WebCore/workers/WorkerContext.idl
index bbfca63..60568fb 100644
--- a/WebCore/workers/WorkerContext.idl
+++ b/WebCore/workers/WorkerContext.idl
@@ -34,28 +34,36 @@ module threads {
LegacyParent=JSWorkerContextBase,
NoStaticTables
] WorkerContext {
-#if defined(LANGUAGE_JAVASCRIPT)
- attribute [Custom] WorkerContext self;
+
+ // WorkerGlobalScope
+#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
+ attribute [Replaceable] WorkerContext self;
#endif
+ attribute [Replaceable] WorkerLocation location;
+ void close();
+ // attribute EventListener onclose;
+ // attribute EventListener onerror;
+
+ // WorkerUtils
+ [Custom] void importScripts(/*[Variadic] in DOMString urls */);
+ attribute [Replaceable] WorkerNavigator navigator;
+ // Database openDatabase(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize);
+ // DatabaseSync openDatabaseSync(in DOMString name, in DOMString version, in DOMString displayName, in unsigned long estimatedSize);
+
- attribute EventListener onmessage;
+ // DedicatedWorkerGlobalScope
void postMessage(in DOMString message);
- [Custom] void importScripts(/* urls */);
+ attribute EventListener onmessage;
- attribute [Replaceable] WorkerLocation location;
- attribute [Replaceable] WorkerNavigator navigator;
-
- attribute MessageEventConstructor MessageEvent;
- attribute WorkerLocationConstructor WorkerLocation;
// Timers
[Custom] long setTimeout(in TimeoutHandler handler, in long timeout);
// [Custom] long setTimeout(in DOMString code, in long timeout);
- [Custom] void clearTimeout(in long handle);
-
+ void clearTimeout(in long handle);
[Custom] long setInterval(in TimeoutHandler handler, in long timeout);
// [Custom] long setInterval(in DOMString code, in long timeout);
- [Custom] void clearInterval(in long handle);
+ void clearInterval(in long handle);
+
// EventTarget interface
[Custom] void addEventListener(in DOMString type,
@@ -66,6 +74,13 @@ module threads {
in boolean useCapture);
boolean dispatchEvent(in Event evt)
raises(EventException);
+
+
+ // Constructors
+ attribute MessageEventConstructor MessageEvent;
+ attribute WorkerLocationConstructor WorkerLocation;
+
+ attribute [JSCCustomGetter] XMLHttpRequestConstructor XMLHttpRequest;
};
}
diff --git a/WebCore/workers/WorkerLoaderProxy.h b/WebCore/workers/WorkerLoaderProxy.h
new file mode 100644
index 0000000..b51f480
--- /dev/null
+++ b/WebCore/workers/WorkerLoaderProxy.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WorkerLoaderProxy_h
+#define WorkerLoaderProxy_h
+
+#if ENABLE(WORKERS)
+
+#include <wtf/PassRefPtr.h>
+
+namespace WebCore {
+
+ class ScriptExecutionContext::Task;
+ class String;
+
+ // A proxy to talk to the loader context. Normally, the document on the main thread
+ // provides loading services for the subordinate workers. This interface provides 2-way
+ // communications to the Document context and back to the worker.
+ // Note that in multi-process browsers, the Worker object context and the Document
+ // context can be distinct.
+ class WorkerLoaderProxy {
+ public:
+ virtual ~WorkerLoaderProxy() { }
+
+ // Posts a task to the thread which runs the loading code (normally, the main thread).
+ virtual void postTaskToLoader(PassRefPtr<ScriptExecutionContext::Task>) = 0;
+
+ // Posts callbacks from loading code to the WorkerContext. The 'mode' is used to differentiate
+ // specific synchronous loading requests so they can be 'nested', per spec.
+ virtual void postTaskForModeToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>, const String& mode) = 0;
+ };
+
+} // namespace WebCore
+
+#endif // ENABLE(WORKERS)
+
+#endif // WorkerLoaderProxy_h
diff --git a/WebCore/workers/WorkerMessagingProxy.cpp b/WebCore/workers/WorkerMessagingProxy.cpp
index 4b34658..a6d0d5d 100644
--- a/WebCore/workers/WorkerMessagingProxy.cpp
+++ b/WebCore/workers/WorkerMessagingProxy.cpp
@@ -62,7 +62,7 @@ private:
context->dispatchMessage(m_message);
- context->thread()->workerObjectProxy()->confirmMessageFromWorkerObject(context->hasPendingActivity());
+ context->thread()->workerObjectProxy().confirmMessageFromWorkerObject(context->hasPendingActivity());
}
private:
@@ -200,7 +200,7 @@ WorkerMessagingProxy::~WorkerMessagingProxy()
void WorkerMessagingProxy::startWorkerContext(const KURL& scriptURL, const String& userAgent, const String& sourceCode)
{
- RefPtr<WorkerThread> thread = WorkerThread::create(scriptURL, userAgent, sourceCode, this);
+ RefPtr<WorkerThread> thread = WorkerThread::create(scriptURL, userAgent, sourceCode, *this, *this);
workerThreadCreated(thread);
thread->start();
}
@@ -222,11 +222,6 @@ void WorkerMessagingProxy::postMessageToWorkerContext(const String& message)
m_queuedEarlyTasks.append(MessageWorkerContextTask::create(message));
}
-void WorkerMessagingProxy::postTaskToWorkerContext(PassRefPtr<ScriptExecutionContext::Task> task)
-{
- postTaskForModeToWorkerContext(task, WorkerRunLoop::defaultMode());
-}
-
void WorkerMessagingProxy::postTaskForModeToWorkerContext(PassRefPtr<ScriptExecutionContext::Task> task, const String& mode)
{
if (m_askedToTerminate)
@@ -236,8 +231,10 @@ void WorkerMessagingProxy::postTaskForModeToWorkerContext(PassRefPtr<ScriptExecu
m_workerThread->runLoop().postTaskForMode(task, mode);
}
-void WorkerMessagingProxy::postTaskToWorkerObject(PassRefPtr<ScriptExecutionContext::Task> task)
+void WorkerMessagingProxy::postTaskToLoader(PassRefPtr<ScriptExecutionContext::Task> task)
{
+ // FIXME: In case of nested workers, this should go directly to the root Document context.
+ ASSERT(m_scriptExecutionContext->isDocument());
m_scriptExecutionContext->postTask(task);
}
@@ -296,6 +293,7 @@ void WorkerMessagingProxy::workerContextDestroyedInternal()
{
// WorkerContextDestroyedTask is always the last to be performed, so the proxy is not needed for communication
// in either side any more. However, the Worker object may still exist, and it assumes that the proxy exists, too.
+ m_askedToTerminate = true;
m_workerThread = 0;
if (!m_workerObject)
delete this;
diff --git a/WebCore/workers/WorkerMessagingProxy.h b/WebCore/workers/WorkerMessagingProxy.h
index 8d81deb..7fc9797 100644
--- a/WebCore/workers/WorkerMessagingProxy.h
+++ b/WebCore/workers/WorkerMessagingProxy.h
@@ -31,6 +31,7 @@
#include "ScriptExecutionContext.h"
#include "WorkerContextProxy.h"
+#include "WorkerLoaderProxy.h"
#include "WorkerObjectProxy.h"
#include <wtf/Noncopyable.h>
#include <wtf/PassRefPtr.h>
@@ -44,7 +45,7 @@ namespace WebCore {
class Worker;
class WorkerThread;
- class WorkerMessagingProxy : public WorkerContextProxy, public WorkerObjectProxy, Noncopyable {
+ class WorkerMessagingProxy : public WorkerContextProxy, public WorkerObjectProxy, public WorkerLoaderProxy, Noncopyable {
public:
WorkerMessagingProxy(Worker*);
@@ -65,9 +66,11 @@ namespace WebCore {
virtual void reportPendingActivity(bool hasPendingActivity);
virtual void workerContextDestroyed();
- void postTaskToWorkerObject(PassRefPtr<ScriptExecutionContext::Task>);
- void postTaskToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>);
- void postTaskForModeToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>, const String& mode);
+ // Implementation of WorkerLoaderProxy.
+ // These methods are called on different threads to schedule loading
+ // requests and to send callbacks back to WorkerContext.
+ virtual void postTaskToLoader(PassRefPtr<ScriptExecutionContext::Task>);
+ virtual void postTaskForModeToWorkerContext(PassRefPtr<ScriptExecutionContext::Task>, const String& mode);
void workerThreadCreated(PassRefPtr<WorkerThread>);
diff --git a/WebCore/workers/WorkerThread.cpp b/WebCore/workers/WorkerThread.cpp
index d1026b1..0745226 100644
--- a/WebCore/workers/WorkerThread.cpp
+++ b/WebCore/workers/WorkerThread.cpp
@@ -62,13 +62,14 @@ WorkerThreadStartupData::WorkerThreadStartupData(const KURL& scriptURL, const St
{
}
-PassRefPtr<WorkerThread> WorkerThread::create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerObjectProxy* workerObjectProxy)
+PassRefPtr<WorkerThread> WorkerThread::create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy)
{
- return adoptRef(new WorkerThread(scriptURL, userAgent, sourceCode, workerObjectProxy));
+ return adoptRef(new WorkerThread(scriptURL, userAgent, sourceCode, workerLoaderProxy, workerObjectProxy));
}
-WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerObjectProxy* workerObjectProxy)
+WorkerThread::WorkerThread(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy& workerLoaderProxy, WorkerObjectProxy& workerObjectProxy)
: m_threadID(0)
+ , m_workerLoaderProxy(workerLoaderProxy)
, m_workerObjectProxy(workerObjectProxy)
, m_startupData(WorkerThreadStartupData::create(scriptURL, userAgent, sourceCode))
{
@@ -115,7 +116,7 @@ void* WorkerThread::workerThread()
// WorkerThread::~WorkerThread happens on a different thread where it was created.
m_startupData.clear();
- m_workerObjectProxy->reportPendingActivity(m_workerContext->hasPendingActivity());
+ m_workerObjectProxy.reportPendingActivity(m_workerContext->hasPendingActivity());
// Blocks until terminated.
m_runLoop.run(m_workerContext.get());
diff --git a/WebCore/workers/WorkerThread.h b/WebCore/workers/WorkerThread.h
index f1a8a52..8a1ce6c 100644
--- a/WebCore/workers/WorkerThread.h
+++ b/WebCore/workers/WorkerThread.h
@@ -39,12 +39,13 @@ namespace WebCore {
class KURL;
class String;
class WorkerContext;
+ class WorkerLoaderProxy;
class WorkerObjectProxy;
struct WorkerThreadStartupData;
class WorkerThread : public RefCounted<WorkerThread> {
public:
- static PassRefPtr<WorkerThread> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerObjectProxy*);
+ static PassRefPtr<WorkerThread> create(const KURL& scriptURL, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&);
~WorkerThread();
bool start();
@@ -52,17 +53,19 @@ namespace WebCore {
ThreadIdentifier threadID() const { return m_threadID; }
WorkerRunLoop& runLoop() { return m_runLoop; }
- WorkerObjectProxy* workerObjectProxy() const { return m_workerObjectProxy; }
+ WorkerLoaderProxy& workerLoaderProxy() const { return m_workerLoaderProxy; }
+ WorkerObjectProxy& workerObjectProxy() const { return m_workerObjectProxy; }
private:
- WorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerObjectProxy*);
+ WorkerThread(const KURL&, const String& userAgent, const String& sourceCode, WorkerLoaderProxy&, WorkerObjectProxy&);
static void* workerThreadStart(void*);
void* workerThread();
ThreadIdentifier m_threadID;
WorkerRunLoop m_runLoop;
- WorkerObjectProxy* m_workerObjectProxy;
+ WorkerLoaderProxy& m_workerLoaderProxy;
+ WorkerObjectProxy& m_workerObjectProxy;
RefPtr<WorkerContext> m_workerContext;
Mutex m_threadCreationMutex;