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

Side by Side Diff: components/content_settings/core/browser/host_content_settings_map.cc

Issue 2776853002: Make UMA_HISTOGRAM_ENUMERATION work with scoped enums. (Closed)
Patch Set: rebase Created 3 years, 8 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/content_settings/core/browser/host_content_settings_map.h" 5 #include "components/content_settings/core/browser/host_content_settings_map.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 UMA_HISTOGRAM_ENUMERATION("ContentSettings.ExceptionScheme", scheme, 604 UMA_HISTOGRAM_ENUMERATION("ContentSettings.ExceptionScheme", scheme,
605 ContentSettingsPattern::SCHEME_MAX); 605 ContentSettingsPattern::SCHEME_MAX);
606 606
607 if (scheme == ContentSettingsPattern::SCHEME_FILE) { 607 if (scheme == ContentSettingsPattern::SCHEME_FILE) {
608 UMA_HISTOGRAM_BOOLEAN("ContentSettings.ExceptionSchemeFile.HasPath", 608 UMA_HISTOGRAM_BOOLEAN("ContentSettings.ExceptionSchemeFile.HasPath",
609 setting_entry.primary_pattern.HasPath()); 609 setting_entry.primary_pattern.HasPath());
610 size_t num_values; 610 size_t num_values;
611 int histogram_value = 611 int histogram_value =
612 ContentSettingTypeToHistogramValue(content_type, &num_values); 612 ContentSettingTypeToHistogramValue(content_type, &num_values);
613 if (setting_entry.primary_pattern.HasPath()) { 613 if (setting_entry.primary_pattern.HasPath()) {
614 UMA_HISTOGRAM_ENUMERATION( 614 UMA_HISTOGRAM_EXACT_LINEAR(
615 "ContentSettings.ExceptionSchemeFile.Type.WithPath", 615 "ContentSettings.ExceptionSchemeFile.Type.WithPath",
616 histogram_value, num_values); 616 histogram_value, num_values);
617 } else { 617 } else {
618 UMA_HISTOGRAM_ENUMERATION( 618 UMA_HISTOGRAM_EXACT_LINEAR(
619 "ContentSettings.ExceptionSchemeFile.Type.WithoutPath", 619 "ContentSettings.ExceptionSchemeFile.Type.WithoutPath",
620 histogram_value, num_values); 620 histogram_value, num_values);
621 } 621 }
622 } 622 }
623 623
624 if (setting_entry.source == "preference") 624 if (setting_entry.source == "preference")
625 ++num_exceptions; 625 ++num_exceptions;
626 } 626 }
627 627
628 std::string histogram_name = 628 std::string histogram_name =
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 if (primary_pattern) 914 if (primary_pattern)
915 *primary_pattern = rule.primary_pattern; 915 *primary_pattern = rule.primary_pattern;
916 if (secondary_pattern) 916 if (secondary_pattern)
917 *secondary_pattern = rule.secondary_pattern; 917 *secondary_pattern = rule.secondary_pattern;
918 return base::WrapUnique(rule.value.get()->DeepCopy()); 918 return base::WrapUnique(rule.value.get()->DeepCopy());
919 } 919 }
920 } 920 }
921 } 921 }
922 return std::unique_ptr<base::Value>(); 922 return std::unique_ptr<base::Value>();
923 } 923 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698