1 // Copyright 2013 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "net/http/http_status_code.h" 6 7 #include <ostream> 8 9 #include "base/notreached.h" 10 11 namespace net { 12 GetHttpReasonPhrase(HttpStatusCode code)13const char* GetHttpReasonPhrase(HttpStatusCode code) { 14 switch (code) { 15 #define HTTP_STATUS_ENUM_VALUE(label, code, reason) \ 16 case HTTP_##label: \ 17 return reason; 18 #include "net/http/http_status_code_list.h" 19 #undef HTTP_STATUS_ENUM_VALUE 20 21 default: 22 NOTREACHED() << "unknown HTTP status code " << code; 23 } 24 25 return ""; 26 } 27 28 } // namespace net 29