Chromium Code Reviews| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 if (!is_broker_) { | 235 if (!is_broker_) { |
| 236 // TODO(vtl): Stop passing flash args in the command line, on windows is | 236 // TODO(vtl): Stop passing flash args in the command line, on windows is |
| 237 // going to explode. | 237 // going to explode. |
| 238 static const char* kPluginForwardSwitches[] = { | 238 static const char* kPluginForwardSwitches[] = { |
| 239 switches::kDisableSeccompFilterSandbox, | 239 switches::kDisableSeccompFilterSandbox, |
| 240 #if defined(OS_MACOSX) | 240 #if defined(OS_MACOSX) |
| 241 switches::kEnableSandboxLogging, | 241 switches::kEnableSandboxLogging, |
| 242 #endif | 242 #endif |
| 243 switches::kNoSandbox, | 243 switches::kNoSandbox, |
| 244 switches::kPpapiFlashArgs, | 244 switches::kPpapiFlashArgs, |
| 245 switches::kPpapiStartupDialog, | 245 switches::kPpapiStartupDialog |
| 246 }; | 246 }; |
| 247 cmd_line->CopySwitchesFrom(browser_command_line, kPluginForwardSwitches, | 247 cmd_line->CopySwitchesFrom(browser_command_line, kPluginForwardSwitches, |
| 248 arraysize(kPluginForwardSwitches)); | 248 arraysize(kPluginForwardSwitches)); |
| 249 } | 249 } |
| 250 | 250 |
| 251 std::string locale = | 251 std::string locale = |
| 252 content::GetContentClient()->browser()->GetApplicationLocale(); | 252 content::GetContentClient()->browser()->GetApplicationLocale(); |
| 253 if (!locale.empty()) { | 253 if (!locale.empty()) { |
| 254 // Pass on the locale so the plugin will know what language we're using. | 254 // Pass on the locale so the plugin will know what language we're using. |
| 255 cmd_line->AppendSwitchASCII(switches::kLang, locale); | 255 cmd_line->AppendSwitchASCII(switches::kLang, locale); |
| 256 } | 256 } |
| 257 | 257 |
| 258 if (!plugin_launcher.empty()) | 258 if (!plugin_launcher.empty()) |
| 259 cmd_line->PrependWrapper(plugin_launcher); | 259 cmd_line->PrependWrapper(plugin_launcher); |
| 260 | 260 |
| 261 base::EnvironmentVector env; | |
|
Yaron
2012/10/09 21:38:53
I think we can just drop this. We don't use plugin
Yusuf
2012/10/10 00:06:08
Done.
| |
| 262 #if defined(OS_ANDROID) | |
| 263 BrowserChildProcessHostImpl::AppendCommonChildCommandLine(cmd_line); | |
| 264 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 265 switches::kPpapiStartupDialog)) { | |
| 266 cmd_line->AppendSwitch(switches::kPpapiStartupDialog); | |
| 267 } | |
| 268 #endif | |
| 269 | |
| 261 // On posix, never use the zygote for the broker. Also, only use the zygote if | 270 // On posix, never use the zygote for the broker. Also, only use the zygote if |
| 262 // the plugin is sandboxed, and we are not using a plugin launcher - having a | 271 // the plugin is sandboxed, and we are not using a plugin launcher - having a |
| 263 // plugin launcher means we need to use another process instead of just | 272 // plugin launcher means we need to use another process instead of just |
| 264 // forking the zygote. | 273 // forking the zygote. |
| 265 #if defined(OS_POSIX) | 274 #if defined(OS_POSIX) |
| 266 bool use_zygote = !is_broker_ && plugin_launcher.empty() && info.is_sandboxed; | 275 bool use_zygote = !is_broker_ && plugin_launcher.empty() && info.is_sandboxed; |
| 267 if (!info.is_sandboxed) | 276 if (!info.is_sandboxed) |
| 268 cmd_line->AppendSwitchASCII(switches::kNoSandbox, ""); | 277 cmd_line->AppendSwitchASCII(switches::kNoSandbox, ""); |
| 269 #endif // OS_POSIX | 278 #endif // OS_POSIX |
| 270 process_->Launch( | 279 process_->Launch( |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 359 if (sent_requests_.empty()) | 368 if (sent_requests_.empty()) |
| 360 return; | 369 return; |
| 361 | 370 |
| 362 // All requests should be processed FIFO, so the next item in the | 371 // All requests should be processed FIFO, so the next item in the |
| 363 // sent_requests_ queue should be the one that the plugin just created. | 372 // sent_requests_ queue should be the one that the plugin just created. |
| 364 Client* client = sent_requests_.front(); | 373 Client* client = sent_requests_.front(); |
| 365 sent_requests_.pop(); | 374 sent_requests_.pop(); |
| 366 | 375 |
| 367 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); | 376 client->OnPpapiChannelOpened(channel_handle, process_->GetData().id); |
| 368 } | 377 } |
| OLD | NEW |