| 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 "chrome/browser/plugins/plugin_finder.h" | 5 #include "chrome/browser/plugins/plugin_finder.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 } | 218 } |
| 219 | 219 |
| 220 bool PluginFinder::FindPluginWithIdentifier( | 220 bool PluginFinder::FindPluginWithIdentifier( |
| 221 const std::string& identifier, | 221 const std::string& identifier, |
| 222 PluginInstaller** installer, | 222 PluginInstaller** installer, |
| 223 scoped_ptr<PluginMetadata>* plugin_metadata) { | 223 scoped_ptr<PluginMetadata>* plugin_metadata) { |
| 224 base::AutoLock lock(mutex_); | 224 base::AutoLock lock(mutex_); |
| 225 std::map<std::string, PluginInstaller*>::const_iterator it = | 225 std::map<std::string, PluginInstaller*>::const_iterator it = |
| 226 installers_.find(identifier); | 226 installers_.find(identifier); |
| 227 if (it != installers_.end()) { | 227 if (it != installers_.end()) { |
| 228 *installer = it->second; | 228 if (installer) |
| 229 *installer = it->second; |
| 229 PluginMap::const_iterator metadata_it = identifier_plugin_.find(identifier); | 230 PluginMap::const_iterator metadata_it = identifier_plugin_.find(identifier); |
| 230 DCHECK(metadata_it != identifier_plugin_.end()); | 231 DCHECK(metadata_it != identifier_plugin_.end()); |
| 231 *plugin_metadata = metadata_it->second->Clone(); | 232 *plugin_metadata = metadata_it->second->Clone(); |
| 232 return true; | 233 return true; |
| 233 } | 234 } |
| 234 | 235 |
| 235 return false; | 236 return false; |
| 236 } | 237 } |
| 237 | 238 |
| 238 void PluginFinder::ReinitializePlugins( | 239 void PluginFinder::ReinitializePlugins( |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 DCHECK(!identifier_plugin_[identifier]); | 298 DCHECK(!identifier_plugin_[identifier]); |
| 298 identifier_plugin_[identifier] = CreatePluginMetadata(identifier, plugin); | 299 identifier_plugin_[identifier] = CreatePluginMetadata(identifier, plugin); |
| 299 | 300 |
| 300 #if defined(ENABLE_PLUGIN_INSTALLATION) | 301 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 301 if (installers_.find(identifier) == installers_.end()) | 302 if (installers_.find(identifier) == installers_.end()) |
| 302 installers_[identifier] = new PluginInstaller(); | 303 installers_[identifier] = new PluginInstaller(); |
| 303 #endif | 304 #endif |
| 304 } | 305 } |
| 305 } | 306 } |
| 306 } | 307 } |
| OLD | NEW |