Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: ppapi/proxy/ppp_messaging_proxy_perftest.cc

Issue 23985006: base: Split logging functions and PerfTimeLogger out of perftimer.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix visitedlink Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_resolver_perftest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/perftimer.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_proxy_test.h" 9 #include "ppapi/proxy/ppapi_proxy_test.h"
10 #include "ppapi/proxy/serialized_var.h" 10 #include "ppapi/proxy/serialized_var.h"
11 #include "ppapi/shared_impl/ppapi_globals.h" 11 #include "ppapi/shared_impl/ppapi_globals.h"
12 #include "ppapi/shared_impl/var.h" 12 #include "ppapi/shared_impl/var.h"
13 #include "ppapi/shared_impl/var_tracker.h" 13 #include "ppapi/shared_impl/var_tracker.h"
14 14
15 namespace ppapi { 15 namespace ppapi {
16 namespace proxy { 16 namespace proxy {
17 namespace { 17 namespace {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (command_line->HasSwitch("string_count")) { 66 if (command_line->HasSwitch("string_count")) {
67 base::StringToInt(command_line->GetSwitchValueASCII("string_count"), 67 base::StringToInt(command_line->GetSwitchValueASCII("string_count"),
68 &string_count); 68 &string_count);
69 } 69 }
70 if (command_line->HasSwitch("max_string_size")) { 70 if (command_line->HasSwitch("max_string_size")) {
71 base::StringToInt(command_line->GetSwitchValueASCII("max_string_size"), 71 base::StringToInt(command_line->GetSwitchValueASCII("max_string_size"),
72 &max_string_size); 72 &max_string_size);
73 } 73 }
74 } 74 }
75 srand(seed); 75 srand(seed);
76 PerfTimeLogger logger("PppMessagingPerfTest.StringPerformance"); 76 base::PerfTimeLogger logger("PppMessagingPerfTest.StringPerformance");
77 for (int i = 0; i < string_count; ++i) { 77 for (int i = 0; i < string_count; ++i) {
78 const std::string test_string(rand() % max_string_size, 'a'); 78 const std::string test_string(rand() % max_string_size, 'a');
79 PP_Var host_string = StringVar::StringToPPVar(test_string); 79 PP_Var host_string = StringVar::StringToPPVar(test_string);
80 ppp_messaging->HandleMessage(kTestInstance, host_string); 80 ppp_messaging->HandleMessage(kTestInstance, host_string);
81 handle_message_called.Wait(); 81 handle_message_called.Wait();
82 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(host_string); 82 PpapiGlobals::Get()->GetVarTracker()->ReleaseVar(host_string);
83 } 83 }
84 } 84 }
85 85
86 } // namespace proxy 86 } // namespace proxy
87 } // namespace ppapi 87 } // namespace ppapi
88 88
OLDNEW
« no previous file with comments | « net/proxy/proxy_resolver_perftest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698