From a1d660bfa7166332552497177f622ceb8503c171 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Thu, 28 Jun 2012 19:33:48 +0000 Subject: Add some CHECKs to try to diagnose a crash. BUG=134611 TEST= Review URL: https://chromiumcodereview.appspot.com/10713004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144774 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/shared_impl/resource_tracker.cc | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'ppapi/shared_impl') diff --git a/ppapi/shared_impl/resource_tracker.cc b/ppapi/shared_impl/resource_tracker.cc index a889c59..f3632d8 100644 --- a/ppapi/shared_impl/resource_tracker.cc +++ b/ppapi/shared_impl/resource_tracker.cc @@ -183,8 +183,18 @@ void ResourceTracker::RemoveResource(Resource* object) { } void ResourceTracker::LastPluginRefWasDeleted(Resource* object) { - PpapiGlobals::Get()->GetCallbackTrackerForInstance(object->pp_instance())-> - PostAbortForResource(object->pp_resource()); + // Bug http://crbug.com/134611 indicates that sometimes the resource tracker + // is null here. This should never be the case since if we have a resource in + // the tracker, it should always have a valid instance associated with it. + // As a result, we do some CHECKs here to see what types of problems the + // instance might have before dispatching. + // + // TODO(brettw) remove these checks when this bug is no longer relevant. + CHECK(object->pp_instance()); + CallbackTracker* callback_tracker = + PpapiGlobals::Get()->GetCallbackTrackerForInstance(object->pp_instance()); + CHECK(callback_tracker); + callback_tracker->PostAbortForResource(object->pp_resource()); object->LastPluginRefWasDeleted(); } -- cgit v1.1