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