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

Unified Diff: net/tools/quic/quic_reliable_server_stream.cc

Issue 111073003: Cleanup of QUIC stream classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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/tools/quic/quic_reliable_server_stream.h ('k') | net/tools/quic/quic_reliable_server_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/quic_reliable_server_stream.cc
diff --git a/net/tools/quic/quic_reliable_server_stream.cc b/net/tools/quic/quic_reliable_server_stream.cc
deleted file mode 100644
index 58b884a1082562566f921b3972a7d45e02084de1..0000000000000000000000000000000000000000
--- a/net/tools/quic/quic_reliable_server_stream.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) 2012 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/tools/quic/quic_reliable_server_stream.h"
-
-#include "base/logging.h"
-#include "base/memory/singleton.h"
-#include "net/tools/quic/quic_in_memory_cache.h"
-
-using base::StringPiece;
-
-namespace net {
-namespace tools {
-
-QuicReliableServerStream::QuicReliableServerStream(QuicStreamId id,
- QuicSession* session)
- : ReliableQuicStream(id, session) {
-}
-
-
-void QuicReliableServerStream::SendResponse() {
- // Find response in cache. If not found, send error response.
- const QuicInMemoryCache::Response* response =
- QuicInMemoryCache::GetInstance()->GetResponse(headers_);
- if (response == NULL) {
- SendErrorResponse();
- return;
- }
-
- DLOG(INFO) << "Sending response for stream " << id();
- SendHeaders(response->headers());
- WriteData(response->body(), true);
-}
-
-void QuicReliableServerStream::SendErrorResponse() {
- DLOG(INFO) << "Sending error response for stream " << id();
- BalsaHeaders headers;
- headers.SetResponseFirstlineFromStringPieces(
- "HTTP/1.1", "500", "Server Error");
- headers.ReplaceOrAppendHeader("content-length", "3");
- SendHeaders(headers);
- WriteData("bad", true);
-}
-
-QuicConsumedData QuicReliableServerStream::WriteData(StringPiece data,
- bool fin) {
- // We only support SPDY and HTTP, and neither handles bidirectional streaming.
- if (!read_side_closed()) {
- CloseReadSide();
- }
- return ReliableQuicStream::WriteData(data, fin);
-}
-
-} // namespace tools
-} // namespace net
« no previous file with comments | « net/tools/quic/quic_reliable_server_stream.h ('k') | net/tools/quic/quic_reliable_server_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698