| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef PPAPI_CPP_CORE_H_ | 5 #ifndef PPAPI_CPP_CORE_H_ |
| 6 #define PPAPI_CPP_CORE_H_ | 6 #define PPAPI_CPP_CORE_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/ppb_core.h" | 8 #include "ppapi/c/ppb_core.h" |
| 9 | 9 |
| 10 /// @file | 10 /// @file |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 /// ReleaseResource() decrements the reference count for the provided | 34 /// ReleaseResource() decrements the reference count for the provided |
| 35 /// <code>resource</code>. The resource will be deallocated if the | 35 /// <code>resource</code>. The resource will be deallocated if the |
| 36 /// reference count reaches zero. | 36 /// reference count reaches zero. |
| 37 /// | 37 /// |
| 38 /// @param[in] resource A <code>PP_Resource</code> containing the resource. | 38 /// @param[in] resource A <code>PP_Resource</code> containing the resource. |
| 39 void ReleaseResource(PP_Resource resource) { | 39 void ReleaseResource(PP_Resource resource) { |
| 40 interface_->ReleaseResource(resource); | 40 interface_->ReleaseResource(resource); |
| 41 } | 41 } |
| 42 | 42 |
| 43 /// MemAlloc() allocates memory. | |
| 44 /// | |
| 45 /// @param[in] num_bytes A number of bytes to allocate. | |
| 46 /// | |
| 47 /// @return A pointer to the memory if successful, <code>NULL</code> If the | |
| 48 /// allocation fails. | |
| 49 void* MemAlloc(uint32_t num_bytes) { | |
| 50 return interface_->MemAlloc(num_bytes); | |
| 51 } | |
| 52 | |
| 53 /// MemFree() deallocates memory. | |
| 54 /// | |
| 55 /// @param[in] ptr A pointer to the memory to deallocate. It is safe to | |
| 56 /// pass <code>NULL</code> to this function. | |
| 57 void MemFree(void* ptr) { | |
| 58 interface_->MemFree(ptr); | |
| 59 } | |
| 60 | |
| 61 /// GetTime() returns the "wall clock time" according to the | 43 /// GetTime() returns the "wall clock time" according to the |
| 62 /// browser. | 44 /// browser. |
| 63 /// | 45 /// |
| 64 /// @return A <code>PP_Time</code> containing the "wall clock time" according | 46 /// @return A <code>PP_Time</code> containing the "wall clock time" according |
| 65 /// to the browser. | 47 /// to the browser. |
| 66 PP_Time GetTime() { | 48 PP_Time GetTime() { |
| 67 return interface_->GetTime(); | 49 return interface_->GetTime(); |
| 68 } | 50 } |
| 69 | 51 |
| 70 /// GetTimeTicks() returns the "tick time" according to the browser. | 52 /// GetTimeTicks() returns the "tick time" according to the browser. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 // Copy and assignment are disallowed. | 108 // Copy and assignment are disallowed. |
| 127 Core(const Core& other); | 109 Core(const Core& other); |
| 128 Core& operator=(const Core& other); | 110 Core& operator=(const Core& other); |
| 129 | 111 |
| 130 const PPB_Core* interface_; | 112 const PPB_Core* interface_; |
| 131 }; | 113 }; |
| 132 | 114 |
| 133 } // namespace pp | 115 } // namespace pp |
| 134 | 116 |
| 135 #endif // PPAPI_CPP_CORE_H_ | 117 #endif // PPAPI_CPP_CORE_H_ |
| OLD | NEW |