OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_COMMON_CHILD_PROCESS_H_ | 5 #ifndef CONTENT_COMMON_CHILD_PROCESS_H_ |
6 #define CONTENT_COMMON_CHILD_PROCESS_H_ | 6 #define CONTENT_COMMON_CHILD_PROCESS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 ChildProcess(); | 23 ChildProcess(); |
24 virtual ~ChildProcess(); | 24 virtual ~ChildProcess(); |
25 | 25 |
26 // May be NULL if the main thread hasn't been set explicitly. | 26 // May be NULL if the main thread hasn't been set explicitly. |
27 ChildThread* main_thread(); | 27 ChildThread* main_thread(); |
28 | 28 |
29 // Sets the object associated with the main thread of this process. | 29 // Sets the object associated with the main thread of this process. |
30 // Takes ownership of the pointer. | 30 // Takes ownership of the pointer. |
31 void set_main_thread(ChildThread* thread); | 31 void set_main_thread(ChildThread* thread); |
32 | 32 |
33 MessageLoop* io_message_loop() { return io_thread_.message_loop(); } | 33 base::MessageLoop* io_message_loop() { return io_thread_.message_loop(); } |
34 base::MessageLoopProxy* io_message_loop_proxy() { | 34 base::MessageLoopProxy* io_message_loop_proxy() { |
35 return io_thread_.message_loop_proxy(); | 35 return io_thread_.message_loop_proxy(); |
36 } | 36 } |
37 | 37 |
38 // A global event object that is signalled when the main thread's message | 38 // A global event object that is signalled when the main thread's message |
39 // loop exits. This gives background threads a way to observe the main | 39 // loop exits. This gives background threads a way to observe the main |
40 // thread shutting down. This can be useful when a background thread is | 40 // thread shutting down. This can be useful when a background thread is |
41 // waiting for some information from the browser process. If the browser | 41 // waiting for some information from the browser process. If the browser |
42 // process goes away prematurely, the background thread can at least notice | 42 // process goes away prematurely, the background thread can at least notice |
43 // the child processes's main thread exiting to determine that it should give | 43 // the child processes's main thread exiting to determine that it should give |
(...skipping 29 matching lines...) Expand all Loading... |
73 | 73 |
74 // The singleton instance for this process. | 74 // The singleton instance for this process. |
75 static ChildProcess* child_process_; | 75 static ChildProcess* child_process_; |
76 | 76 |
77 DISALLOW_COPY_AND_ASSIGN(ChildProcess); | 77 DISALLOW_COPY_AND_ASSIGN(ChildProcess); |
78 }; | 78 }; |
79 | 79 |
80 } // namespace content | 80 } // namespace content |
81 | 81 |
82 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ | 82 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ |
OLD | NEW |