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: components/captive_portal/captive_portal_types.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "components/captive_portal/captive_portal_types.h" 5 #include "components/captive_portal/captive_portal_types.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h"
8 9
9 namespace captive_portal { 10 namespace captive_portal {
10 11
11 namespace { 12 namespace {
12 13
13 const char* const kCaptivePortalResultNames[] = { 14 const char* const kCaptivePortalResultNames[] = {
14 "InternetConnected", 15 "InternetConnected",
15 "NoResponse", 16 "NoResponse",
16 "BehindCaptivePortal", 17 "BehindCaptivePortal",
17 "NumCaptivePortalResults", 18 "NumCaptivePortalResults",
18 }; 19 };
19 static_assert(arraysize(kCaptivePortalResultNames) == RESULT_COUNT + 1, 20 static_assert(arraysize(kCaptivePortalResultNames) == RESULT_COUNT + 1,
20 "kCaptivePortalResultNames should have " 21 "kCaptivePortalResultNames should have "
21 "RESULT_COUNT + 1 elements"); 22 "RESULT_COUNT + 1 elements");
22 23
23 } // namespace 24 } // namespace
24 25
25 26
26 std::string CaptivePortalResultToString(CaptivePortalResult result) { 27 std::string CaptivePortalResultToString(CaptivePortalResult result) {
27 DCHECK_GE(result, 0); 28 DCHECK_GE(result, 0);
28 DCHECK_LT(static_cast<unsigned int>(result), 29 DCHECK_LT(static_cast<unsigned int>(result),
29 arraysize(kCaptivePortalResultNames)); 30 arraysize(kCaptivePortalResultNames));
30 return kCaptivePortalResultNames[result]; 31 return kCaptivePortalResultNames[result];
31 } 32 }
32 33
33 } // namespace captive_portal 34 } // namespace captive_portal
OLDNEW
« no previous file with comments | « components/captive_portal/captive_portal_testing_utils.h ('k') | components/cdm/browser/cdm_message_filter_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698