| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_RESPONSE_H_ | 5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_RESPONSE_H_ |
| 6 #define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_RESPONSE_H_ | 6 #define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_RESPONSE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | |
| 11 | 10 |
| 12 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 13 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/strings/string_split.h" |
| 14 #include "net/http/http_status_code.h" | 14 #include "net/http/http_status_code.h" |
| 15 | 15 |
| 16 namespace net { | 16 namespace net { |
| 17 namespace test_server { | 17 namespace test_server { |
| 18 | 18 |
| 19 // Interface for HTTP response implementations. | 19 // Interface for HTTP response implementations. |
| 20 class HttpResponse{ | 20 class HttpResponse{ |
| 21 public: | 21 public: |
| 22 virtual ~HttpResponse(); | 22 virtual ~HttpResponse(); |
| 23 | 23 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 53 custom_headers_.push_back(std::make_pair(key, value)); | 53 custom_headers_.push_back(std::make_pair(key, value)); |
| 54 } | 54 } |
| 55 | 55 |
| 56 // Generates and returns a http response string. | 56 // Generates and returns a http response string. |
| 57 std::string ToResponseString() const override; | 57 std::string ToResponseString() const override; |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 HttpStatusCode code_; | 60 HttpStatusCode code_; |
| 61 std::string content_; | 61 std::string content_; |
| 62 std::string content_type_; | 62 std::string content_type_; |
| 63 std::vector<std::pair<std::string, std::string> > custom_headers_; | 63 base::StringPairs custom_headers_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(BasicHttpResponse); | 65 DISALLOW_COPY_AND_ASSIGN(BasicHttpResponse); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace test_server | 68 } // namespace test_server |
| 69 } // namespace net | 69 } // namespace net |
| 70 | 70 |
| 71 #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_RESPONSE_H_ | 71 #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_RESPONSE_H_ |
| OLD | NEW |