2009-06-16 Jian Li <jianli@chromium.org>
[WebKit-https.git] / WebCore / workers / WorkerMessagingProxy.h
index 8d81deb..7fc9797 100644 (file)
@@ -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>);