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

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

Issue 2476993002: Add filesystem scheme to navigation histograms. (Closed)
Patch Set: Created 4 years, 1 month 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/histograms.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.h" 8 #include "base/metrics/histogram.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 // This enum is used in building the histogram. So, this is append only,
14 // any new scheme should be added at the end, before SCHEME_MAX 14 // any new scheme should be added at the end, before SCHEME_MAX
15 enum Scheme { 15 enum Scheme {
16 SCHEME_UNKNOWN, 16 SCHEME_UNKNOWN,
17 SCHEME_HTTP, 17 SCHEME_HTTP,
18 SCHEME_HTTPS, 18 SCHEME_HTTPS,
19 SCHEME_FILE, 19 SCHEME_FILE,
20 SCHEME_FTP, 20 SCHEME_FTP,
21 SCHEME_DATA, 21 SCHEME_DATA,
22 SCHEME_JAVASCRIPT, 22 SCHEME_JAVASCRIPT,
23 SCHEME_ABOUT, 23 SCHEME_ABOUT,
24 SCHEME_CHROME, 24 SCHEME_CHROME,
25 SCHEME_BLOB, 25 SCHEME_BLOB,
26 SCHEME_FILESYSTEM,
26 SCHEME_MAX, 27 SCHEME_MAX,
27 }; 28 };
28 29
29 const char* const kSchemeNames[] = { 30 const char* const kSchemeNames[] = {
30 "unknown", 31 "unknown",
31 url::kHttpScheme, 32 url::kHttpScheme,
32 url::kHttpsScheme, 33 url::kHttpsScheme,
33 url::kFileScheme, 34 url::kFileScheme,
34 url::kFtpScheme, 35 url::kFtpScheme,
35 url::kDataScheme, 36 url::kDataScheme,
36 url::kJavaScriptScheme, 37 url::kJavaScriptScheme,
37 url::kAboutScheme, 38 url::kAboutScheme,
38 "chrome", 39 "chrome",
39 url::kBlobScheme, 40 url::kBlobScheme,
40 "max", 41 url::kFileSystemScheme,
42 "max",
Ilya Sherman 2016/11/04 18:34:30 nit: By the way, I don't think the indentation adj
meacer 2016/11/04 19:11:46 I used git cl format. Should the correct indentati
Ilya Sherman 2016/11/05 00:29:00 Yeah, I would have expected 2 spaces. But, if thi
41 }; 43 };
42 44
43 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1, 45 static_assert(arraysize(kSchemeNames) == SCHEME_MAX + 1,
44 "kSchemeNames should have SCHEME_MAX + 1 elements"); 46 "kSchemeNames should have SCHEME_MAX + 1 elements");
45 47
46 } // namespace 48 } // namespace
47 49
48 namespace navigation_metrics { 50 namespace navigation_metrics {
49 51
50 void RecordMainFrameNavigation(const GURL& url, 52 void RecordMainFrameNavigation(const GURL& url,
(...skipping 19 matching lines...) Expand all
70 } 72 }
71 73
72 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX); 74 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameScheme", scheme, SCHEME_MAX);
73 if (!is_in_page) { 75 if (!is_in_page) {
74 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeDifferentPage", scheme, 76 UMA_HISTOGRAM_ENUMERATION("Navigation.MainFrameSchemeDifferentPage", scheme,
75 SCHEME_MAX); 77 SCHEME_MAX);
76 } 78 }
77 } 79 }
78 80
79 } // namespace navigation_metrics 81 } // namespace navigation_metrics
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698