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

Unified Diff: chrome/browser/google_apis/test_server/http_response.cc

Issue 11275306: Revert 167627 - HTTP server for testing Google APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: chrome/browser/google_apis/test_server/http_response.cc
===================================================================
--- chrome/browser/google_apis/test_server/http_response.cc (revision 167628)
+++ chrome/browser/google_apis/test_server/http_response.cc (working copy)
@@ -1,57 +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 "chrome/browser/google_apis/test_server/http_response.h"
-
-#include <map>
-#include <string>
-
-#include "base/format_macros.h"
-#include "base/string_util.h"
-#include "base/stringprintf.h"
-
-namespace drive {
-namespace test_server {
-
-HttpResponse::HttpResponse() : code_(SUCCESS) {
-}
-
-HttpResponse::~HttpResponse() {
-}
-
-std::string HttpResponse::ToResponseString() const {
- // Response line with headers.
- std::string response_builder;
-
- // TODO(mtomasz): For http/1.0 requests, send http/1.0.
- // TODO(mtomasz): For different codes, send a corrent string instead of OK.
- base::StringAppendF(&response_builder, "HTTP/1.1 %d OK\r\n", code_);
- base::StringAppendF(&response_builder, "Connection: closed\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 (std::map<std::string, std::string>::const_iterator it =
- custom_headers_.begin();
- it != custom_headers_.end();
- ++it) {
- // Multi-line header value support.
- const std::string& header_name = it->first;
- const std::string& header_value = it->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 drive

Powered by Google App Engine
This is Rietveld 408576698