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_COMMON_CHILD_THREAD_H_ | 5 #ifndef CHROME_COMMON_CHILD_THREAD_H_ |
6 #define CHROME_COMMON_CHILD_THREAD_H_ | 6 #define CHROME_COMMON_CHILD_THREAD_H_ |
7 | 7 |
8 #include "base/thread.h" | 8 #include "base/thread.h" |
9 #include "chrome/common/ipc_sync_channel.h" | 9 #include "chrome/common/ipc_sync_channel.h" |
10 #include "chrome/common/message_router.h" | 10 #include "chrome/common/message_router.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 protected: | 30 protected: |
31 friend class ChildProcess; | 31 friend class ChildProcess; |
32 | 32 |
33 // Starts the thread. | 33 // Starts the thread. |
34 bool Run(); | 34 bool Run(); |
35 | 35 |
36 // Overrides the channel name. Used for --single-process mode. | 36 // Overrides the channel name. Used for --single-process mode. |
37 void SetChannelName(const std::wstring& name) { channel_name_ = name; } | 37 void SetChannelName(const std::wstring& name) { channel_name_ = name; } |
38 | 38 |
39 protected: | 39 protected: |
| 40 // The required stack size if V8 runs on a thread. |
| 41 static const size_t kV8StackSize; |
| 42 |
40 virtual void OnControlMessageReceived(const IPC::Message& msg) { } | 43 virtual void OnControlMessageReceived(const IPC::Message& msg) { } |
41 | 44 |
42 // Returns the one child thread. | 45 // Returns the one child thread. |
43 static ChildThread* current(); | 46 static ChildThread* current(); |
44 | 47 |
45 IPC::SyncChannel* channel() { return channel_.get(); } | 48 IPC::SyncChannel* channel() { return channel_.get(); } |
46 | 49 |
47 // Thread implementation. | 50 // Thread implementation. |
48 virtual void Init(); | 51 virtual void Init(); |
49 virtual void CleanUp(); | 52 virtual void CleanUp(); |
(...skipping 12 matching lines...) Expand all Loading... |
62 // Used only on the background render thread to implement message routing | 65 // Used only on the background render thread to implement message routing |
63 // functionality to the consumers of the ChildThread. | 66 // functionality to the consumers of the ChildThread. |
64 MessageRouter router_; | 67 MessageRouter router_; |
65 | 68 |
66 Thread::Options options_; | 69 Thread::Options options_; |
67 | 70 |
68 DISALLOW_EVIL_CONSTRUCTORS(ChildThread); | 71 DISALLOW_EVIL_CONSTRUCTORS(ChildThread); |
69 }; | 72 }; |
70 | 73 |
71 #endif // CHROME_COMMON_CHILD_THREAD_H_ | 74 #endif // CHROME_COMMON_CHILD_THREAD_H_ |
OLD | NEW |