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

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

Issue 2960223002: Add missing schemes to RecordMainFrameNavigation (Closed)
Patch Set: Add Search Created 3 years, 5 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 | « no previous file | tools/metrics/histograms/enums.xml » ('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 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/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "url/gurl.h" 9 #include "url/gurl.h"
10 10
11 namespace { 11 namespace {
12 12
13 // This enum is used in building the histogram. So, this is append only, 13 // These values are written to logs. New enum values can be added, but existing
14 // any new scheme should be added at the end, before SCHEME_MAX 14 // enums must never be renumbered or deleted and reused. Any new scheme should
15 // be added at the end, before SCHEME_MAX.
15 enum Scheme { 16 enum Scheme {
16 SCHEME_UNKNOWN, 17 SCHEME_UNKNOWN = 0,
17 SCHEME_HTTP, 18 SCHEME_HTTP = 1,
18 SCHEME_HTTPS, 19 SCHEME_HTTPS = 2,
19 SCHEME_FILE, 20 SCHEME_FILE = 3,
20 SCHEME_FTP, 21 SCHEME_FTP = 4,
21 SCHEME_DATA, 22 SCHEME_DATA = 5,
22 SCHEME_JAVASCRIPT, 23 SCHEME_JAVASCRIPT = 6,
23 SCHEME_ABOUT, 24 SCHEME_ABOUT = 7,
24 SCHEME_CHROME, 25 SCHEME_CHROME = 8,
25 SCHEME_BLOB, 26 SCHEME_BLOB = 9,
26 SCHEME_FILESYSTEM, 27 SCHEME_FILESYSTEM = 10,
28 SCHEME_CHROMENATIVE = 11,
Mark P 2017/06/28 16:25:19 optional nit: SCHEME_CHROMENATIVE is hard to parse
elawrence 2017/06/28 17:03:40 Fixed, thanks.
29 SCHEME_CHROMESEARCH = 12,
27 SCHEME_MAX, 30 SCHEME_MAX,
28 }; 31 };
29 32
30 const char* const kSchemeNames[] = { 33 const char* const kSchemeNames[] = {
31 "unknown", 34 "unknown",
32 url::kHttpScheme, 35 url::kHttpScheme,
33 url::kHttpsScheme, 36 url::kHttpsScheme,
34 url::kFileScheme, 37 url::kFileScheme,
35 url::kFtpScheme, 38 url::kFtpScheme,
36 url::kDataScheme, 39 url::kDataScheme,
37 url::kJavaScriptScheme, 40 url::kJavaScriptScheme,
38 url::kAboutScheme, 41 url::kAboutScheme,
39 "chrome", 42 "chrome",
40 url::kBlobScheme, 43 url::kBlobScheme,
41 url::kFileSystemScheme, 44 url::kFileSystemScheme,
45 "chrome-native",
46 "chrome-search",
42 "max", 47 "max",
43 }; 48 };
44 49
45 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1, 50 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1,
46 "kSchemeNames should have SCHEME_MAX + 1 elements"); 51 "kSchemeNames should have SCHEME_MAX + 1 elements");
47 52
48 } // namespace 53 } // namespace
49 54
50 namespace navigation_metrics { 55 namespace navigation_metrics {
51 56
(...skipping 18 matching lines...) Expand all
70 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeOTR", scheme, 75 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeOTR", scheme,
71 SCHEME_MAX); 76 SCHEME_MAX);
72 if (!is_same_document) { 77 if (!is_same_document) {
73 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeDifferentPageOTR", 78 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeDifferentPageOTR",
74 scheme, SCHEME_MAX); 79 scheme, SCHEME_MAX);
75 } 80 }
76 } 81 }
77 } 82 }
78 83
79 } // namespace navigation_metrics 84 } // namespace navigation_metrics
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698