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 #include "content/browser/child_process_launcher.h" | 5 #include "content/browser/child_process_launcher.h" |
6 | 6 |
7 #include <utility> // For std::pair. | 7 #include <utility> // For std::pair. |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
177 base::CommandLine* cmd_line, | 177 base::CommandLine* cmd_line, |
178 int child_process_id, | 178 int child_process_id, |
179 Client* client) { | 179 Client* client) { |
180 CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_)); | 180 CHECK(BrowserThread::GetCurrentThreadIdentifier(&client_thread_id_)); |
181 client_ = client; | 181 client_ = client; |
182 | 182 |
183 #if defined(OS_ANDROID) | 183 #if defined(OS_ANDROID) |
184 // We currently only support renderer and gpu child processes. | 184 // We currently only support renderer and gpu child processes. |
185 std::string process_type = | 185 std::string process_type = |
186 cmd_line->GetSwitchValueASCII(switches::kProcessType); | 186 cmd_line->GetSwitchValueASCII(switches::kProcessType); |
187 CHECK_NE(switches::kPluginProcess, process_type); | |
188 CHECK_NE(switches::kPpapiBrokerProcess, process_type); | |
189 CHECK_NE(switches::kPpapiPluginProcess, process_type); | |
190 CHECK_NE(switches::kSandboxIPCProcess, process_type); | |
191 CHECK_NE(switches::kUtilityProcess, process_type); | |
192 CHECK_NE(switches::kZygoteProcess, process_type); | |
Feng Qian
2014/12/12 18:29:42
Should we log the unknown process type on Java-sid
no sievers
2014/12/12 18:50:44
If we want to log we can do that here as well, i.e
Feng Qian
2014/12/12 19:07:31
Sounds good to me, can you add the process type to
| |
193 CHECK(process_type == switches::kGpuProcess || | 187 CHECK(process_type == switches::kGpuProcess || |
194 process_type == switches::kRendererProcess); | 188 process_type == switches::kRendererProcess); |
195 | 189 |
196 // We need to close the client end of the IPC channel to reliably detect | 190 // We need to close the client end of the IPC channel to reliably detect |
197 // child termination. We will close this fd after we create the child | 191 // child termination. We will close this fd after we create the child |
198 // process which is asynchronous on Android. | 192 // process which is asynchronous on Android. |
199 ipcfd_.reset(delegate->TakeIpcFd().release()); | 193 ipcfd_.reset(delegate->TakeIpcFd().release()); |
200 #endif | 194 #endif |
201 BrowserThread::PostTask( | 195 BrowserThread::PostTask( |
202 BrowserThread::PROCESS_LAUNCHER, FROM_HERE, | 196 BrowserThread::PROCESS_LAUNCHER, FROM_HERE, |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
606 context_->SetProcessBackgrounded(background); | 600 context_->SetProcessBackgrounded(background); |
607 } | 601 } |
608 | 602 |
609 void ChildProcessLauncher::SetTerminateChildOnShutdown( | 603 void ChildProcessLauncher::SetTerminateChildOnShutdown( |
610 bool terminate_on_shutdown) { | 604 bool terminate_on_shutdown) { |
611 if (context_.get()) | 605 if (context_.get()) |
612 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); | 606 context_->set_terminate_child_on_shutdown(terminate_on_shutdown); |
613 } | 607 } |
614 | 608 |
615 } // namespace content | 609 } // namespace content |
OLD | NEW |