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

Unified Diff: net/spdy/spdy_websocket_test_util.cc

Issue 358493002: Land recent SPDY changes (through 70021377) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase on code-review-feedback updates. Created 6 years, 6 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 | « net/spdy/spdy_test_util_common.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_websocket_test_util.cc
diff --git a/net/spdy/spdy_websocket_test_util.cc b/net/spdy/spdy_websocket_test_util.cc
index 5e79020c21a9084ff53f0bbda43ac604a9b25772..b1ef81b281815974159dff70e47f57224410220e 100644
--- a/net/spdy/spdy_websocket_test_util.cc
+++ b/net/spdy/spdy_websocket_test_util.cc
@@ -9,10 +9,7 @@
namespace net {
-const int kDefaultAssociatedStreamId = 0;
const bool kDefaultCompressed = false;
-const char* const kDefaultDataPointer = NULL;
-const uint32 kDefaultDataLength = 0;
SpdyWebSocketTestUtil::SpdyWebSocketTestUtil(
NextProto protocol) : spdy_util_(protocol) {}
@@ -41,76 +38,30 @@ SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketSynStream(
SetHeader("version", "WebSocket/13", headers.get());
SetHeader("scheme", "ws", headers.get());
SetHeader("origin", origin, headers.get());
- return spdy_util_.ConstructSpdyControlFrame(headers.Pass(),
- /*compressed*/ false,
- stream_id,
- HIGHEST,
- SYN_STREAM,
- CONTROL_FLAG_NONE,
- 0);
+ return spdy_util_.ConstructSpdySyn(
+ stream_id, *headers, HIGHEST, false, false);
}
SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketSynReply(
int stream_id) {
- scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock());
- SetHeader("status", "101", headers.get());
- return spdy_util_.ConstructSpdyControlFrame(headers.Pass(),
- false,
- stream_id,
- LOWEST,
- SYN_REPLY,
- CONTROL_FLAG_NONE,
- 0);
+ SpdyHeaderBlock block;
+ SetHeader("status", "101", &block);
+ return spdy_util_.ConstructSpdyReply(stream_id, block);
}
SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketHandshakeRequestFrame(
scoped_ptr<SpdyHeaderBlock> headers,
SpdyStreamId stream_id,
RequestPriority request_priority) {
- // SPDY SYN_STREAM control frame header.
- const SpdyHeaderInfo kSynStreamHeader = {
- SYN_STREAM,
- stream_id,
- kDefaultAssociatedStreamId,
- ConvertRequestPriorityToSpdyPriority(request_priority, SPDY2),
- kSpdyCredentialSlotUnused,
- CONTROL_FLAG_NONE,
- kDefaultCompressed,
- RST_STREAM_INVALID,
- kDefaultDataPointer,
- kDefaultDataLength,
- DATA_FLAG_NONE
- };
-
- // Construct SPDY SYN_STREAM control frame.
- return spdy_util_.ConstructSpdyFrame(
- kSynStreamHeader,
- headers.Pass());
+ return spdy_util_.ConstructSpdySyn(
+ stream_id, *headers, request_priority, kDefaultCompressed, false);
}
SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketHandshakeResponseFrame(
scoped_ptr<SpdyHeaderBlock> headers,
SpdyStreamId stream_id,
RequestPriority request_priority) {
- // SPDY SYN_REPLY control frame header.
- const SpdyHeaderInfo kSynReplyHeader = {
- SYN_REPLY,
- stream_id,
- kDefaultAssociatedStreamId,
- ConvertRequestPriorityToSpdyPriority(request_priority, SPDY2),
- kSpdyCredentialSlotUnused,
- CONTROL_FLAG_NONE,
- kDefaultCompressed,
- RST_STREAM_INVALID,
- kDefaultDataPointer,
- kDefaultDataLength,
- DATA_FLAG_NONE
- };
-
- // Construct SPDY SYN_REPLY control frame.
- return spdy_util_.ConstructSpdyFrame(
- kSynReplyHeader,
- headers.Pass());
+ return spdy_util_.ConstructSpdyReply(stream_id, *headers);
}
SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketHeadersFrame(
@@ -121,13 +72,7 @@ SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketHeadersFrame(
SetHeader("opcode", "1", headers.get()); // text frame
SetHeader("length", length, headers.get());
SetHeader("fin", fin ? "1" : "0", headers.get());
- return spdy_util_.ConstructSpdyControlFrame(headers.Pass(),
- /*compression*/ false,
- stream_id,
- LOWEST,
- HEADERS,
- CONTROL_FLAG_NONE,
- 0);
+ return spdy_util_.ConstructSpdySyn(stream_id, *headers, LOWEST, false, false);
}
SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketDataFrame(
« no previous file with comments | « net/spdy/spdy_test_util_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698