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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_number_conversions.h" | 6 #include "base/strings/string_number_conversions.h" |
7 #include "base/test/perf_time_logger.h" | 7 #include "base/test/perf_time_logger.h" |
8 #include "ppapi/c/ppp_messaging.h" | 8 #include "ppapi/c/ppp_messaging.h" |
9 #include "ppapi/proxy/ppapi_messages.h" | 9 #include "ppapi/proxy/ppapi_messages.h" |
10 #include "ppapi/proxy/ppapi_proxy_test.h" | 10 #include "ppapi/proxy/ppapi_proxy_test.h" |
11 #include "ppapi/proxy/serialized_var.h" | 11 #include "ppapi/proxy/serialized_var.h" |
12 #include "ppapi/shared_impl/ppapi_globals.h" | 12 #include "ppapi/shared_impl/ppapi_globals.h" |
13 #include "ppapi/shared_impl/proxy_lock.h" | 13 #include "ppapi/shared_impl/proxy_lock.h" |
14 #include "ppapi/shared_impl/var.h" | 14 #include "ppapi/shared_impl/var.h" |
15 #include "ppapi/shared_impl/var_tracker.h" | 15 #include "ppapi/shared_impl/var_tracker.h" |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 namespace proxy { | 18 namespace proxy { |
19 namespace { | 19 namespace { |
20 | 20 |
21 base::WaitableEvent handle_message_called(false, false); | 21 base::WaitableEvent handle_message_called( |
| 22 base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 23 base::WaitableEvent::InitialState::NOT_SIGNALED); |
22 | 24 |
23 void HandleMessage(PP_Instance /* instance */, PP_Var message_data) { | 25 void HandleMessage(PP_Instance /* instance */, PP_Var message_data) { |
24 ppapi::ProxyAutoLock lock; | 26 ppapi::ProxyAutoLock lock; |
25 StringVar* string_var = StringVar::FromPPVar(message_data); | 27 StringVar* string_var = StringVar::FromPPVar(message_data); |
26 DCHECK(string_var); | 28 DCHECK(string_var); |
27 // Retrieve the string to make sure the proxy can't "optimize away" sending | 29 // Retrieve the string to make sure the proxy can't "optimize away" sending |
28 // the actual contents of the string (e.g., by doing a lazy retrieve or | 30 // the actual contents of the string (e.g., by doing a lazy retrieve or |
29 // something). Note that this test is for performance only, and assumes | 31 // something). Note that this test is for performance only, and assumes |
30 // other tests check for correctness. | 32 // other tests check for correctness. |
31 std::string s = string_var->value(); | 33 std::string s = string_var->value(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 ppapi::proxy::SerializedVarSendInput(host().host_dispatcher(), | 86 ppapi::proxy::SerializedVarSendInput(host().host_dispatcher(), |
85 host_string))); | 87 host_string))); |
86 handle_message_called.Wait(); | 88 handle_message_called.Wait(); |
87 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(host_string); | 89 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(host_string); |
88 } | 90 } |
89 } | 91 } |
90 | 92 |
91 } // namespace proxy | 93 } // namespace proxy |
92 } // namespace ppapi | 94 } // namespace ppapi |
93 | 95 |
OLD | NEW |