Chromium Code Reviews| 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_REQUEST_H_ | 5 #ifndef NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ |
| 6 #define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ | 6 #define NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 | 14 |
| 15 namespace net { | 15 namespace net { |
| 16 | 16 |
| 17 class HttpChunkedDecoder; | 17 class HttpChunkedDecoder; |
| 18 | 18 |
| 19 namespace test_server { | 19 namespace test_server { |
| 20 | 20 |
| 21 // Methods of HTTP requests supported by the test HTTP server. | 21 // Methods of HTTP requests supported by the test HTTP server. |
| 22 enum HttpMethod { | 22 enum HttpMethod { |
| 23 METHOD_UNKNOWN, | 23 METHOD_UNKNOWN, |
| 24 METHOD_GET, | 24 METHOD_GET, |
| 25 METHOD_HEAD, | 25 METHOD_HEAD, |
| 26 METHOD_POST, | 26 METHOD_POST, |
| 27 METHOD_PUT, | 27 METHOD_PUT, |
| 28 METHOD_DELETE, | 28 METHOD_DELETE, |
| 29 METHOD_PATCH, | 29 METHOD_PATCH, |
| 30 METHOD_CONNECT, | |
|
davidben
2015/10/13 19:43:48
CONNECT is actually super-magical since you turn t
svaldez
2015/10/13 20:54:44
Don't know if a note is necessary, we already have
| |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 // Represents a HTTP request. Since it can be big, use scoped_ptr to pass it | 33 // Represents a HTTP request. Since it can be big, use scoped_ptr to pass it |
| 33 // instead of copying. However, the struct is copyable so tests can save and | 34 // instead of copying. However, the struct is copyable so tests can save and |
| 34 // examine a HTTP request. | 35 // examine a HTTP request. |
| 35 struct HttpRequest { | 36 struct HttpRequest { |
| 36 HttpRequest(); | 37 HttpRequest(); |
| 37 ~HttpRequest(); | 38 ~HttpRequest(); |
| 38 | 39 |
| 39 std::string relative_url; // Starts with '/'. Example: "/test?query=foo" | 40 std::string relative_url; // Starts with '/'. Example: "/test?query=foo" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 | 114 |
| 114 scoped_ptr<HttpChunkedDecoder> chunked_decoder_; | 115 scoped_ptr<HttpChunkedDecoder> chunked_decoder_; |
| 115 | 116 |
| 116 DISALLOW_COPY_AND_ASSIGN(HttpRequestParser); | 117 DISALLOW_COPY_AND_ASSIGN(HttpRequestParser); |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 } // namespace test_server | 120 } // namespace test_server |
| 120 } // namespace net | 121 } // namespace net |
| 121 | 122 |
| 122 #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ | 123 #endif // NET_TEST_EMBEDDED_TEST_SERVER_HTTP_REQUEST_H_ |
| OLD | NEW |