OLD | NEW |
| (Empty) |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "webkit/plugins/ppapi/resource.h" | |
6 | |
7 #include "base/logging.h" | |
8 #include "webkit/plugins/ppapi/callbacks.h" | |
9 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | |
10 #include "webkit/plugins/ppapi/plugin_module.h" | |
11 #include "webkit/plugins/ppapi/resource_tracker.h" | |
12 | |
13 namespace webkit { | |
14 namespace ppapi { | |
15 | |
16 Resource::Resource(PluginInstance* instance) | |
17 : ::ppapi::Resource(instance->pp_instance()), | |
18 instance_(instance) { | |
19 } | |
20 | |
21 Resource::~Resource() { | |
22 } | |
23 | |
24 PP_Resource Resource::GetReference() { | |
25 ResourceTracker* tracker = ResourceTracker::Get(); | |
26 tracker->AddRefResource(pp_resource()); | |
27 return pp_resource(); | |
28 } | |
29 | |
30 void Resource::LastPluginRefWasDeleted() { | |
31 instance()->module()->GetCallbackTracker()->PostAbortForResource( | |
32 pp_resource()); | |
33 } | |
34 | |
35 void Resource::InstanceWasDeleted() { | |
36 ::ppapi::Resource::InstanceWasDeleted(); | |
37 instance_ = NULL; | |
38 } | |
39 | |
40 } // namespace ppapi | |
41 } // namespace webkit | |
42 | |
OLD | NEW |