diff options
Diffstat (limited to 'chrome/browser/renderer_host/buffered_resource_handler.cc')
-rw-r--r-- | chrome/browser/renderer_host/buffered_resource_handler.cc | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/chrome/browser/renderer_host/buffered_resource_handler.cc b/chrome/browser/renderer_host/buffered_resource_handler.cc index f3ca82f..6cf4430 100644 --- a/chrome/browser/renderer_host/buffered_resource_handler.cc +++ b/chrome/browser/renderer_host/buffered_resource_handler.cc @@ -30,18 +30,23 @@ const int kMaxBytesToSniff = 512; void RecordSnifferMetrics(bool sniffing_blocked, bool we_would_like_to_sniff, const std::string& mime_type) { - static BooleanHistogram nosniff_usage("nosniff.usage"); - nosniff_usage.SetFlags(kUmaTargetedHistogramFlag); - nosniff_usage.AddBoolean(sniffing_blocked); + static scoped_refptr<Histogram> nosniff_usage = + BooleanHistogram::BooleanHistogramFactoryGet("nosniff.usage"); + nosniff_usage->SetFlags(kUmaTargetedHistogramFlag); + nosniff_usage->AddBoolean(sniffing_blocked); if (sniffing_blocked) { - static BooleanHistogram nosniff_otherwise("nosniff.otherwise"); - nosniff_otherwise.SetFlags(kUmaTargetedHistogramFlag); - nosniff_otherwise.AddBoolean(we_would_like_to_sniff); - - static BooleanHistogram nosniff_empty_mime_type("nosniff.empty_mime_type"); - nosniff_empty_mime_type.SetFlags(kUmaTargetedHistogramFlag); - nosniff_empty_mime_type.AddBoolean(mime_type.empty()); + static scoped_refptr<Histogram> nosniff_otherwise = + BooleanHistogram::BooleanHistogramFactoryGet( + "nosniff.otherwise"); + nosniff_otherwise->SetFlags(kUmaTargetedHistogramFlag); + nosniff_otherwise->AddBoolean(we_would_like_to_sniff); + + static scoped_refptr<Histogram> nosniff_empty_mime_type = + BooleanHistogram::BooleanHistogramFactoryGet( + "nosniff.empty_mime_type"); + nosniff_empty_mime_type->SetFlags(kUmaTargetedHistogramFlag); + nosniff_empty_mime_type->AddBoolean(mime_type.empty()); } } |