| 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/ppapi_plugin_process_host.h" | 5 #include "content/browser/ppapi_plugin_process_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/base_switches.h" | 9 #include "base/base_switches.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 if (!plugin_launcher.empty()) | 310 if (!plugin_launcher.empty()) |
| 311 cmd_line->PrependWrapper(plugin_launcher); | 311 cmd_line->PrependWrapper(plugin_launcher); |
| 312 | 312 |
| 313 // On posix, never use the zygote for the broker. Also, only use the zygote if | 313 // On posix, never use the zygote for the broker. Also, only use the zygote if |
| 314 // the plugin is sandboxed, and we are not using a plugin launcher - having a | 314 // the plugin is sandboxed, and we are not using a plugin launcher - having a |
| 315 // plugin launcher means we need to use another process instead of just | 315 // plugin launcher means we need to use another process instead of just |
| 316 // forking the zygote. | 316 // forking the zygote. |
| 317 #if defined(OS_POSIX) | 317 #if defined(OS_POSIX) |
| 318 bool use_zygote = !is_broker_ && plugin_launcher.empty() && info.is_sandboxed; | 318 bool use_zygote = !is_broker_ && plugin_launcher.empty() && info.is_sandboxed; |
| 319 if (!info.is_sandboxed) | 319 if (!info.is_sandboxed) |
| 320 cmd_line->AppendSwitchASCII(switches::kNoSandbox, ""); | 320 cmd_line->AppendSwitchASCII(switches::kNoSandbox, std::string()); |
| 321 #endif // OS_POSIX | 321 #endif // OS_POSIX |
| 322 process_->Launch( | 322 process_->Launch( |
| 323 #if defined(OS_WIN) | 323 #if defined(OS_WIN) |
| 324 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_), | 324 new PpapiPluginSandboxedProcessLauncherDelegate(is_broker_), |
| 325 #elif defined(OS_POSIX) | 325 #elif defined(OS_POSIX) |
| 326 use_zygote, | 326 use_zygote, |
| 327 base::EnvironmentVector(), | 327 base::EnvironmentVector(), |
| 328 #endif | 328 #endif |
| 329 cmd_line); | 329 cmd_line); |
| 330 return true; | 330 return true; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 // sent_requests_ queue should be the one that the plugin just created. | 420 // sent_requests_ queue should be the one that the plugin just created. |
| 421 Client* client = sent_requests_.front(); | 421 Client* client = sent_requests_.front(); |
| 422 sent_requests_.pop(); | 422 sent_requests_.pop(); |
| 423 | 423 |
| 424 const ChildProcessData& data = process_->GetData(); | 424 const ChildProcessData& data = process_->GetData(); |
| 425 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), | 425 client->OnPpapiChannelOpened(channel_handle, base::GetProcId(data.handle), |
| 426 data.id); | 426 data.id); |
| 427 } | 427 } |
| 428 | 428 |
| 429 } // namespace content | 429 } // namespace content |
| OLD | NEW |