OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/browser_child_process_host.h" | 5 #include "chrome/browser/browser_child_process_host.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 exposed_dir, | 110 exposed_dir, |
111 #elif defined(OS_POSIX) | 111 #elif defined(OS_POSIX) |
112 use_zygote, | 112 use_zygote, |
113 environ, | 113 environ, |
114 channel()->GetClientFileDescriptor(), | 114 channel()->GetClientFileDescriptor(), |
115 #endif | 115 #endif |
116 cmd_line, | 116 cmd_line, |
117 &client_)); | 117 &client_)); |
118 } | 118 } |
119 | 119 |
| 120 base::ProcessHandle BrowserChildProcessHost::GetChildProcessHandle() const { |
| 121 DCHECK(child_process_.get()) |
| 122 << "Requesting a child process handle before launching."; |
| 123 DCHECK(child_process_->GetHandle()) |
| 124 << "Requesting a child process handle before launch has completed OK."; |
| 125 return child_process_->GetHandle(); |
| 126 } |
| 127 |
120 bool BrowserChildProcessHost::Send(IPC::Message* msg) { | 128 bool BrowserChildProcessHost::Send(IPC::Message* msg) { |
121 return SendOnChannel(msg); | 129 return SendOnChannel(msg); |
122 } | 130 } |
123 | 131 |
124 void BrowserChildProcessHost::ForceShutdown() { | 132 void BrowserChildProcessHost::ForceShutdown() { |
125 Singleton<ChildProcessList>::get()->remove(this); | 133 Singleton<ChildProcessList>::get()->remove(this); |
126 ChildProcessHost::ForceShutdown(); | 134 ChildProcessHost::ForceShutdown(); |
127 } | 135 } |
128 | 136 |
129 void BrowserChildProcessHost::Notify(NotificationType type) { | 137 void BrowserChildProcessHost::Notify(NotificationType type) { |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 216 |
209 return *iterator_; | 217 return *iterator_; |
210 } while (true); | 218 } while (true); |
211 | 219 |
212 return NULL; | 220 return NULL; |
213 } | 221 } |
214 | 222 |
215 bool BrowserChildProcessHost::Iterator::Done() { | 223 bool BrowserChildProcessHost::Iterator::Done() { |
216 return iterator_ == Singleton<ChildProcessList>::get()->end(); | 224 return iterator_ == Singleton<ChildProcessList>::get()->end(); |
217 } | 225 } |
OLD | NEW |