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/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" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 PluginLib::PluginLib(const WebPluginInfo& info, | 67 PluginLib::PluginLib(const WebPluginInfo& info, |
68 const PluginEntryPoints* entry_points) | 68 const PluginEntryPoints* entry_points) |
69 : web_plugin_info_(info), | 69 : web_plugin_info_(info), |
70 library_(NULL), | 70 library_(NULL), |
71 initialized_(false), | 71 initialized_(false), |
72 saved_data_(0), | 72 saved_data_(0), |
73 instance_count_(0), | 73 instance_count_(0), |
74 skip_unload_(false) { | 74 skip_unload_(false) { |
75 base::StatsCounter(kPluginLibrariesLoadedCounter).Increment(); | 75 base::StatsCounter(kPluginLibrariesLoadedCounter).Increment(); |
76 memset(static_cast<void*>(&plugin_funcs_), 0, sizeof(plugin_funcs_)); | 76 memset(static_cast<void*>(&plugin_funcs_), 0, sizeof(plugin_funcs_)); |
77 g_loaded_libs->push_back(this); | 77 g_loaded_libs->push_back(make_scoped_refptr(this)); |
78 | 78 |
79 if (entry_points) { | 79 if (entry_points) { |
80 internal_ = true; | 80 internal_ = true; |
81 entry_points_ = *entry_points; | 81 entry_points_ = *entry_points; |
82 } else { | 82 } else { |
83 internal_ = false; | 83 internal_ = false; |
84 // We will read the entry points from the plugin directly. | 84 // We will read the entry points from the plugin directly. |
85 memset(&entry_points_, 0, sizeof(entry_points_)); | 85 memset(&entry_points_, 0, sizeof(entry_points_)); |
86 } | 86 } |
87 } | 87 } |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 | 309 |
310 void PluginLib::Shutdown() { | 310 void PluginLib::Shutdown() { |
311 if (initialized_ && !internal_) { | 311 if (initialized_ && !internal_) { |
312 NP_Shutdown(); | 312 NP_Shutdown(); |
313 initialized_ = false; | 313 initialized_ = false; |
314 } | 314 } |
315 } | 315 } |
316 | 316 |
317 } // namespace NPAPI | 317 } // namespace NPAPI |
OLD | NEW |