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

Unified Diff: net/http/http_status_code.cc

Issue 16622002: Generate constants for HTTP status codes and reason phrases using macro. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed stale comment Created 7 years, 6 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/http/http_status_code.cc
diff --git a/net/http/http_status_code.cc b/net/http/http_status_code.cc
index 462202b7272054c2886f0e46dc73d8f7642960d4..80d0265eea34fb6d29f59358db1b032017bedec2 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();
}

Powered by Google App Engine
This is Rietveld 408576698