| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "webkit/plugins/npapi/plugin_list.h" | 5 #include "webkit/plugins/npapi/plugin_list.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 437 return; | 437 return; |
| 438 } | 438 } |
| 439 } | 439 } |
| 440 | 440 |
| 441 base::AutoLock lock(lock_); | 441 base::AutoLock lock(lock_); |
| 442 AddToPluginGroups(plugin_info, plugin_groups); | 442 AddToPluginGroups(plugin_info, plugin_groups); |
| 443 } | 443 } |
| 444 | 444 |
| 445 void PluginList::GetPlugins(std::vector<WebPluginInfo>* plugins) { | 445 void PluginList::GetPlugins(std::vector<WebPluginInfo>* plugins) { |
| 446 LoadPlugins(); | 446 LoadPlugins(); |
| 447 GetCachedPlugins(plugins); |
| 448 } |
| 449 |
| 450 void PluginList::GetCachedPlugins(std::vector<webkit::WebPluginInfo>* plugins) { |
| 447 base::AutoLock lock(lock_); | 451 base::AutoLock lock(lock_); |
| 448 for (size_t i = 0; i < plugin_groups_.size(); ++i) { | 452 for (size_t i = 0; i < plugin_groups_.size(); ++i) { |
| 449 const std::vector<webkit::WebPluginInfo>& gr_plugins = | 453 const std::vector<webkit::WebPluginInfo>& gr_plugins = |
| 450 plugin_groups_[i]->web_plugin_infos(); | 454 plugin_groups_[i]->web_plugin_infos(); |
| 451 plugins->insert(plugins->end(), gr_plugins.begin(), gr_plugins.end()); | 455 plugins->insert(plugins->end(), gr_plugins.begin(), gr_plugins.end()); |
| 452 } | 456 } |
| 453 } | 457 } |
| 454 | 458 |
| 455 void PluginList::GetPluginInfoArray( | 459 void PluginList::GetPluginInfoArray( |
| 456 const GURL& url, | 460 const GURL& url, |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 } | 664 } |
| 661 return false; | 665 return false; |
| 662 } | 666 } |
| 663 | 667 |
| 664 PluginList::~PluginList() { | 668 PluginList::~PluginList() { |
| 665 } | 669 } |
| 666 | 670 |
| 667 | 671 |
| 668 } // namespace npapi | 672 } // namespace npapi |
| 669 } // namespace webkit | 673 } // namespace webkit |
| OLD | NEW |