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

Unified Diff: net/test/embedded_test_server/http_response.cc

Issue 992733002: Remove //net (except for Android test stuff) and sdch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 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
Index: net/test/embedded_test_server/http_response.cc
diff --git a/net/test/embedded_test_server/http_response.cc b/net/test/embedded_test_server/http_response.cc
deleted file mode 100644
index 04155b5ffa529781480646dfa57f8a39caea081b..0000000000000000000000000000000000000000
--- a/net/test/embedded_test_server/http_response.cc
+++ /dev/null
@@ -1,58 +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/test/embedded_test_server/http_response.h"
-
-#include "base/format_macros.h"
-#include "base/logging.h"
-#include "base/strings/stringprintf.h"
-#include "net/http/http_status_code.h"
-
-namespace net {
-namespace test_server {
-
-HttpResponse::~HttpResponse() {
-}
-
-BasicHttpResponse::BasicHttpResponse() : code_(HTTP_OK) {
-}
-
-BasicHttpResponse::~BasicHttpResponse() {
-}
-
-std::string BasicHttpResponse::ToResponseString() const {
- // Response line with headers.
- std::string response_builder;
-
- std::string http_reason_phrase(GetHttpReasonPhrase(code_));
-
- // TODO(mtomasz): For http/1.0 requests, send http/1.0.
- base::StringAppendF(&response_builder,
- "HTTP/1.1 %d %s\r\n",
- code_,
- http_reason_phrase.c_str());
- base::StringAppendF(&response_builder, "Connection: close\r\n");
- base::StringAppendF(&response_builder,
- "Content-Length: %" PRIuS "\r\n",
- content_.size());
- base::StringAppendF(&response_builder,
- "Content-Type: %s\r\n",
- content_type_.c_str());
- for (size_t i = 0; i < custom_headers_.size(); ++i) {
- const std::string& header_name = custom_headers_[i].first;
- const std::string& header_value = custom_headers_[i].second;
- DCHECK(header_value.find_first_of("\n\r") == std::string::npos) <<
- "Malformed header value.";
- base::StringAppendF(&response_builder,
- "%s: %s\r\n",
- header_name.c_str(),
- header_value.c_str());
- }
- base::StringAppendF(&response_builder, "\r\n");
-
- return response_builder + content_;
-}
-
-} // namespace test_server
-} // namespace net
« no previous file with comments | « net/test/embedded_test_server/http_response.h ('k') | net/test/embedded_test_server/http_response_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698