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_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 namespace shell { | 34 namespace shell { |
35 class InterfaceProvider; | 35 class InterfaceProvider; |
36 } | 36 } |
37 | 37 |
38 namespace content { | 38 namespace content { |
39 | 39 |
40 class BrowserChildProcessHostIterator; | 40 class BrowserChildProcessHostIterator; |
41 class BrowserChildProcessObserver; | 41 class BrowserChildProcessObserver; |
42 class BrowserMessageFilter; | 42 class BrowserMessageFilter; |
43 class MojoChildConnection; | 43 class ChildConnection; |
44 | 44 |
45 // Plugins/workers and other child processes that live on the IO thread use this | 45 // Plugins/workers and other child processes that live on the IO thread use this |
46 // class. RenderProcessHostImpl is the main exception that doesn't use this | 46 // class. RenderProcessHostImpl is the main exception that doesn't use this |
47 /// class because it lives on the UI thread. | 47 /// class because it lives on the UI thread. |
48 class CONTENT_EXPORT BrowserChildProcessHostImpl | 48 class CONTENT_EXPORT BrowserChildProcessHostImpl |
49 : public BrowserChildProcessHost, | 49 : public BrowserChildProcessHost, |
50 public NON_EXPORTED_BASE(ChildProcessHostDelegate), | 50 public NON_EXPORTED_BASE(ChildProcessHostDelegate), |
51 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
52 public base::win::ObjectWatcher::Delegate, | 52 public base::win::ObjectWatcher::Delegate, |
53 #endif | 53 #endif |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // Callers can reduce the BrowserChildProcess' priority. | 101 // Callers can reduce the BrowserChildProcess' priority. |
102 void SetBackgrounded(bool backgrounded); | 102 void SetBackgrounded(bool backgrounded); |
103 | 103 |
104 // Adds an IPC message filter. | 104 // Adds an IPC message filter. |
105 void AddFilter(BrowserMessageFilter* filter); | 105 void AddFilter(BrowserMessageFilter* filter); |
106 | 106 |
107 static void HistogramBadMessageTerminated(int process_type); | 107 static void HistogramBadMessageTerminated(int process_type); |
108 | 108 |
109 BrowserChildProcessHostDelegate* delegate() const { return delegate_; } | 109 BrowserChildProcessHostDelegate* delegate() const { return delegate_; } |
110 | 110 |
111 MojoChildConnection* child_connection() const { | 111 ChildConnection* child_connection() const { |
112 return child_connection_.get(); | 112 return child_connection_.get(); |
113 } | 113 } |
114 | 114 |
115 typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; | 115 typedef std::list<BrowserChildProcessHostImpl*> BrowserChildProcessList; |
116 private: | 116 private: |
117 friend class BrowserChildProcessHostIterator; | 117 friend class BrowserChildProcessHostIterator; |
118 friend class BrowserChildProcessObserver; | 118 friend class BrowserChildProcessObserver; |
119 | 119 |
120 static BrowserChildProcessList* GetIterator(); | 120 static BrowserChildProcessList* GetIterator(); |
121 | 121 |
(...skipping 24 matching lines...) Expand all Loading... |
146 #if defined(OS_WIN) | 146 #if defined(OS_WIN) |
147 // ObjectWatcher::Delegate implementation. | 147 // ObjectWatcher::Delegate implementation. |
148 void OnObjectSignaled(HANDLE object) override; | 148 void OnObjectSignaled(HANDLE object) override; |
149 #endif | 149 #endif |
150 | 150 |
151 ChildProcessData data_; | 151 ChildProcessData data_; |
152 BrowserChildProcessHostDelegate* delegate_; | 152 BrowserChildProcessHostDelegate* delegate_; |
153 std::unique_ptr<ChildProcessHost> child_process_host_; | 153 std::unique_ptr<ChildProcessHost> child_process_host_; |
154 | 154 |
155 const std::string child_token_; | 155 const std::string child_token_; |
156 std::unique_ptr<MojoChildConnection> child_connection_; | 156 std::unique_ptr<ChildConnection> child_connection_; |
157 | 157 |
158 std::unique_ptr<ChildProcessLauncher> child_process_; | 158 std::unique_ptr<ChildProcessLauncher> child_process_; |
159 | 159 |
160 PowerMonitorMessageBroadcaster power_monitor_message_broadcaster_; | 160 PowerMonitorMessageBroadcaster power_monitor_message_broadcaster_; |
161 | 161 |
162 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
163 // Watches to see if the child process exits before the IPC channel has | 163 // Watches to see if the child process exits before the IPC channel has |
164 // been connected. Thereafter, its exit is determined by an error on the | 164 // been connected. Thereafter, its exit is determined by an error on the |
165 // IPC channel. | 165 // IPC channel. |
166 base::win::ObjectWatcher early_exit_watcher_; | 166 base::win::ObjectWatcher early_exit_watcher_; |
167 #endif | 167 #endif |
168 | 168 |
169 // The memory allocator, if any, in which the process will write its metrics. | 169 // The memory allocator, if any, in which the process will write its metrics. |
170 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; | 170 std::unique_ptr<base::SharedPersistentMemoryAllocator> metrics_allocator_; |
171 | 171 |
172 bool is_channel_connected_; | 172 bool is_channel_connected_; |
173 bool notify_child_disconnected_; | 173 bool notify_child_disconnected_; |
174 | 174 |
175 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; | 175 base::WeakPtrFactory<BrowserChildProcessHostImpl> weak_factory_; |
176 }; | 176 }; |
177 | 177 |
178 } // namespace content | 178 } // namespace content |
179 | 179 |
180 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ | 180 #endif // CONTENT_BROWSER_BROWSER_CHILD_PROCESS_HOST_IMPL_H_ |
OLD | NEW |