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" |
11 #include "base/synchronization/waitable_event.h" | 11 #include "base/synchronization/waitable_event.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 | 13 |
| 14 namespace base { |
| 15 class StatisticsRecorder; |
| 16 } |
| 17 |
14 class ChildThread; | 18 class ChildThread; |
15 | 19 |
16 // Base class for child processes of the browser process (i.e. renderer and | 20 // 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. | 21 // plugin host). This is a singleton object for each child process. |
18 class CONTENT_EXPORT ChildProcess { | 22 class CONTENT_EXPORT ChildProcess { |
19 public: | 23 public: |
20 // Child processes should have an object that derives from this class. | 24 // Child processes should have an object that derives from this class. |
21 // Normally you would immediately call set_main_thread after construction. | 25 // Normally you would immediately call set_main_thread after construction. |
22 ChildProcess(); | 26 ChildProcess(); |
23 virtual ~ChildProcess(); | 27 virtual ~ChildProcess(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 base::WaitableEvent shutdown_event_; | 67 base::WaitableEvent shutdown_event_; |
64 | 68 |
65 // The thread that handles IO events. | 69 // The thread that handles IO events. |
66 base::Thread io_thread_; | 70 base::Thread io_thread_; |
67 | 71 |
68 // NOTE: make sure that main_thread_ is listed after shutdown_event_, since | 72 // NOTE: make sure that main_thread_ is listed after shutdown_event_, since |
69 // it depends on it (indirectly through IPC::SyncChannel). Same for | 73 // it depends on it (indirectly through IPC::SyncChannel). Same for |
70 // io_thread_. | 74 // io_thread_. |
71 scoped_ptr<ChildThread> main_thread_; | 75 scoped_ptr<ChildThread> main_thread_; |
72 | 76 |
| 77 // |statistics_recorder_| holds all histograms in the child process. |
| 78 scoped_ptr<base::StatisticsRecorder> statistics_recorder_; |
| 79 |
73 // The singleton instance for this process. | 80 // The singleton instance for this process. |
74 static ChildProcess* child_process_; | 81 static ChildProcess* child_process_; |
75 | 82 |
76 DISALLOW_COPY_AND_ASSIGN(ChildProcess); | 83 DISALLOW_COPY_AND_ASSIGN(ChildProcess); |
77 }; | 84 }; |
78 | 85 |
79 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ | 86 #endif // CONTENT_COMMON_CHILD_PROCESS_H_ |
OLD | NEW |