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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 1466493002: Remove unused SpdyTestUtil methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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 | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index f43d098b886c3d3359287ac46db10940b4836400..27b81175723788fff3c678bb5b571d5cd1c2db06 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -64,51 +64,21 @@ NextProtoVector SpdyNextProtos() {
}
// Chop a frame into an array of MockWrites.
-// |data| is the frame to chop.
-// |length| is the length of the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockWrite* ChopWriteFrame(const char* data, int length, int num_chunks) {
- MockWrite* chunks = new MockWrite[num_chunks];
- int chunk_size = length / num_chunks;
- for (int index = 0; index < num_chunks; index++) {
- const char* ptr = data + (index * chunk_size);
- if (index == num_chunks - 1)
- chunk_size += length % chunk_size; // The last chunk takes the remainder.
- chunks[index] = MockWrite(ASYNC, ptr, chunk_size);
- }
- return chunks;
-}
-
-// Chop a SpdyFrame into an array of MockWrites.
// |frame| is the frame to chop.
// |num_chunks| is the number of chunks to create.
MockWrite* ChopWriteFrame(const SpdyFrame& frame, int num_chunks) {
- return ChopWriteFrame(frame.data(), frame.size(), num_chunks);
-}
-
-// Chop a frame into an array of MockReads.
-// |data| is the frame to chop.
-// |length| is the length of the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockRead* ChopReadFrame(const char* data, int length, int num_chunks) {
- MockRead* chunks = new MockRead[num_chunks];
- int chunk_size = length / num_chunks;
+ MockWrite* chunks = new MockWrite[num_chunks];
+ int chunk_size = frame.size() / num_chunks;
for (int index = 0; index < num_chunks; index++) {
- const char* ptr = data + (index * chunk_size);
+ const char* ptr = frame.data() + (index * chunk_size);
if (index == num_chunks - 1)
- chunk_size += length % chunk_size; // The last chunk takes the remainder.
- chunks[index] = MockRead(ASYNC, ptr, chunk_size);
+ chunk_size +=
+ frame.size() % chunk_size; // The last chunk takes the remainder.
+ chunks[index] = MockWrite(ASYNC, ptr, chunk_size);
}
return chunks;
}
-// Chop a SpdyFrame into an array of MockReads.
-// |frame| is the frame to chop.
-// |num_chunks| is the number of chunks to create.
-MockRead* ChopReadFrame(const SpdyFrame& frame, int num_chunks) {
- return ChopReadFrame(frame.data(), frame.size(), num_chunks);
-}
-
// Adds headers and values to a map.
// |extra_headers| is an array of { name, value } pairs, arranged as strings
// where the even entries are the header names, and the odd entries are the
@@ -1306,22 +1276,6 @@ void SpdyTestUtil::UpdateWithStreamDestruction(int stream_id) {
NOTREACHED();
}
-const SpdyHeaderInfo SpdyTestUtil::MakeSpdyHeader(SpdyFrameType type) {
- const SpdyHeaderInfo kHeader = {
- type,
- 1, // Stream ID
- 0, // Associated stream ID
- ConvertRequestPriorityToSpdyPriority(LOWEST, spdy_version_),
- CONTROL_FLAG_FIN, // Control Flags
- false, // Compressed
- RST_STREAM_INVALID,
- NULL, // Data
- 0, // Length
- DATA_FLAG_NONE
- };
- return kHeader;
-}
-
scoped_ptr<SpdyFramer> SpdyTestUtil::CreateFramer(bool compressed) const {
scoped_ptr<SpdyFramer> framer(new SpdyFramer(spdy_version_));
framer->set_enable_compression(compressed);
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698