Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: ppapi/cpp/core.h

Issue 6711047: Fix up some types in the API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #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 namespace pp { 10 namespace pp {
11 11
12 class CompletionCallback; 12 class CompletionCallback;
13 class Module; 13 class Module;
14 14
15 // Simple wrapper around the PPB_Core interface. Some of these wrappers add 15 // Simple wrapper around the PPB_Core interface. Some of these wrappers add
16 // nothing over the C interface, but some allow the use of C++ arguments. 16 // nothing over the C interface, but some allow the use of C++ arguments.
17 class Core { 17 class Core {
18 public: 18 public:
19 // Note that we explicitly don't expose Resource& versions of this function 19 // Note that we explicitly don't expose Resource& versions of this function
20 // since Resource will normally manage the refcount properly. These should 20 // since Resource will normally manage the refcount properly. These should
21 // be called only when doing manual management on raw PP_Resource handles, 21 // be called only when doing manual management on raw PP_Resource handles,
22 // which should be fairly rare. 22 // which should be fairly rare.
23 void AddRefResource(PP_Resource resource) { 23 void AddRefResource(PP_Resource resource) {
24 interface_->AddRefResource(resource); 24 interface_->AddRefResource(resource);
25 } 25 }
26 void ReleaseResource(PP_Resource resource) { 26 void ReleaseResource(PP_Resource resource) {
27 interface_->ReleaseResource(resource); 27 interface_->ReleaseResource(resource);
28 } 28 }
29 29
30 void* MemAlloc(size_t num_bytes) { 30 void* MemAlloc(uint32_t num_bytes) {
dmichael(do not use this one) 2011/03/21 21:53:24 size_t is 8 bytes on Linux 64. It sounds like we'
neb 2011/03/21 22:16:15 Yeah, we talked about it a bit. We currently seria
31 return interface_->MemAlloc(num_bytes); 31 return interface_->MemAlloc(num_bytes);
32 } 32 }
33 void MemFree(void* ptr) { 33 void MemFree(const void* ptr) {
34 interface_->MemFree(ptr); 34 interface_->MemFree(ptr);
35 } 35 }
36 36
37 PP_Time GetTime() { 37 PP_Time GetTime() {
38 return interface_->GetTime(); 38 return interface_->GetTime();
39 } 39 }
40 40
41 PP_TimeTicks GetTimeTicks() { 41 PP_TimeTicks GetTimeTicks() {
42 return interface_->GetTimeTicks(); 42 return interface_->GetTimeTicks();
43 } 43 }
(...skipping 14 matching lines...) Expand all
58 // Copy and assignment are disallowed. 58 // Copy and assignment are disallowed.
59 Core(const Core& other); 59 Core(const Core& other);
60 Core& operator=(const Core& other); 60 Core& operator=(const Core& other);
61 61
62 const PPB_Core* interface_; 62 const PPB_Core* interface_;
63 }; 63 };
64 64
65 } // namespace pp 65 } // namespace pp
66 66
67 #endif // PPAPI_CPP_CORE_H_ 67 #endif // PPAPI_CPP_CORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698