OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_WORKER_SERVICE_H_ |
| 6 #define CHROME_BROWSER_WORKER_SERVICE_H_ |
| 7 |
| 8 #include <list> |
| 9 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/hash_tables.h" |
| 12 #include "base/singleton.h" |
| 13 #include "googleurl/src/gurl.h" |
| 14 |
| 15 namespace IPC { |
| 16 class Message; |
| 17 } |
| 18 |
| 19 class MessageLoop; |
| 20 class WorkerProcessHost; |
| 21 class ResourceMessageFilter; |
| 22 |
| 23 // This can be called on the main thread and IO thread. However it must |
| 24 // be created on the main thread. |
| 25 class WorkerService { |
| 26 public: |
| 27 // Returns the WorkerService singleton. |
| 28 static WorkerService* GetInstance(); |
| 29 |
| 30 // Creates a dedicated worker, returning the route id to talk to it. Returns |
| 31 // MSG_ROUTING_NONE if the worker couldn't be created. |
| 32 int CreateDedicatedWorker(const GURL &url); |
| 33 |
| 34 void ForwardMessage(const IPC::Message& message); |
| 35 |
| 36 private: |
| 37 friend DefaultSingletonTraits<WorkerService>; |
| 38 |
| 39 WorkerService(); |
| 40 ~WorkerService(); |
| 41 |
| 42 int next_route_id_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(WorkerService); |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_WORKER_SERVICE_H_ |
OLD | NEW |