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

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

Issue 164305: Ensure we don't load plugins on the IO thread (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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
« no previous file with comments | « chrome/renderer/renderer_glue.cc ('k') | webkit/glue/plugins/plugin_list.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/stats_counters.h" 9 #include "base/stats_counters.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 18 matching lines...) Expand all
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];
35 } 35 }
36 36
37 WebPluginInfo info; 37 WebPluginInfo info;
38 const PluginEntryPoints* entry_points = NULL; 38 const PluginEntryPoints* entry_points = NULL;
39 if (!PluginList::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
45 void PluginLib::UnloadAllPlugins() { 45 void PluginLib::UnloadAllPlugins() {
46 if (g_loaded_libs) { 46 if (g_loaded_libs) {
47 for (size_t i = 0; i < g_loaded_libs->size(); ++i) 47 for (size_t i = 0; i < g_loaded_libs->size(); ++i)
48 (*g_loaded_libs)[i]->Unload(); 48 (*g_loaded_libs)[i]->Unload();
49 49
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 265 }
266 266
267 void PluginLib::Shutdown() { 267 void PluginLib::Shutdown() {
268 if (initialized_ && !internal_) { 268 if (initialized_ && !internal_) {
269 NP_Shutdown(); 269 NP_Shutdown();
270 initialized_ = false; 270 initialized_ = false;
271 } 271 }
272 } 272 }
273 273
274 } // namespace NPAPI 274 } // namespace NPAPI
OLDNEW
« no previous file with comments | « chrome/renderer/renderer_glue.cc ('k') | webkit/glue/plugins/plugin_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698