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 #include "ppapi/proxy/ppb_core_proxy.h" | 5 #include "ppapi/proxy/ppb_core_proxy.h" |
6 | 6 |
7 #include <stdlib.h> // For malloc | 7 #include <stdlib.h> // For malloc |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 } | 29 } |
30 | 30 |
31 void AddRefResource(PP_Resource resource) { | 31 void AddRefResource(PP_Resource resource) { |
32 PluginResourceTracker::GetInstance()->AddRefResource(resource); | 32 PluginResourceTracker::GetInstance()->AddRefResource(resource); |
33 } | 33 } |
34 | 34 |
35 void ReleaseResource(PP_Resource resource) { | 35 void ReleaseResource(PP_Resource resource) { |
36 PluginResourceTracker::GetInstance()->ReleaseResource(resource); | 36 PluginResourceTracker::GetInstance()->ReleaseResource(resource); |
37 } | 37 } |
38 | 38 |
39 void* MemAlloc(size_t num_bytes) { | 39 void* MemAlloc(uint32_t num_bytes) { |
40 return malloc(num_bytes); | 40 return malloc(num_bytes); |
41 } | 41 } |
42 | 42 |
43 void MemFree(void* ptr) { | 43 void MemFree(const void* ptr) { |
44 free(ptr); | 44 free(const_cast<void*>(ptr)); |
45 } | 45 } |
46 | 46 |
47 double GetTime() { | 47 double GetTime() { |
48 return base::Time::Now().ToDoubleT(); | 48 return base::Time::Now().ToDoubleT(); |
49 } | 49 } |
50 | 50 |
51 double GetTimeTicks() { | 51 double GetTimeTicks() { |
52 // TODO(brettw) http://code.google.com/p/chromium/issues/detail?id=57448 | 52 // TODO(brettw) http://code.google.com/p/chromium/issues/detail?id=57448 |
53 // This should be a tick timer rather than wall clock time, but needs to | 53 // This should be a tick timer rather than wall clock time, but needs to |
54 // match message times, which also currently use wall clock time. | 54 // match message times, which also currently use wall clock time. |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void PPB_Core_Proxy::OnMsgAddRefResource(HostResource resource) { | 122 void PPB_Core_Proxy::OnMsgAddRefResource(HostResource resource) { |
123 ppb_core_target()->AddRefResource(resource.host_resource()); | 123 ppb_core_target()->AddRefResource(resource.host_resource()); |
124 } | 124 } |
125 | 125 |
126 void PPB_Core_Proxy::OnMsgReleaseResource(HostResource resource) { | 126 void PPB_Core_Proxy::OnMsgReleaseResource(HostResource resource) { |
127 ppb_core_target()->ReleaseResource(resource.host_resource()); | 127 ppb_core_target()->ReleaseResource(resource.host_resource()); |
128 } | 128 } |
129 | 129 |
130 } // namespace proxy | 130 } // namespace proxy |
131 } // namespace pp | 131 } // namespace pp |
OLD | NEW |