| 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/plugins/npapi/plugin_lib.h" | 5 #include "webkit/glue/plugins/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/plugins/npapi/plugin_instance.h" | 12 #include "webkit/glue/plugins/plugin_instance.h" |
| 13 #include "webkit/plugins/npapi/plugin_host.h" | 13 #include "webkit/glue/plugins/plugin_host.h" |
| 14 #include "webkit/plugins/npapi/plugin_list.h" | 14 #include "webkit/glue/plugins/plugin_list.h" |
| 15 | 15 |
| 16 namespace webkit { | 16 namespace NPAPI { |
| 17 namespace npapi { | |
| 18 | 17 |
| 19 const char kPluginLibrariesLoadedCounter[] = "PluginLibrariesLoaded"; | 18 const char kPluginLibrariesLoadedCounter[] = "PluginLibrariesLoaded"; |
| 20 const char kPluginInstancesActiveCounter[] = "PluginInstancesActive"; | 19 const char kPluginInstancesActiveCounter[] = "PluginInstancesActive"; |
| 21 | 20 |
| 22 // A list of all the instantiated plugins. | 21 // A list of all the instantiated plugins. |
| 23 static std::vector<scoped_refptr<PluginLib> >* g_loaded_libs; | 22 static std::vector<scoped_refptr<PluginLib> >* g_loaded_libs; |
| 24 | 23 |
| 25 PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) { | 24 PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) { |
| 26 // We can only have one PluginLib object per plugin as it controls the per | 25 // We can only have one PluginLib object per plugin as it controls the per |
| 27 // instance function calls (i.e. NP_Initialize and NP_Shutdown). So we keep | 26 // 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... |
| 340 } | 339 } |
| 341 } | 340 } |
| 342 | 341 |
| 343 void PluginLib::Shutdown() { | 342 void PluginLib::Shutdown() { |
| 344 if (initialized_ && !internal_) { | 343 if (initialized_ && !internal_) { |
| 345 NP_Shutdown(); | 344 NP_Shutdown(); |
| 346 initialized_ = false; | 345 initialized_ = false; |
| 347 } | 346 } |
| 348 } | 347 } |
| 349 | 348 |
| 350 } // namespace npapi | 349 } // namespace NPAPI |
| 351 } // namespace webkit | |
| OLD | NEW |