| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ppapi/cpp/resource.h" | 5 #include "ppapi/cpp/resource.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ppapi/cpp/logging.h" | 9 #include "ppapi/cpp/logging.h" |
| 10 #include "ppapi/cpp/module.h" | 10 #include "ppapi/cpp/module.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 PP_Resource ret = pp_resource_; | 37 PP_Resource ret = pp_resource_; |
| 38 pp_resource_ = 0; | 38 pp_resource_ = 0; |
| 39 return ret; | 39 return ret; |
| 40 } | 40 } |
| 41 | 41 |
| 42 Resource::Resource(PP_Resource resource) : pp_resource_(resource) { | 42 Resource::Resource(PP_Resource resource) : pp_resource_(resource) { |
| 43 if (!is_null()) | 43 if (!is_null()) |
| 44 Module::Get()->core()->AddRefResource(pp_resource_); | 44 Module::Get()->core()->AddRefResource(pp_resource_); |
| 45 } | 45 } |
| 46 | 46 |
| 47 Resource::Resource(PassRef, PP_Resource resource) : pp_resource_(resource) { |
| 48 } |
| 49 |
| 47 void Resource::PassRefFromConstructor(PP_Resource resource) { | 50 void Resource::PassRefFromConstructor(PP_Resource resource) { |
| 48 PP_DCHECK(!pp_resource_); | 51 PP_DCHECK(!pp_resource_); |
| 49 pp_resource_ = resource; | 52 pp_resource_ = resource; |
| 50 } | 53 } |
| 51 | 54 |
| 52 } // namespace pp | 55 } // namespace pp |
| OLD | NEW |