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/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 delay_in_ms); | 73 delay_in_ms); |
74 } | 74 } |
75 | 75 |
76 PP_Bool IsMainThread() { | 76 PP_Bool IsMainThread() { |
77 return PP_FromBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); | 77 return PP_FromBool(GetMainThreadMessageLoop()->BelongsToCurrentThread()); |
78 } | 78 } |
79 | 79 |
80 const PPB_Core core_interface = { | 80 const PPB_Core core_interface = { |
81 &AddRefResource, | 81 &AddRefResource, |
82 &ReleaseResource, | 82 &ReleaseResource, |
83 &MemAlloc, | |
84 &MemFree, | |
85 &GetTime, | 83 &GetTime, |
86 &GetTimeTicks, | 84 &GetTimeTicks, |
87 &CallOnMainThread, | 85 &CallOnMainThread, |
88 &IsMainThread | 86 &IsMainThread |
89 }; | 87 }; |
90 | 88 |
91 InterfaceProxy* CreateCoreProxy(Dispatcher* dispatcher, | 89 InterfaceProxy* CreateCoreProxy(Dispatcher* dispatcher, |
92 const void* target_interface) { | 90 const void* target_interface) { |
93 return new PPB_Core_Proxy(dispatcher, target_interface); | 91 return new PPB_Core_Proxy(dispatcher, target_interface); |
94 } | 92 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 void PPB_Core_Proxy::OnMsgAddRefResource(HostResource resource) { | 129 void PPB_Core_Proxy::OnMsgAddRefResource(HostResource resource) { |
132 ppb_core_target()->AddRefResource(resource.host_resource()); | 130 ppb_core_target()->AddRefResource(resource.host_resource()); |
133 } | 131 } |
134 | 132 |
135 void PPB_Core_Proxy::OnMsgReleaseResource(HostResource resource) { | 133 void PPB_Core_Proxy::OnMsgReleaseResource(HostResource resource) { |
136 ppb_core_target()->ReleaseResource(resource.host_resource()); | 134 ppb_core_target()->ReleaseResource(resource.host_resource()); |
137 } | 135 } |
138 | 136 |
139 } // namespace proxy | 137 } // namespace proxy |
140 } // namespace pp | 138 } // namespace pp |
OLD | NEW |