summaryrefslogtreecommitdiffstats
path: root/net/http/http_status_code.cc
diff options
context:
space:
mode:
authortyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-10 13:18:49 +0000
committertyoshino@chromium.org <tyoshino@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-10 13:18:49 +0000
commit6d19b3c794ae1aec96b81e100545669b3bf738eb (patch)
tree9c1aeddc31db89172063047074be96a406d8d167 /net/http/http_status_code.cc
parent5c2f1afed3ed0c311ad9988b958f11bdbaca09dc (diff)
downloadchromium_src-6d19b3c794ae1aec96b81e100545669b3bf738eb.zip
chromium_src-6d19b3c794ae1aec96b81e100545669b3bf738eb.tar.gz
chromium_src-6d19b3c794ae1aec96b81e100545669b3bf738eb.tar.bz2
Generate constants for HTTP status codes and reason phrases using macro.
Review URL: https://chromiumcodereview.appspot.com/16622002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205202 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_status_code.cc')
-rw-r--r--net/http/http_status_code.cc21
1 files changed, 5 insertions, 16 deletions
diff --git a/net/http/http_status_code.cc b/net/http/http_status_code.cc
index 462202b..80d0265e 100644
--- a/net/http/http_status_code.cc
+++ b/net/http/http_status_code.cc
@@ -10,22 +10,11 @@ namespace net {
const char* GetHttpReasonPhrase(HttpStatusCode code) {
switch (code) {
- case HTTP_CONTINUE:
- return "Continue";
- case HTTP_OK:
- return "OK";
- case HTTP_PARTIAL_CONTENT:
- return "Partial Content";
- case HTTP_FORBIDDEN:
- return "Forbidden";
- case HTTP_NOT_FOUND:
- return "Not Found";
- case HTTP_METHOD_NOT_ALLOWED:
- return "Method Not Allowed";
- case HTTP_REQUESTED_RANGE_NOT_SATISFIABLE:
- return "Range Not Satisfiable";
- case HTTP_INTERNAL_SERVER_ERROR:
- return "Internal Server Error";
+
+#define HTTP_STATUS(label, code, reason) case HTTP_ ## label: return reason;
+#include "net/http/http_status_code_list.h"
+#undef HTTP_STATUS
+
default:
NOTREACHED();
}