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

Unified Diff: chrome/common/pepper_plugin_registry.cc

Issue 3057033: Remove GetSwitchValue() from chrome/* where easy. (Closed)
Patch Set: finally Created 10 years, 4 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
Index: chrome/common/pepper_plugin_registry.cc
diff --git a/chrome/common/pepper_plugin_registry.cc b/chrome/common/pepper_plugin_registry.cc
index 0a39bc24f4285cf316534dab767d7f874a605432..7caf9c9403bcc9cc3e41b20258230d545872f060 100644
--- a/chrome/common/pepper_plugin_registry.cc
+++ b/chrome/common/pepper_plugin_registry.cc
@@ -54,8 +54,9 @@ void PepperPluginRegistry::PreloadModules() {
// static
void PepperPluginRegistry::GetPluginInfoFromSwitch(
std::vector<PepperPluginInfo>* plugins) {
- const std::wstring& value = CommandLine::ForCurrentProcess()->GetSwitchValue(
- switches::kRegisterPepperPlugins);
+ const std::string value =
+ CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
+ switches::kRegisterPepperPlugins);
if (value.empty())
return;
@@ -64,27 +65,34 @@ void PepperPluginRegistry::GetPluginInfoFromSwitch(
// plugin-entry = <file-path> + ["#" + <name> + ["#" + <description>]] +
// *1( LWS + ";" + LWS + <mime-type> )
- std::vector<std::wstring> modules;
+ std::vector<std::string> modules;
SplitString(value, ',', &modules);
for (size_t i = 0; i < modules.size(); ++i) {
- std::vector<std::wstring> parts;
+ std::vector<std::string> parts;
SplitString(modules[i], ';', &parts);
if (parts.size() < 2) {
DLOG(ERROR) << "Required mime-type not found";
continue;
}
- std::vector<std::wstring> name_parts;
+ std::vector<std::string> name_parts;
SplitString(parts[0], '#', &name_parts);
PepperPluginInfo plugin;
- plugin.path = FilePath::FromWStringHack(name_parts[0]);
+#if defined(OS_WIN)
+ // This means we can't provide plugins from non-ASCII paths, but
+ // since this switch is only for development I don't think that's
+ // too awful.
+ plugin.path = FilePath(ASCIIToUTF16(name_parts[0]));
+#else
+ plugin.path = FilePath(name_parts[0]);
+#endif
if (name_parts.size() > 1)
- plugin.name = WideToUTF8(name_parts[1]);
+ plugin.name = name_parts[1];
if (name_parts.size() > 2)
- plugin.type_descriptions = WideToUTF8(name_parts[2]);
+ plugin.type_descriptions = name_parts[2];
for (size_t j = 1; j < parts.size(); ++j)
- plugin.mime_types.push_back(WideToASCII(parts[j]));
+ plugin.mime_types.push_back(parts[j]);
plugins->push_back(plugin);
}

Powered by Google App Engine
This is Rietveld 408576698