summaryrefslogtreecommitdiffstats
path: root/webkit/plugins/ppapi/host_resource_tracker.cc
blob: 70b515712c64c5db141bb059b2670b8ba643b069 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "webkit/plugins/ppapi/host_resource_tracker.h"

#include "ppapi/shared_impl/resource.h"
#include "webkit/plugins/ppapi/callbacks.h"
#include "webkit/plugins/ppapi/plugin_module.h"
#include "webkit/plugins/ppapi/resource_helper.h"

namespace webkit {
namespace ppapi {

HostResourceTracker::HostResourceTracker() {
}

HostResourceTracker::~HostResourceTracker() {
}

void HostResourceTracker::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());
  }
}

}  // namespace ppapi
}  // namespace webkit