Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: webkit/plugins/npapi/plugin_lib.cc

Issue 16155009: Update webkit/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_lib.h" 5 #include "webkit/plugins/npapi/plugin_lib.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/stats_counters.h" 10 #include "base/metrics/stats_counters.h"
(...skipping 13 matching lines...) Expand all
24 24
25 PluginLib* PluginLib::CreatePluginLib(const base::FilePath& filename) { 25 PluginLib* PluginLib::CreatePluginLib(const base::FilePath& filename) {
26 // 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
27 // 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
28 // a map of PluginLib objects. 28 // a map of PluginLib objects.
29 if (!g_loaded_libs) 29 if (!g_loaded_libs)
30 g_loaded_libs = new std::vector<scoped_refptr<PluginLib> >; 30 g_loaded_libs = new std::vector<scoped_refptr<PluginLib> >;
31 31
32 for (size_t i = 0; i < g_loaded_libs->size(); ++i) { 32 for (size_t i = 0; i < g_loaded_libs->size(); ++i) {
33 if ((*g_loaded_libs)[i]->plugin_info().path == filename) 33 if ((*g_loaded_libs)[i]->plugin_info().path == filename)
34 return (*g_loaded_libs)[i]; 34 return (*g_loaded_libs)[i].get();
35 } 35 }
36 36
37 webkit::WebPluginInfo info; 37 webkit::WebPluginInfo info;
38 const PluginEntryPoints* entry_points = NULL; 38 const PluginEntryPoints* entry_points = NULL;
39 if (!PluginList::Singleton()->ReadPluginInfo(filename, &info, &entry_points)) 39 if (!PluginList::Singleton()->ReadPluginInfo(filename, &info, &entry_points))
40 return NULL; 40 return NULL;
41 41
42 return new PluginLib(info, entry_points); 42 return new PluginLib(info, entry_points);
43 } 43 }
44 44
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 343
344 void PluginLib::Shutdown() { 344 void PluginLib::Shutdown() {
345 if (initialized_ && !internal_) { 345 if (initialized_ && !internal_) {
346 NP_Shutdown(); 346 NP_Shutdown();
347 initialized_ = false; 347 initialized_ = false;
348 } 348 }
349 } 349 }
350 350
351 } // namespace npapi 351 } // namespace npapi
352 } // namespace webkit 352 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/plugin_instance.cc ('k') | webkit/plugins/npapi/webplugin_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698