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/glue/plugins/pepper_resource.h" |
| 6 |
| 7 #include "third_party/ppapi/c/pp_resource.h" |
| 8 #include "webkit/glue/plugins/pepper_resource_tracker.h" |
| 9 |
| 10 namespace pepper { |
| 11 |
| 12 PP_Resource NullPPResource() { |
| 13 PP_Resource ret = { 0 }; |
| 14 return ret; |
| 15 } |
| 16 |
| 17 Resource::Resource(PluginModule* module) : module_(module) { |
| 18 ResourceTracker::Get()->AddResource(this); |
| 19 } |
| 20 |
| 21 Resource::~Resource() { |
| 22 ResourceTracker::Get()->DeleteResource(this); |
| 23 } |
| 24 |
| 25 PP_Resource Resource::GetResource() const { |
| 26 PP_Resource ret; |
| 27 ret.id = reinterpret_cast<intptr_t>(this); |
| 28 return ret; |
| 29 } |
| 30 |
| 31 } // namespace pepper |
OLD | NEW |