| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "net/http/http_auth.h" | 5 #include "net/http/http_auth.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 } | 176 } |
| 177 | 177 |
| 178 // static | 178 // static |
| 179 const char* HttpAuth::SchemeToString(Scheme scheme) { | 179 const char* HttpAuth::SchemeToString(Scheme scheme) { |
| 180 static const char* const kSchemeNames[] = { | 180 static const char* const kSchemeNames[] = { |
| 181 "basic", | 181 "basic", |
| 182 "digest", | 182 "digest", |
| 183 "ntlm", | 183 "ntlm", |
| 184 "negotiate", | 184 "negotiate", |
| 185 "spdyproxy", |
| 185 "mock", | 186 "mock", |
| 186 }; | 187 }; |
| 187 COMPILE_ASSERT(arraysize(kSchemeNames) == AUTH_SCHEME_MAX, | 188 COMPILE_ASSERT(arraysize(kSchemeNames) == AUTH_SCHEME_MAX, |
| 188 http_auth_scheme_names_incorrect_size); | 189 http_auth_scheme_names_incorrect_size); |
| 189 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) { | 190 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) { |
| 190 NOTREACHED(); | 191 NOTREACHED(); |
| 191 return "invalid_scheme"; | 192 return "invalid_scheme"; |
| 192 } | 193 } |
| 193 return kSchemeNames[scheme]; | 194 return kSchemeNames[scheme]; |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace net | 197 } // namespace net |
| OLD | NEW |