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

Unified Diff: ipc/ipc_fuzzing_tests.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_fuzzing_tests.cc
diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc
index 05d177b23dbfec47e6629894e9e0d70b5104e5ef..aa1fa5f7d6a0d93ef67752c9cb6ea8d13f31b830 100644
--- a/ipc/ipc_fuzzing_tests.cc
+++ b/ipc/ipc_fuzzing_tests.cc
@@ -44,7 +44,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferStr) {
EXPECT_TRUE(m.WriteInt(v1));
EXPECT_TRUE(m.WriteInt(v2));
- void* iter = NULL;
+ PickleIterator iter(m);
std::string vs;
EXPECT_FALSE(m.ReadString(&iter, &vs));
}
@@ -57,7 +57,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferWStr) {
EXPECT_TRUE(m.WriteInt(v1));
EXPECT_TRUE(m.WriteInt(v2));
- void* iter = NULL;
+ PickleIterator iter(m);
std::wstring vs;
EXPECT_FALSE(m.ReadWString(&iter, &vs));
}
@@ -68,7 +68,7 @@ TEST(IPCMessageIntegrity, ReadBytesBadIterator) {
EXPECT_TRUE(m.WriteInt(1));
EXPECT_TRUE(m.WriteInt(2));
- void* iter = NULL;
+ PickleIterator iter(m);
const char* data = NULL;
EXPECT_TRUE(m.ReadBytes(&iter, &data, sizeof(int)));
}
@@ -84,7 +84,7 @@ TEST(IPCMessageIntegrity, ReadVectorNegativeSize) {
EXPECT_TRUE(m.WriteInt(3));
std::vector<double> vec;
- void* iter = 0;
+ PickleIterator iter(m);
EXPECT_FALSE(ReadParam(&m, &iter, &vec));
}
@@ -97,7 +97,7 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge1) {
EXPECT_TRUE(m.WriteInt64(2));
std::vector<int64> vec;
- void* iter = 0;
+ PickleIterator iter(m);
EXPECT_FALSE(ReadParam(&m, &iter, &vec));
}
@@ -111,7 +111,7 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) {
EXPECT_TRUE(m.WriteInt64(2));
std::vector<int64> vec;
- void* iter = 0;
+ PickleIterator iter(m);
EXPECT_FALSE(ReadParam(&m, &iter, &vec));
}
@@ -212,7 +212,7 @@ class FuzzerClientListener : public SimpleListener {
return false;
int msg_value1 = 0;
int msg_value2 = 0;
- void* iter = NULL;
+ PickleIterator iter(*last_msg_);
if (!last_msg_->ReadInt(&iter, &msg_value1))
return false;
if (!last_msg_->ReadInt(&iter, &msg_value2))
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698