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

Side by Side Diff: net/http/http_auth.cc

Issue 826973002: replace COMPILE_ASSERT with static_assert in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply fixups Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « net/dns/dns_session.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/dns/dns_session.cc ('k') | net/http/http_cache_transaction.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698