Chromium Code Reviews| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 224 Init("PerformanceClient"); | 224 Init("PerformanceClient"); |
| 225 | 225 |
| 226 // Set up IPC channel and start client. | 226 // Set up IPC channel and start client. |
| 227 PerformanceChannelListener listener; | 227 PerformanceChannelListener listener; |
| 228 CreateChannel(&listener); | 228 CreateChannel(&listener); |
| 229 listener.Init(channel()); | 229 listener.Init(channel()); |
| 230 ASSERT_TRUE(ConnectChannel()); | 230 ASSERT_TRUE(ConnectChannel()); |
| 231 ASSERT_TRUE(StartClient()); | 231 ASSERT_TRUE(StartClient()); |
| 232 | 232 |
| 233 const size_t kMsgSizeBase = 12; | 233 const size_t kMsgSizeBase = 12; |
| 234 const int kMsgSizeMaxExp = 5; | 234 const int kMsgSizeMaxExp = 3; |
| 235 int msg_count = 100000; | 235 int msg_count = 100000; |
|
viettrungluu
2014/03/15 17:25:27
You might consider lowering msg_count instead of l
epenner
2014/03/17 20:24:53
Good point.
Okay I kept all 5 message sizes. I si
| |
| 236 size_t msg_size = kMsgSizeBase; | 236 size_t msg_size = kMsgSizeBase; |
| 237 for (int i = 1; i <= kMsgSizeMaxExp; i++) { | 237 for (int i = 1; i <= kMsgSizeMaxExp; i++) { |
| 238 listener.SetTestParams(msg_count, msg_size); | 238 listener.SetTestParams(msg_count, msg_size); |
| 239 | 239 |
| 240 // This initial message will kick-start the ping-pong of messages. | 240 // This initial message will kick-start the ping-pong of messages. |
| 241 IPC::Message* message = | 241 IPC::Message* message = |
| 242 new IPC::Message(0, 2, IPC::Message::PRIORITY_NORMAL); | 242 new IPC::Message(0, 2, IPC::Message::PRIORITY_NORMAL); |
| 243 message->WriteInt64(base::TimeTicks::Now().ToInternalValue()); | 243 message->WriteInt64(base::TimeTicks::Now().ToInternalValue()); |
| 244 message->WriteInt(-1); | 244 message->WriteInt(-1); |
| 245 message->WriteString("hello"); | 245 message->WriteString("hello"); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 270 IPC::Channel::MODE_CLIENT, | 270 IPC::Channel::MODE_CLIENT, |
| 271 &listener); | 271 &listener); |
| 272 listener.Init(&channel); | 272 listener.Init(&channel); |
| 273 CHECK(channel.Connect()); | 273 CHECK(channel.Connect()); |
| 274 | 274 |
| 275 base::MessageLoop::current()->Run(); | 275 base::MessageLoop::current()->Run(); |
| 276 return 0; | 276 return 0; |
| 277 } | 277 } |
| 278 | 278 |
| 279 } // namespace | 279 } // namespace |
| OLD | NEW |