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

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

Issue 7669055: Remove webkit::ppapi::Resource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nulls auditeed Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.h ('k') | webkit/plugins/ppapi/resource_tracker_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/ppapi/resource_tracker.cc
diff --git a/webkit/plugins/ppapi/resource_tracker.cc b/webkit/plugins/ppapi/resource_tracker.cc
index 18211e78430dc34eeb354748b17eee1e966a9990..ee296866c0fc3dc7e00746c7c8c7ac551740ae5c 100644
--- a/webkit/plugins/ppapi/resource_tracker.cc
+++ b/webkit/plugins/ppapi/resource_tracker.cc
@@ -14,6 +14,7 @@
#include "ppapi/shared_impl/function_group_base.h"
#include "ppapi/shared_impl/id_assignment.h"
#include "ppapi/shared_impl/tracker_base.h"
+#include "webkit/plugins/ppapi/callbacks.h"
#include "webkit/plugins/ppapi/npobject_var.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
@@ -21,8 +22,8 @@
#include "webkit/plugins/ppapi/ppb_cursor_control_impl.h"
#include "webkit/plugins/ppapi/ppb_find_impl.h"
#include "webkit/plugins/ppapi/ppb_font_impl.h"
-#include "webkit/plugins/ppapi/resource.h"
#include "webkit/plugins/ppapi/resource_creation_impl.h"
+#include "webkit/plugins/ppapi/resource_helper.h"
using ppapi::CheckIdType;
using ppapi::MakeTypedId;
@@ -65,8 +66,7 @@ struct ResourceTracker::InstanceData {
ResourceTracker* ResourceTracker::global_tracker_ = NULL;
ResourceTracker* ResourceTracker::singleton_override_ = NULL;
-ResourceTracker::ResourceTracker()
- : last_resource_id_(0) {
+ResourceTracker::ResourceTracker() {
// Wire up the new shared resource tracker base to use our implementation.
::ppapi::TrackerBase::Init(&GetTrackerBase);
}
@@ -166,6 +166,20 @@ void ResourceTracker::CleanupInstanceData(PP_Instance instance,
return this;
}
+void ResourceTracker::LastPluginRefWasDeleted(::ppapi::Resource* object) {
+ ::ppapi::ResourceTracker::LastPluginRefWasDeleted(object);
+
+ // TODO(brettw) this should be removed when we have the callback tracker
+ // moved to the shared_impl. This will allow the logic to post aborts for
+ // any callbacks directly in the Resource::LastPluginRefWasDeleted function
+ // and we can remove this function altogether.
+ PluginModule* plugin_module = ResourceHelper::GetPluginModule(object);
+ if (plugin_module) {
+ plugin_module->GetCallbackTracker()->PostAbortForResource(
+ object->pp_resource());
+ }
+}
+
void ResourceTracker::AddNPObjectVar(NPObjectVar* object_var) {
DCHECK(instance_map_.find(object_var->pp_instance()) != instance_map_.end());
InstanceData& data = *instance_map_[object_var->pp_instance()].get();
« no previous file with comments | « webkit/plugins/ppapi/resource_tracker.h ('k') | webkit/plugins/ppapi/resource_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698