diff options
Diffstat (limited to 'chrome/common/chrome_plugin_lib.cc')
-rw-r--r-- | chrome/common/chrome_plugin_lib.cc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/chrome/common/chrome_plugin_lib.cc b/chrome/common/chrome_plugin_lib.cc index 642c623..d9848c9 100644 --- a/chrome/common/chrome_plugin_lib.cc +++ b/chrome/common/chrome_plugin_lib.cc @@ -25,7 +25,7 @@ const TCHAR ChromePluginLib::kRegistryChromePlugins[] = static const TCHAR kRegistryLoadOnStartup[] = _T("LoadOnStartup"); static const TCHAR kRegistryPath[] = _T("Path"); -typedef base::hash_map<std::wstring, scoped_refptr<ChromePluginLib> > +typedef base::hash_map<FilePath, scoped_refptr<ChromePluginLib> > PluginMap; // A map of all the instantiated plugins. @@ -43,7 +43,7 @@ static bool IsSingleProcessMode() { } // static -ChromePluginLib* ChromePluginLib::Create(const std::wstring& filename, +ChromePluginLib* ChromePluginLib::Create(const FilePath& filename, const CPBrowserFuncs* bfuncs) { // Keep a map of loaded plugins to ensure we only load each library once. if (!g_loaded_libs) { @@ -53,8 +53,13 @@ ChromePluginLib* ChromePluginLib::Create(const std::wstring& filename, } DCHECK(IsPluginThread()); - // Lower case to match how PluginList::LoadPlugin stores the path. - std::wstring filename_lc = StringToLowerASCII(filename); +#if defined(OS_WIN) + // Lower case to match how PluginLib::CreatePluginLib stores the path. See + // there for the rationale behind this. + FilePath filename_lc(StringToLowerASCII(filename.value())); +#else + FilePath filename_lc = filename; +#endif // OS_WIN PluginMap::const_iterator iter = g_loaded_libs->find(filename_lc); if (iter != g_loaded_libs->end()) @@ -69,7 +74,7 @@ ChromePluginLib* ChromePluginLib::Create(const std::wstring& filename, } // static -ChromePluginLib* ChromePluginLib::Find(const std::wstring& filename) { +ChromePluginLib* ChromePluginLib::Find(const FilePath& filename) { if (g_loaded_libs) { PluginMap::const_iterator iter = g_loaded_libs->find(filename); if (iter != g_loaded_libs->end()) @@ -79,7 +84,7 @@ ChromePluginLib* ChromePluginLib::Find(const std::wstring& filename) { } // static -void ChromePluginLib::Destroy(const std::wstring& filename) { +void ChromePluginLib::Destroy(const FilePath& filename) { DCHECK(g_loaded_libs); PluginMap::iterator iter = g_loaded_libs->find(filename); if (iter != g_loaded_libs->end()) { @@ -104,7 +109,7 @@ void ChromePluginLib::RegisterPluginsWithNPAPI() { if (IsSingleProcessMode()) return; - std::wstring path; + FilePath path; if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) return; // Note: we can only access the NPAPI list because the PluginService has done @@ -127,7 +132,7 @@ void ChromePluginLib::LoadChromePlugins(const CPBrowserFuncs* bfuncs) { if (IsSingleProcessMode()) return; - std::wstring path; + FilePath path; if (!PathService::Get(chrome::FILE_GEARS_PLUGIN, &path)) return; @@ -177,7 +182,7 @@ const CPPluginFuncs& ChromePluginLib::functions() const { return plugin_funcs_; } -ChromePluginLib::ChromePluginLib(const std::wstring& filename) +ChromePluginLib::ChromePluginLib(const FilePath& filename) : filename_(filename), module_(0), initialized_(false), @@ -229,7 +234,7 @@ int ChromePluginLib::CP_Test(void* param) { bool ChromePluginLib::Load() { DCHECK(module_ == 0); - module_ = LoadLibrary(filename_.c_str()); + module_ = LoadLibrary(filename_.value().c_str()); if (module_ == 0) return false; |