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

Side by Side Diff: chrome/browser/prefs/proxy_prefs.cc

Issue 815363002: replace COMPILE_ASSERT with static_assert in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 12 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/prefs/proxy_prefs.h" 5 #include "chrome/browser/prefs/proxy_prefs.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace ProxyPrefs { 10 namespace ProxyPrefs {
11 11
12 namespace { 12 namespace {
13 13
14 // These names are exposed to the proxy extension API. They must be in sync 14 // These names are exposed to the proxy extension API. They must be in sync
15 // with the constants of ProxyPrefs. 15 // with the constants of ProxyPrefs.
16 const char* kProxyModeNames[] = { kDirectProxyModeName, 16 const char* kProxyModeNames[] = { kDirectProxyModeName,
17 kAutoDetectProxyModeName, 17 kAutoDetectProxyModeName,
18 kPacScriptProxyModeName, 18 kPacScriptProxyModeName,
19 kFixedServersProxyModeName, 19 kFixedServersProxyModeName,
20 kSystemProxyModeName }; 20 kSystemProxyModeName };
21 21
22 COMPILE_ASSERT(arraysize(kProxyModeNames) == kModeCount, 22 static_assert(arraysize(kProxyModeNames) == kModeCount,
23 kProxyModeNames_must_have_size_of_NUM_MODES); 23 "kProxyModeNames must have kModeCount elements");
24 24
25 } // namespace 25 } // namespace
26 26
27 const char kDirectProxyModeName[] = "direct"; 27 const char kDirectProxyModeName[] = "direct";
28 const char kAutoDetectProxyModeName[] = "auto_detect"; 28 const char kAutoDetectProxyModeName[] = "auto_detect";
29 const char kPacScriptProxyModeName[] = "pac_script"; 29 const char kPacScriptProxyModeName[] = "pac_script";
30 const char kFixedServersProxyModeName[] = "fixed_servers"; 30 const char kFixedServersProxyModeName[] = "fixed_servers";
31 const char kSystemProxyModeName[] = "system"; 31 const char kSystemProxyModeName[] = "system";
32 32
33 bool IntToProxyMode(int in_value, ProxyMode* out_value) { 33 bool IntToProxyMode(int in_value, ProxyMode* out_value) {
(...skipping 30 matching lines...) Expand all
64 case CONFIG_FALLBACK: 64 case CONFIG_FALLBACK:
65 return "config_fallback"; 65 return "config_fallback";
66 case CONFIG_UNSET: 66 case CONFIG_UNSET:
67 return "config_unset"; 67 return "config_unset";
68 } 68 }
69 NOTREACHED(); 69 NOTREACHED();
70 return ""; 70 return "";
71 } 71 }
72 72
73 } // namespace ProxyPrefs 73 } // namespace ProxyPrefs
OLDNEW
« no previous file with comments | « chrome/browser/predictors/autocomplete_action_predictor.cc ('k') | chrome/browser/prerender/prerender_events.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698