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

Unified Diff: webkit/plugins/ppapi/plugin_module.cc

Issue 8342016: Revert 106142 - Add a new globals object for PPAPI tracking information. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/npobject_var.cc ('k') | webkit/plugins/ppapi/plugin_object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/plugin_module.cc
===================================================================
--- webkit/plugins/ppapi/plugin_module.cc (revision 106147)
+++ webkit/plugins/ppapi/plugin_module.cc (working copy)
@@ -90,7 +90,6 @@
#include "webkit/plugins/plugin_switches.h"
#include "webkit/plugins/ppapi/callbacks.h"
#include "webkit/plugins/ppapi/common.h"
-#include "webkit/plugins/ppapi/host_globals.h"
#include "webkit/plugins/ppapi/ppapi_interface_factory.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
#include "webkit/plugins/ppapi/ppb_directory_reader_impl.h"
@@ -115,7 +114,6 @@
#include "webkit/plugins/ppapi/resource_tracker.h"
#include "webkit/plugins/ppapi/webkit_forwarding_impl.h"
-using ppapi::PpapiGlobals;
using ppapi::TimeTicksToPPTimeTicks;
using ppapi::TimeToPPTime;
using ppapi::thunk::EnterResource;
@@ -126,14 +124,6 @@
namespace {
-// Global tracking info for PPAPI plugins. This is lazily created before the
-// first plugin is allocated, and leaked on shutdown.
-//
-// Note that we don't want a Singleton here since destroying this object will
-// try to free some stuff that requires WebKit, and Singletons are destroyed
-// after WebKit.
-webkit::ppapi::HostGlobals* host_globals = NULL;
-
// Maintains all currently loaded plugin libs for validating PP_Module
// identifiers.
typedef std::set<PluginModule*> PluginModuleSet;
@@ -152,11 +142,11 @@
// PPB_Core --------------------------------------------------------------------
void AddRefResource(PP_Resource resource) {
- PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(resource);
+ ResourceTracker::Get()->AddRefResource(resource);
}
void ReleaseResource(PP_Resource resource) {
- PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(resource);
+ ResourceTracker::Get()->ReleaseResource(resource);
}
PP_Time GetTime() {
@@ -215,8 +205,7 @@
}
uint32_t GetLiveObjectsForInstance(PP_Instance instance_id) {
- return HostGlobals::Get()->host_resource_tracker()->GetLiveObjectsForInstance(
- instance_id);
+ return ResourceTracker::Get()->GetLiveObjectsForInstance(instance_id);
}
PP_Bool IsOutOfProcess() {
@@ -382,12 +371,8 @@
name_(name),
path_(path),
reserve_instance_id_(NULL) {
- // Ensure the globals object is created.
- if (!host_globals)
- host_globals = new HostGlobals;
-
memset(&entry_points_, 0, sizeof(entry_points_));
- pp_module_ = HostGlobals::Get()->host_resource_tracker()->AddModule(this);
+ pp_module_ = ResourceTracker::Get()->AddModule(this);
GetMainThreadMessageLoop(); // Initialize the main thread message loop.
GetLivePluginSet()->insert(this);
}
@@ -413,7 +398,7 @@
base::UnloadNativeLibrary(library_);
// Notifications that we've been deleted should be last.
- HostGlobals::Get()->host_resource_tracker()->ModuleDeleted(pp_module_);
+ ResourceTracker::Get()->ModuleDeleted(pp_module_);
if (!is_crashed_) {
// When the plugin crashes, we immediately tell the lifetime delegate that
// we're gone, so we don't want to tell it again.
Property changes on: webkit/plugins/ppapi/plugin_module.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /branches/chrome_webkit_merge_branch/src/webkit/plugins/ppapi/plugin_module.cc:r3734-4217,4606-5108,5177-5263
« no previous file with comments | « webkit/plugins/ppapi/npobject_var.cc ('k') | webkit/plugins/ppapi/plugin_object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698