| 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/strings/string_tokenizer.h" | 10 #include "base/strings/string_tokenizer.h" |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // static | 130 // static |
| 131 const char* HttpAuth::SchemeToString(Scheme scheme) { | 131 const char* HttpAuth::SchemeToString(Scheme scheme) { |
| 132 static const char* const kSchemeNames[] = { | 132 static const char* const kSchemeNames[] = { |
| 133 "basic", | 133 "basic", |
| 134 "digest", | 134 "digest", |
| 135 "ntlm", | 135 "ntlm", |
| 136 "negotiate", | 136 "negotiate", |
| 137 "spdyproxy", | 137 "spdyproxy", |
| 138 "mock", | 138 "mock", |
| 139 }; | 139 }; |
| 140 COMPILE_ASSERT(arraysize(kSchemeNames) == AUTH_SCHEME_MAX, | 140 static_assert(arraysize(kSchemeNames) == AUTH_SCHEME_MAX, |
| 141 http_auth_scheme_names_incorrect_size); | 141 "http auth scheme names incorrect size"); |
| 142 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) { | 142 if (scheme < AUTH_SCHEME_BASIC || scheme >= AUTH_SCHEME_MAX) { |
| 143 NOTREACHED(); | 143 NOTREACHED(); |
| 144 return "invalid_scheme"; | 144 return "invalid_scheme"; |
| 145 } | 145 } |
| 146 return kSchemeNames[scheme]; | 146 return kSchemeNames[scheme]; |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace net | 149 } // namespace net |
| OLD | NEW |