OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_WORKER_WORKER_THREAD_H_ | 5 #ifndef CHROME_WORKER_WORKER_THREAD_H_ |
6 #define CHROME_WORKER_WORKER_THREAD_H_ | 6 #define CHROME_WORKER_WORKER_THREAD_H_ |
7 | 7 |
| 8 #include "base/thread.h" |
8 #include "chrome/common/child_thread.h" | 9 #include "chrome/common/child_thread.h" |
9 | 10 |
10 class GURL; | 11 class GURL; |
11 class WorkerWebKitClientImpl; | 12 class WorkerWebKitClientImpl; |
12 | 13 |
13 class WorkerThread : public ChildThread { | 14 class WorkerThread : public ChildThread { |
14 public: | 15 public: |
15 WorkerThread(); | 16 WorkerThread(); |
16 ~WorkerThread(); | 17 ~WorkerThread(); |
17 | 18 |
18 // Returns the one worker thread. | 19 // Returns the one worker thread. |
19 static WorkerThread* current(); | 20 static WorkerThread* current(); |
20 | 21 |
21 private: | 22 private: |
22 virtual void OnControlMessageReceived(const IPC::Message& msg); | 23 virtual void OnControlMessageReceived(const IPC::Message& msg); |
23 | 24 |
| 25 // Called by the thread base class |
| 26 virtual void Init(); |
| 27 virtual void CleanUp(); |
| 28 |
24 void OnCreateWorker(const GURL& url, int route_id); | 29 void OnCreateWorker(const GURL& url, int route_id); |
25 | 30 |
26 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; | 31 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; |
27 | 32 |
28 DISALLOW_COPY_AND_ASSIGN(WorkerThread); | 33 DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
29 }; | 34 }; |
30 | 35 |
31 #endif // CHROME_WORKER_WORKER_THREAD_H_ | 36 #endif // CHROME_WORKER_WORKER_THREAD_H_ |
OLD | NEW |