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

Unified Diff: net/spdy/spdy_websocket_test_util.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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_websocket_test_util.h ('k') | net/ssl/ssl_cipher_suite_names.h » ('j') | 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
deleted file mode 100644
index b1ef81b281815974159dff70e47f57224410220e..0000000000000000000000000000000000000000
--- a/net/spdy/spdy_websocket_test_util.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "net/spdy/spdy_websocket_test_util.h"
-
-#include "net/spdy/buffered_spdy_framer.h"
-#include "net/spdy/spdy_http_utils.h"
-
-namespace net {
-
-const bool kDefaultCompressed = false;
-
-SpdyWebSocketTestUtil::SpdyWebSocketTestUtil(
- NextProto protocol) : spdy_util_(protocol) {}
-
-std::string SpdyWebSocketTestUtil::GetHeader(const SpdyHeaderBlock& headers,
- const std::string& key) const {
- SpdyHeaderBlock::const_iterator it = headers.find(GetHeaderKey(key));
- return (it == headers.end()) ? "" : it->second;
-}
-
-void SpdyWebSocketTestUtil::SetHeader(
- const std::string& key,
- const std::string& value,
- SpdyHeaderBlock* headers) const {
- (*headers)[GetHeaderKey(key)] = value;
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketSynStream(
- int stream_id,
- const char* path,
- const char* host,
- const char* origin) {
- scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock());
- SetHeader("path", path, headers.get());
- SetHeader("host", host, headers.get());
- SetHeader("version", "WebSocket/13", headers.get());
- SetHeader("scheme", "ws", headers.get());
- SetHeader("origin", origin, headers.get());
- return spdy_util_.ConstructSpdySyn(
- stream_id, *headers, HIGHEST, false, false);
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketSynReply(
- int stream_id) {
- 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) {
- return spdy_util_.ConstructSpdySyn(
- stream_id, *headers, request_priority, kDefaultCompressed, false);
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketHandshakeResponseFrame(
- scoped_ptr<SpdyHeaderBlock> headers,
- SpdyStreamId stream_id,
- RequestPriority request_priority) {
- return spdy_util_.ConstructSpdyReply(stream_id, *headers);
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketHeadersFrame(
- int stream_id,
- const char* length,
- bool fin) {
- scoped_ptr<SpdyHeaderBlock> headers(new SpdyHeaderBlock());
- SetHeader("opcode", "1", headers.get()); // text frame
- SetHeader("length", length, headers.get());
- SetHeader("fin", fin ? "1" : "0", headers.get());
- return spdy_util_.ConstructSpdySyn(stream_id, *headers, LOWEST, false, false);
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdyWebSocketDataFrame(
- const char* data,
- int len,
- SpdyStreamId stream_id,
- bool fin) {
-
- // Construct SPDY data frame.
- BufferedSpdyFramer framer(spdy_util_.spdy_version(), false);
- return framer.CreateDataFrame(
- stream_id,
- data,
- len,
- fin ? DATA_FLAG_FIN : DATA_FLAG_NONE);
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdySettings(
- const SettingsMap& settings) const {
- return spdy_util_.ConstructSpdySettings(settings);
-}
-
-SpdyFrame* SpdyWebSocketTestUtil::ConstructSpdySettingsAck() const {
- return spdy_util_.ConstructSpdySettingsAck();
-}
-
-SpdyMajorVersion SpdyWebSocketTestUtil::spdy_version() const {
- return spdy_util_.spdy_version();
-}
-
-std::string SpdyWebSocketTestUtil::GetHeaderKey(
- const std::string& key) const {
- return (spdy_util_.is_spdy2() ? "" : ":") + key;
-}
-
-} // namespace net
« no previous file with comments | « net/spdy/spdy_websocket_test_util.h ('k') | net/ssl/ssl_cipher_suite_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698