Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2136)

Unified Diff: chrome/browser/plugin_process_host.cc

Issue 3012021: CommandLine: add a CopySwitchesFrom() for copying from another CommandLine (Closed)
Patch Set: minor cleanups Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/chrome_url_request_context_unittest.cc ('k') | chrome/browser/pref_service_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_process_host.cc
diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc
index 7c2aeb0364dcac71a61ffbf1ca317435cf06b153..d6380ccbcc97baae627733d027c285d54a300f4d 100644
--- a/chrome/browser/plugin_process_host.cc
+++ b/chrome/browser/plugin_process_host.cc
@@ -363,15 +363,14 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
// in process listings using native process management tools.
cmd_line->AppendSwitchWithValue(switches::kProcessType,
switches::kPluginProcess);
- cmd_line->AppendSwitchWithValue(switches::kPluginPath,
- info.path.ToWStringHack());
+ cmd_line->AppendSwitchPath(switches::kPluginPath, info.path);
if (logging::DialogsAreSuppressed())
cmd_line->AppendSwitch(switches::kNoErrorDialogs);
// Propagate the following switches to the plugin command line (along with
// any associated values) if present in the browser command line
- static const char* const switch_names[] = {
+ static const char* const kSwitchNames[] = {
switches::kPluginStartupDialog,
switches::kNoSandbox,
switches::kSafePlugins,
@@ -396,13 +395,8 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
#endif
};
- for (size_t i = 0; i < arraysize(switch_names); ++i) {
- if (browser_command_line.HasSwitch(switch_names[i])) {
- cmd_line->AppendSwitchWithValue(
- switch_names[i],
- browser_command_line.GetSwitchValueASCII(switch_names[i]));
- }
- }
+ cmd_line->CopySwitchesFrom(browser_command_line, kSwitchNames,
+ arraysize(kSwitchNames));
// If specified, prepend a launcher program to the command line.
if (!plugin_launcher.empty())
@@ -415,13 +409,12 @@ bool PluginProcessHost::Init(const WebPluginInfo& info,
}
// Gears requires the data dir to be available on startup.
- std::wstring data_dir =
- PluginService::GetInstance()->GetChromePluginDataDir().ToWStringHack();
+ FilePath data_dir =
+ PluginService::GetInstance()->GetChromePluginDataDir();
DCHECK(!data_dir.empty());
- cmd_line->AppendSwitchWithValue(switches::kPluginDataDir, data_dir);
+ cmd_line->AppendSwitchPath(switches::kPluginDataDir, data_dir);
- cmd_line->AppendSwitchWithValue(switches::kProcessChannelID,
- ASCIIToWide(channel_id()));
+ cmd_line->AppendSwitchWithValue(switches::kProcessChannelID, channel_id());
SetCrashReporterCommandLine(cmd_line);
« no previous file with comments | « chrome/browser/net/chrome_url_request_context_unittest.cc ('k') | chrome/browser/pref_service_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698