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" |
11 #include "base/threading/thread.h" | 11 #include "base/threading/thread.h" |
12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 13 #include "content/common/content_export.h" |
13 | 14 |
14 class ChildThread; | 15 class ChildThread; |
15 | 16 |
16 // Base class for child processes of the browser process (i.e. renderer and | 17 // Base class for child processes of the browser process (i.e. renderer and |
17 // plugin host). This is a singleton object for each child process. | 18 // plugin host). This is a singleton object for each child process. |
18 class ChildProcess { | 19 class CONTENT_EXPORT ChildProcess { |
19 public: | 20 public: |
20 // Child processes should have an object that derives from this class. | 21 // Child processes should have an object that derives from this class. |
21 // Normally you would immediately call set_main_thread after construction. | 22 // Normally you would immediately call set_main_thread after construction. |
22 ChildProcess(); | 23 ChildProcess(); |
23 virtual ~ChildProcess(); | 24 virtual ~ChildProcess(); |
24 | 25 |
25 // 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. |
26 ChildThread* main_thread(); | 27 ChildThread* main_thread(); |
27 | 28 |
28 // Sets the object associated with the main thread of this process. | 29 // Sets the object associated with the main thread of this process. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 // io_thread_. | 71 // io_thread_. |
71 scoped_ptr<ChildThread> main_thread_; | 72 scoped_ptr<ChildThread> main_thread_; |
72 | 73 |
73 // The singleton instance for this process. | 74 // The singleton instance for this process. |
74 static ChildProcess* child_process_; | 75 static ChildProcess* child_process_; |
75 | 76 |
76 DISALLOW_COPY_AND_ASSIGN(ChildProcess); | 77 DISALLOW_COPY_AND_ASSIGN(ChildProcess); |
77 }; | 78 }; |
78 | 79 |
79 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ | 80 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ |
OLD | NEW |