| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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> | 7 #include <utility> |
| 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 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 | 358 |
| 359 void ChildProcessLauncher::Launch( | 359 void ChildProcessLauncher::Launch( |
| 360 SandboxedProcessLauncherDelegate* delegate, | 360 SandboxedProcessLauncherDelegate* delegate, |
| 361 base::CommandLine* cmd_line, | 361 base::CommandLine* cmd_line, |
| 362 int child_process_id) { | 362 int child_process_id) { |
| 363 DCHECK(CalledOnValidThread()); | 363 DCHECK(CalledOnValidThread()); |
| 364 | 364 |
| 365 #if defined(OS_ANDROID) | 365 #if defined(OS_ANDROID) |
| 366 // Android only supports renderer, sandboxed utility and gpu. | 366 // Android only supports renderer, sandboxed utility, download and gpu. |
| 367 std::string process_type = | 367 std::string process_type = |
| 368 cmd_line->GetSwitchValueASCII(switches::kProcessType); | 368 cmd_line->GetSwitchValueASCII(switches::kProcessType); |
| 369 CHECK(process_type == switches::kGpuProcess || | 369 CHECK(process_type == switches::kGpuProcess || |
| 370 process_type == switches::kRendererProcess || | 370 process_type == switches::kRendererProcess || |
| 371 process_type == switches::kDownloadProcess || |
| 371 #if defined(ENABLE_PLUGINS) | 372 #if defined(ENABLE_PLUGINS) |
| 372 process_type == switches::kPpapiPluginProcess || | 373 process_type == switches::kPpapiPluginProcess || |
| 373 #endif | 374 #endif |
| 374 process_type == switches::kUtilityProcess) | 375 process_type == switches::kUtilityProcess) |
| 375 << "Unsupported process type: " << process_type; | 376 << "Unsupported process type: " << process_type; |
| 376 | 377 |
| 377 // Non-sandboxed utility or renderer process are currently not supported. | 378 // Non-sandboxed utility or renderer process are currently not supported. |
| 378 DCHECK(process_type == switches::kGpuProcess || | 379 DCHECK(process_type == switches::kGpuProcess || |
| 379 !cmd_line->HasSwitch(switches::kNoSandbox)); | 380 !cmd_line->HasSwitch(switches::kNoSandbox)); |
| 380 | 381 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 } | 521 } |
| 521 | 522 |
| 522 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( | 523 ChildProcessLauncher::Client* ChildProcessLauncher::ReplaceClientForTest( |
| 523 Client* client) { | 524 Client* client) { |
| 524 Client* ret = client_; | 525 Client* ret = client_; |
| 525 client_ = client; | 526 client_ = client; |
| 526 return ret; | 527 return ret; |
| 527 } | 528 } |
| 528 | 529 |
| 529 } // namespace content | 530 } // namespace content |
| OLD | NEW |