OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_testing_proxy.h" | 5 #include "ppapi/proxy/ppb_testing_proxy.h" |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "ppapi/c/private/ppb_testing_private.h" | 8 #include "ppapi/c/private/ppb_testing_private.h" |
9 #include "ppapi/proxy/enter_proxy.h" | 9 #include "ppapi/proxy/enter_proxy.h" |
10 #include "ppapi/proxy/plugin_dispatcher.h" | 10 #include "ppapi/proxy/plugin_dispatcher.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // host-side tracker when running out-of-process, to make sure the proxy does | 105 // host-side tracker when running out-of-process, to make sure the proxy does |
106 // not leak host-side vars. | 106 // not leak host-side vars. |
107 uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) { | 107 uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) { |
108 ProxyAutoLock lock; | 108 ProxyAutoLock lock; |
109 std::vector<PP_Var> vars = | 109 std::vector<PP_Var> vars = |
110 PpapiGlobals::Get()->GetVarTracker()->GetLiveVars(); | 110 PpapiGlobals::Get()->GetVarTracker()->GetLiveVars(); |
111 for (size_t i = 0u; | 111 for (size_t i = 0u; |
112 i < std::min(static_cast<size_t>(array_size), vars.size()); | 112 i < std::min(static_cast<size_t>(array_size), vars.size()); |
113 ++i) | 113 ++i) |
114 live_vars[i] = vars[i]; | 114 live_vars[i] = vars[i]; |
115 return vars.size(); | 115 return static_cast<uint32_t>(vars.size()); |
116 } | 116 } |
117 | 117 |
118 void SetMinimumArrayBufferSizeForShmem(PP_Instance instance, | 118 void SetMinimumArrayBufferSizeForShmem(PP_Instance instance, |
119 uint32_t threshold) { | 119 uint32_t threshold) { |
120 ProxyAutoLock lock; | 120 ProxyAutoLock lock; |
121 RawVarDataGraph::SetMinimumArrayBufferSizeForShmemForTest(threshold); | 121 RawVarDataGraph::SetMinimumArrayBufferSizeForShmemForTest(threshold); |
122 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); | 122 PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance); |
123 if (!dispatcher) | 123 if (!dispatcher) |
124 return; | 124 return; |
125 dispatcher->Send( | 125 dispatcher->Send( |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 input_event_impl->pp_resource()); | 215 input_event_impl->pp_resource()); |
216 } | 216 } |
217 | 217 |
218 void PPB_Testing_Proxy::OnMsgSetMinimumArrayBufferSizeForShmem( | 218 void PPB_Testing_Proxy::OnMsgSetMinimumArrayBufferSizeForShmem( |
219 uint32_t threshold) { | 219 uint32_t threshold) { |
220 RawVarDataGraph::SetMinimumArrayBufferSizeForShmemForTest(threshold); | 220 RawVarDataGraph::SetMinimumArrayBufferSizeForShmemForTest(threshold); |
221 } | 221 } |
222 | 222 |
223 } // namespace proxy | 223 } // namespace proxy |
224 } // namespace ppapi | 224 } // namespace ppapi |
OLD | NEW |