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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 1 month 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
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 14 matching lines...) Expand all
25 25
26 PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) { 26 PluginLib* PluginLib::CreatePluginLib(const FilePath& filename) {
27 // We can only have one PluginLib object per plugin as it controls the per 27 // We can only have one PluginLib object per plugin as it controls the per
28 // instance function calls (i.e. NP_Initialize and NP_Shutdown). So we keep 28 // instance function calls (i.e. NP_Initialize and NP_Shutdown). So we keep
29 // a map of PluginLib objects. 29 // a map of PluginLib objects.
30 if (!g_loaded_libs) 30 if (!g_loaded_libs)
31 g_loaded_libs = new std::vector<scoped_refptr<PluginLib> >; 31 g_loaded_libs = new std::vector<scoped_refptr<PluginLib> >;
32 32
33 for (size_t i = 0; i < g_loaded_libs->size(); ++i) { 33 for (size_t i = 0; i < g_loaded_libs->size(); ++i) {
34 if ((*g_loaded_libs)[i]->plugin_info().path == filename) 34 if ((*g_loaded_libs)[i]->plugin_info().path == filename)
35 return (*g_loaded_libs)[i]; 35 return (*g_loaded_libs)[i].get();
36 } 36 }
37 37
38 webkit::WebPluginInfo info; 38 webkit::WebPluginInfo info;
39 const PluginEntryPoints* entry_points = NULL; 39 const PluginEntryPoints* entry_points = NULL;
40 if (!PluginList::Singleton()->ReadPluginInfo(filename, &info, &entry_points)) 40 if (!PluginList::Singleton()->ReadPluginInfo(filename, &info, &entry_points))
41 return NULL; 41 return NULL;
42 42
43 return new PluginLib(info, entry_points); 43 return new PluginLib(info, entry_points);
44 } 44 }
45 45
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 344
345 void PluginLib::Shutdown() { 345 void PluginLib::Shutdown() {
346 if (initialized_ && !internal_) { 346 if (initialized_ && !internal_) {
347 NP_Shutdown(); 347 NP_Shutdown();
348 initialized_ = false; 348 initialized_ = false;
349 } 349 }
350 } 350 }
351 351
352 } // namespace npapi 352 } // namespace npapi
353 } // namespace webkit 353 } // namespace webkit
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/plugin_instance.h ('k') | webkit/plugins/npapi/webplugin_delegate_impl_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698