| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/glue/plugins/plugin_lib.h" | 5 #include "webkit/plugins/npapi/plugin_lib.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/metrics/stats_counters.h" | 9 #include "base/metrics/stats_counters.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "webkit/glue/webkit_glue.h" | 11 #include "webkit/glue/webkit_glue.h" |
| 12 #include "webkit/glue/plugins/plugin_instance.h" | 12 #include "webkit/plugins/npapi/plugin_instance.h" |
| 13 #include "webkit/glue/plugins/plugin_host.h" | 13 #include "webkit/plugins/npapi/plugin_host.h" |
| 14 #include "webkit/glue/plugins/plugin_list.h" | 14 #include "webkit/plugins/npapi/plugin_list.h" |
| 15 | 15 |
| 16 namespace NPAPI { | 16 namespace webkit { |
| 17 namespace npapi { |
| 17 | 18 |
| 18 const char kPluginLibrariesLoadedCounter[] = "PluginLibrariesLoaded"; | 19 const char kPluginLibrariesLoadedCounter[] = "PluginLibrariesLoaded"; |
| 19 const char kPluginInstancesActiveCounter[] = "PluginInstancesActive"; | 20 const char kPluginInstancesActiveCounter[] = "PluginInstancesActive"; |
| 20 | 21 |
| 21 // A list of all the instantiated plugins. | 22 // A list of all the instantiated plugins. |
| 22 static std::vector<scoped_refptr<PluginLib> >* g_loaded_libs; | 23 static std::vector<scoped_refptr<PluginLib> >* g_loaded_libs; |
| 23 | 24 |
| 24 PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) { | 25 PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) { |
| 25 // We can only have one PluginLib object per plugin as it controls the per | 26 // We can only have one PluginLib object per plugin as it controls the per |
| 26 // instance function calls (i.e. NP_Initialize and NP_Shutdown). So we keep | 27 // instance function calls (i.e. NP_Initialize and NP_Shutdown). So we keep |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 } | 340 } |
| 340 } | 341 } |
| 341 | 342 |
| 342 void PluginLib::Shutdown() { | 343 void PluginLib::Shutdown() { |
| 343 if (initialized_ && !internal_) { | 344 if (initialized_ && !internal_) { |
| 344 NP_Shutdown(); | 345 NP_Shutdown(); |
| 345 initialized_ = false; | 346 initialized_ = false; |
| 346 } | 347 } |
| 347 } | 348 } |
| 348 | 349 |
| 349 } // namespace NPAPI | 350 } // namespace npapi |
| 351 } // namespace webkit |
| OLD | NEW |