Index: chrome/browser/worker_service.h |
=================================================================== |
--- chrome/browser/worker_service.h (revision 0) |
+++ chrome/browser/worker_service.h (revision 0) |
@@ -0,0 +1,47 @@ |
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_WORKER_SERVICE_H_ |
+#define CHROME_BROWSER_WORKER_SERVICE_H_ |
+ |
+#include <list> |
+ |
+#include "base/basictypes.h" |
+#include "base/hash_tables.h" |
+#include "base/singleton.h" |
+#include "googleurl/src/gurl.h" |
+ |
+namespace IPC { |
+class Message; |
+} |
+ |
+class MessageLoop; |
+class WorkerProcessHost; |
+class ResourceMessageFilter; |
+ |
+// This can be called on the main thread and IO thread. However it must |
+// be created on the main thread. |
+class WorkerService { |
+ public: |
+ // Returns the WorkerService singleton. |
+ static WorkerService* GetInstance(); |
+ |
+ // Creates a dedicated worker, returning the route id to talk to it. Returns |
+ // MSG_ROUTING_NONE if the worker couldn't be created. |
+ int CreateDedicatedWorker(const GURL &url); |
+ |
+ void ForwardMessage(const IPC::Message& message); |
+ |
+ private: |
+ friend DefaultSingletonTraits<WorkerService>; |
+ |
+ WorkerService(); |
+ ~WorkerService(); |
+ |
+ int next_route_id_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(WorkerService); |
+}; |
+ |
+#endif // CHROME_BROWSER_WORKER_SERVICE_H_ |