summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_plugin_util.cc6
-rw-r--r--chrome/common/pepper_plugin_registry.cc23
-rw-r--r--chrome/common/sandbox_init_wrapper_mac.cc4
-rw-r--r--chrome/common/sandbox_policy.cc4
4 files changed, 16 insertions, 21 deletions
diff --git a/chrome/common/chrome_plugin_util.cc b/chrome/common/chrome_plugin_util.cc
index 649975f..33b8345 100644
--- a/chrome/common/chrome_plugin_util.cc
+++ b/chrome/common/chrome_plugin_util.cc
@@ -141,11 +141,11 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url,
}
}
-#if defined(OS_CHROMEOS)
- FilePath profile = cmd.GetSwitchValuePath(switches::kLoginProfile);
+#if defined (OS_CHROMEOS)
+ std::wstring profile = cmd.GetSwitchValue(switches::kLoginProfile);
if (!profile.empty()) {
arguments_w += std::wstring(L"--") + ASCIIToWide(switches::kLoginProfile) +
- L"=\"" + profile.ToWStringHack() + L"\" ";
+ L"=\"" + profile + L"\" ";
}
#endif
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
index 7ce41d7..dcc8074 100644
--- a/chrome/common/pepper_plugin_registry.cc
+++ b/chrome/common/pepper_plugin_registry.cc
@@ -54,9 +54,8 @@ void PepperPluginRegistry::PreloadModules() {
// static
void PepperPluginRegistry::GetPluginInfoFromSwitch(
std::vector<PepperPluginInfo>* plugins) {
- const std::string value =
- CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
- switches::kRegisterPepperPlugins);
+ const std::wstring& value = CommandLine::ForCurrentProcess()->GetSwitchValue(
+ switches::kRegisterPepperPlugins);
if (value.empty())
return;
@@ -65,31 +64,27 @@ void PepperPluginRegistry::GetPluginInfoFromSwitch(
// plugin-entry = <file-path> + ["#" + <name> + ["#" + <description>]] +
// *1( LWS + ";" + LWS + <mime-type> )
- std::vector<std::string> modules;
+ std::vector<std::wstring> modules;
SplitString(value, ',', &modules);
for (size_t i = 0; i < modules.size(); ++i) {
- std::vector<std::string> parts;
+ std::vector<std::wstring> parts;
SplitString(modules[i], ';', &parts);
if (parts.size() < 2) {
DLOG(ERROR) << "Required mime-type not found";
continue;
}
- std::vector<std::string> name_parts;
+ std::vector<std::wstring> name_parts;
SplitString(parts[0], '#', &name_parts);
PepperPluginInfo plugin;
-#if defined(OS_WIN)
- plugin.path = FilePath(ASCIIToUTF16(name_parts[0]));
-#else
- plugin.path = FilePath(name_parts[0]);
-#endif
+ plugin.path = FilePath::FromWStringHack(name_parts[0]);
if (name_parts.size() > 1)
- plugin.name = name_parts[1];
+ plugin.name = WideToUTF8(name_parts[1]);
if (name_parts.size() > 2)
- plugin.type_descriptions = name_parts[2];
+ plugin.type_descriptions = WideToUTF8(name_parts[2]);
for (size_t j = 1; j < parts.size(); ++j)
- plugin.mime_types.push_back(parts[j]);
+ plugin.mime_types.push_back(WideToASCII(parts[j]));
plugins->push_back(plugin);
}
diff --git a/chrome/common/sandbox_init_wrapper_mac.cc b/chrome/common/sandbox_init_wrapper_mac.cc
index 79cf08f..1b8e2d9 100644
--- a/chrome/common/sandbox_init_wrapper_mac.cc
+++ b/chrome/common/sandbox_init_wrapper_mac.cc
@@ -41,8 +41,8 @@ bool SandboxInitWrapper::InitializeSandbox(const CommandLine& command_line,
} else if (process_type == switches::kUtilityProcess) {
// Utility process sandbox.
sandbox_process_type = sandbox::SANDBOX_TYPE_UTILITY;
- allowed_dir =
- command_line.GetSwitchValuePath(switches::kUtilityProcessAllowedDir);
+ allowed_dir = FilePath::FromWStringHack(
+ command_line.GetSwitchValue(switches::kUtilityProcessAllowedDir));
} else if (process_type == switches::kWorkerProcess) {
// Worker process sandbox.
sandbox_process_type = sandbox::SANDBOX_TYPE_WORKER;
diff --git a/chrome/common/sandbox_policy.cc b/chrome/common/sandbox_policy.cc
index b5b2404a..bef0478 100644
--- a/chrome/common/sandbox_policy.cc
+++ b/chrome/common/sandbox_policy.cc
@@ -341,9 +341,9 @@ bool ApplyPolicyForBuiltInFlashPlugin(sandbox::TargetPolicy* policy) {
bool AddPolicyForPlugin(const CommandLine* cmd_line,
sandbox::TargetPolicy* policy) {
std::wstring plugin_dll = cmd_line->
- GetSwitchValueNative(switches::kPluginPath);
+ GetSwitchValue(switches::kPluginPath);
std::wstring trusted_plugins = CommandLine::ForCurrentProcess()->
- GetSwitchValueNative(switches::kTrustedPlugins);
+ GetSwitchValue(switches::kTrustedPlugins);
// Add the policy for the pipes.
sandbox::ResultCode result = sandbox::SBOX_ALL_OK;
result = policy->AddRule(sandbox::TargetPolicy::SUBSYS_NAMED_PIPES,