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

Side by Side Diff: ipc/ipc_perftest_support.cc

Issue 987033003: Adding StringPiece read/write support to pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « base/pickle_unittest.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 "ipc/ipc_perftest_support.h" 5 #include "ipc/ipc_perftest_support.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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 97
98 bool OnMessageReceived(const Message& message) override { 98 bool OnMessageReceived(const Message& message) override {
99 CHECK(channel_); 99 CHECK(channel_);
100 100
101 PickleIterator iter(message); 101 PickleIterator iter(message);
102 int64 time_internal; 102 int64 time_internal;
103 EXPECT_TRUE(iter.ReadInt64(&time_internal)); 103 EXPECT_TRUE(iter.ReadInt64(&time_internal));
104 int msgid; 104 int msgid;
105 EXPECT_TRUE(iter.ReadInt(&msgid)); 105 EXPECT_TRUE(iter.ReadInt(&msgid));
106 std::string payload; 106 base::StringPiece payload;
107 EXPECT_TRUE(iter.ReadString(&payload)); 107 EXPECT_TRUE(iter.ReadStringPiece(&payload));
108 108
109 // Include message deserialization in latency. 109 // Include message deserialization in latency.
110 base::TimeTicks now = base::TimeTicks::Now(); 110 base::TimeTicks now = base::TimeTicks::Now();
111 111
112 if (payload == "hello") { 112 if (payload == "hello") {
113 latency_tracker_.Reset(); 113 latency_tracker_.Reset();
114 } else if (payload == "quit") { 114 } else if (payload == "quit") {
115 latency_tracker_.ShowResults(); 115 latency_tracker_.ShowResults();
116 base::MessageLoop::current()->QuitWhenIdle(); 116 base::MessageLoop::current()->QuitWhenIdle();
117 return true; 117 return true;
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); 372 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_);
373 DCHECK_NE(0u, set_result); 373 DCHECK_NE(0u, set_result);
374 #elif defined(OS_LINUX) 374 #elif defined(OS_LINUX)
375 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); 375 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_);
376 DCHECK_EQ(0, set_result); 376 DCHECK_EQ(0, set_result);
377 #endif 377 #endif
378 } 378 }
379 379
380 } // namespace test 380 } // namespace test
381 } // namespace IPC 381 } // namespace IPC
OLDNEW
« no previous file with comments | « base/pickle_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698