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.h" | 7 #include "base/message_loop.h" |
8 #include "ppapi/c/dev/ppb_testing_dev.h" | 8 #include "ppapi/c/dev/ppb_testing_dev.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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 EnterResourceNoLock<PPB_InputEvent_API> enter(input_event, false); | 86 EnterResourceNoLock<PPB_InputEvent_API> enter(input_event, false); |
87 if (enter.failed()) | 87 if (enter.failed()) |
88 return; | 88 return; |
89 | 89 |
90 const InputEventData& input_event_data = enter.object()->GetInputEventData(); | 90 const InputEventData& input_event_data = enter.object()->GetInputEventData(); |
91 dispatcher->Send(new PpapiHostMsg_PPBTesting_SimulateInputEvent( | 91 dispatcher->Send(new PpapiHostMsg_PPBTesting_SimulateInputEvent( |
92 API_ID_PPB_TESTING, instance_id, input_event_data)); | 92 API_ID_PPB_TESTING, instance_id, input_event_data)); |
93 } | 93 } |
94 | 94 |
95 PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) { | 95 PP_Var GetDocumentURL(PP_Instance instance, PP_URLComponents_Dev* components) { |
| 96 #if !defined(OS_NACL) |
96 EnterInstance enter(instance); | 97 EnterInstance enter(instance); |
97 if (enter.failed()) | 98 if (enter.failed()) |
98 return PP_MakeUndefined(); | 99 return PP_MakeUndefined(); |
99 return enter.functions()->GetDocumentURL(instance, components); | 100 return enter.functions()->GetDocumentURL(instance, components); |
| 101 #else |
| 102 // TODO(nfullagar): Implement something better for the new NaCl IPC plugin. |
| 103 // For now, this will at least allow some of the PPAPI tests to work. |
| 104 return PP_MakeUndefined(); |
| 105 #endif |
100 } | 106 } |
101 | 107 |
102 // TODO(dmichael): Ideally we could get a way to check the number of vars in the | 108 // TODO(dmichael): Ideally we could get a way to check the number of vars in the |
103 // host-side tracker when running out-of-process, to make sure the proxy does | 109 // host-side tracker when running out-of-process, to make sure the proxy does |
104 // not leak host-side vars. | 110 // not leak host-side vars. |
105 uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) { | 111 uint32_t GetLiveVars(PP_Var live_vars[], uint32_t array_size) { |
106 ProxyAutoLock lock; | 112 ProxyAutoLock lock; |
107 std::vector<PP_Var> vars = | 113 std::vector<PP_Var> vars = |
108 PpapiGlobals::Get()->GetVarTracker()->GetLiveVars(); | 114 PpapiGlobals::Get()->GetVarTracker()->GetLiveVars(); |
109 for (size_t i = 0u; | 115 for (size_t i = 0u; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 PP_Instance instance, | 200 PP_Instance instance, |
195 const InputEventData& input_event) { | 201 const InputEventData& input_event) { |
196 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( | 202 scoped_refptr<PPB_InputEvent_Shared> input_event_impl( |
197 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); | 203 new PPB_InputEvent_Shared(OBJECT_IS_PROXY, instance, input_event)); |
198 ppb_testing_impl_->SimulateInputEvent(instance, | 204 ppb_testing_impl_->SimulateInputEvent(instance, |
199 input_event_impl->pp_resource()); | 205 input_event_impl->pp_resource()); |
200 } | 206 } |
201 | 207 |
202 } // namespace proxy | 208 } // namespace proxy |
203 } // namespace ppapi | 209 } // namespace ppapi |
OLD | NEW |