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

Side by Side Diff: components/navigation_metrics/navigation_metrics.cc

Issue 794683005: replace COMPILE_ASSERT with static_assert in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: formatting fixup 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/navigation_metrics/navigation_metrics.h" 5 #include "components/navigation_metrics/navigation_metrics.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "url/gurl.h" 8 #include "url/gurl.h"
9 9
10 namespace { 10 namespace {
(...skipping 17 matching lines...) Expand all
28 url::kHttpsScheme, 28 url::kHttpsScheme,
29 url::kFileScheme, 29 url::kFileScheme,
30 url::kFtpScheme, 30 url::kFtpScheme,
31 url::kDataScheme, 31 url::kDataScheme,
32 url::kJavaScriptScheme, 32 url::kJavaScriptScheme,
33 url::kAboutScheme, 33 url::kAboutScheme,
34 "chrome", 34 "chrome",
35 "max", 35 "max",
36 }; 36 };
37 37
38 COMPILE_ASSERT(arraysize(kSchemeNames) == SCHEME_MAX + 1, 38 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1,
39 NavigationMetricsRecorder_name_count_mismatch); 39 "kSchemeNames should have SCHEME_MAX + 1 elements");
40 40
41 } // namespace 41 } // namespace
42 42
43 namespace navigation_metrics { 43 namespace navigation_metrics {
44 44
45 void RecordMainFrameNavigation(const GURL& url, bool is_in_page) { 45 void RecordMainFrameNavigation(const GURL& url, bool is_in_page) {
46 Scheme scheme = SCHEME_UNKNOWN; 46 Scheme scheme = SCHEME_UNKNOWN;
47 for (int i = 1; i < SCHEME_MAX; ++i) { 47 for (int i = 1; i < SCHEME_MAX; ++i) {
48 if (url.SchemeIs(kSchemeNames[i])) { 48 if (url.SchemeIs(kSchemeNames[i])) {
49 scheme = static_cast<Scheme>(i); 49 scheme = static_cast<Scheme>(i);
50 break; 50 break;
51 } 51 }
52 } 52 }
53 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX); 53 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX);
54 if (!is_in_page) { 54 if (!is_in_page) {
55 UMA_HISTOGRAM_ENUMERATION( 55 UMA_HISTOGRAM_ENUMERATION(
56 "Navigation.MainFrameSchemeDifferentPage", scheme, SCHEME_MAX); 56 "Navigation.MainFrameSchemeDifferentPage", scheme, SCHEME_MAX);
57 } 57 }
58 } 58 }
59 59
60 } // namespace navigation_metrics 60 } // namespace navigation_metrics
OLDNEW
« no previous file with comments | « components/nacl/loader/nonsfi/nonsfi_sandbox.cc ('k') | components/omnibox/autocomplete_match.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698