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 "base/thread.h" |
9 #include "chrome/common/child_thread.h" | 9 #include "chrome/common/child_thread.h" |
10 | 10 |
11 class GURL; | 11 class GURL; |
12 class WorkerWebKitClientImpl; | 12 class WorkerWebKitClientImpl; |
13 | 13 |
14 class WorkerThread : public ChildThread { | 14 class WorkerThread : public ChildThread { |
15 public: | 15 public: |
16 WorkerThread(); | 16 WorkerThread(); |
17 ~WorkerThread(); | 17 ~WorkerThread(); |
18 | 18 |
19 // Returns the one worker thread. | 19 // Returns the one worker thread. |
20 static WorkerThread* current() { | 20 static WorkerThread* current(); |
21 return static_cast<WorkerThread*>(ChildThread::current()); | |
22 } | |
23 | 21 |
24 private: | 22 private: |
25 virtual void OnControlMessageReceived(const IPC::Message& msg); | 23 virtual void OnControlMessageReceived(const IPC::Message& msg); |
26 | 24 |
27 // Called by the thread base class | 25 // Called by the thread base class |
28 virtual void Init(); | 26 virtual void Init(); |
29 virtual void CleanUp(); | 27 virtual void CleanUp(); |
30 | 28 |
31 void OnCreateWorker(const GURL& url, int route_id); | 29 void OnCreateWorker(const GURL& url, int route_id); |
32 | 30 |
33 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; | 31 scoped_ptr<WorkerWebKitClientImpl> webkit_client_; |
34 | 32 |
35 DISALLOW_COPY_AND_ASSIGN(WorkerThread); | 33 DISALLOW_COPY_AND_ASSIGN(WorkerThread); |
36 }; | 34 }; |
37 | 35 |
38 #endif // CHROME_WORKER_WORKER_THREAD_H_ | 36 #endif // CHROME_WORKER_WORKER_THREAD_H_ |
OLD | NEW |