diff options
-rw-r--r-- | chrome/browser/net/url_info.cc | 4 | ||||
-rw-r--r-- | content/browser/renderer_host/buffered_resource_handler.cc | 6 | ||||
-rw-r--r-- | net/base/mime_sniffer.cc | 16 | ||||
-rw-r--r-- | net/disk_cache/histogram_macros.h | 8 |
4 files changed, 17 insertions, 17 deletions
diff --git a/chrome/browser/net/url_info.cc b/chrome/browser/net/url_info.cc index cc02165..3ed81a1 100644 --- a/chrome/browser/net/url_info.cc +++ b/chrome/browser/net/url_info.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -120,7 +120,7 @@ void UrlInfo::RemoveFromQueue() { } // Make a custom linear histogram for the region from 0 to boundary. const size_t kBucketCount = 52; - static scoped_refptr<base::Histogram> histogram = + scoped_refptr<base::Histogram> histogram = base::LinearHistogram::FactoryTimeGet( "DNS.QueueRecycledUnder2", TimeDelta(), kBoundary, kBucketCount, base::Histogram::kUmaTargetedHistogramFlag); diff --git a/content/browser/renderer_host/buffered_resource_handler.cc b/content/browser/renderer_host/buffered_resource_handler.cc index 570d933..d11bff9 100644 --- a/content/browser/renderer_host/buffered_resource_handler.cc +++ b/content/browser/renderer_host/buffered_resource_handler.cc @@ -29,18 +29,18 @@ namespace { void RecordSnifferMetrics(bool sniffing_blocked, bool we_would_like_to_sniff, const std::string& mime_type) { - static scoped_refptr<base::Histogram> nosniff_usage = + scoped_refptr<base::Histogram> nosniff_usage = base::BooleanHistogram::FactoryGet( "nosniff.usage", base::Histogram::kUmaTargetedHistogramFlag); nosniff_usage->AddBoolean(sniffing_blocked); if (sniffing_blocked) { - static scoped_refptr<base::Histogram> nosniff_otherwise = + scoped_refptr<base::Histogram> nosniff_otherwise = base::BooleanHistogram::FactoryGet( "nosniff.otherwise", base::Histogram::kUmaTargetedHistogramFlag); nosniff_otherwise->AddBoolean(we_would_like_to_sniff); - static scoped_refptr<base::Histogram> nosniff_empty_mime_type = + scoped_refptr<base::Histogram> nosniff_empty_mime_type = base::BooleanHistogram::FactoryGet( "nosniff.empty_mime_type", base::Histogram::kUmaTargetedHistogramFlag); diff --git a/net/base/mime_sniffer.cc b/net/base/mime_sniffer.cc index bd16462f..25b94ec 100644 --- a/net/base/mime_sniffer.cc +++ b/net/base/mime_sniffer.cc @@ -308,7 +308,7 @@ static bool SniffForHTML(const char* content, if (!IsAsciiWhitespace(*pos)) break; } - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kSniffableTags2", arraysize(kSniffableTags)); // |pos| now points to first non-whitespace character (or at end). @@ -326,7 +326,7 @@ static bool SniffForMagicNumbers(const char* content, *have_enough_content &= TruncateSize(kBytesRequiredForMagic, &size); // Check our big table of Magic Numbers - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kMagicNumbers2", arraysize(kMagicNumbers)); return CheckForMagicNumbers(content, size, @@ -367,7 +367,7 @@ static bool SniffXML(const char* content, // We want to skip XML processing instructions (of the form "<?xml ...") // and stop at the first "plain" tag, then make a decision on the mime-type // based on the name (or possibly attributes) of that tag. - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kMagicXML2", arraysize(kMagicXML)); const int kMaxTagIterations = 5; @@ -451,7 +451,7 @@ static bool SniffBinary(const char* content, const bool is_truncated = TruncateSize(kMaxBytesToSniff, &size); // First, we look for a BOM. - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kByteOrderMark2", arraysize(kByteOrderMark)); std::string unused; @@ -493,7 +493,7 @@ static bool IsUnknownMimeType(const std::string& mime_type) { // Firefox rejects a mime type if it is exactly */* "*/*", }; - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kUnknownMimeTypes2", arraysize(kUnknownMimeTypes) + 1); for (size_t i = 0; i < arraysize(kUnknownMimeTypes); ++i) { @@ -519,7 +519,7 @@ static bool SniffCRX(const char* content, const std::string& type_hint, bool* have_enough_content, std::string* result) { - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kSniffCRX", 3); // Technically, the crx magic number is just Cr24, but the bytes after that @@ -557,7 +557,7 @@ static bool SniffCRX(const char* content, } bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) { - static scoped_refptr<base::Histogram> should_sniff_counter = + scoped_refptr<base::Histogram> should_sniff_counter = UMASnifferHistogramGet("mime_sniffer.ShouldSniffMimeType2", 3); // We are willing to sniff the mime type for HTTP, HTTPS, and FTP bool sniffable_scheme = url.is_empty() || @@ -582,7 +582,7 @@ bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) { "text/xml", "application/xml", }; - static scoped_refptr<base::Histogram> counter = + scoped_refptr<base::Histogram> counter = UMASnifferHistogramGet("mime_sniffer.kSniffableTypes2", arraysize(kSniffableTypes) + 1); for (size_t i = 0; i < arraysize(kSniffableTypes); ++i) { diff --git a/net/disk_cache/histogram_macros.h b/net/disk_cache/histogram_macros.h index 044302c..e238599 100644 --- a/net/disk_cache/histogram_macros.h +++ b/net/disk_cache/histogram_macros.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,7 +20,7 @@ #define CACHE_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ do { \ - static scoped_refptr<base::Histogram> counter; \ + scoped_refptr<base::Histogram> counter; \ if (!counter || name != counter->histogram_name()) \ counter = base::Histogram::FactoryGet( \ name, min, max, bucket_count, \ @@ -39,7 +39,7 @@ #define CACHE_HISTOGRAM_CUSTOM_TIMES(name, sample, min, max, bucket_count) \ do { \ - static scoped_refptr<base::Histogram> counter; \ + scoped_refptr<base::Histogram> counter; \ if (!counter || name != counter->histogram_name()) \ counter = base::Histogram::FactoryTimeGet( \ name, min, max, bucket_count, \ @@ -52,7 +52,7 @@ base::TimeDelta::FromSeconds(10), 50) #define CACHE_HISTOGRAM_ENUMERATION(name, sample, boundary_value) do { \ - static scoped_refptr<base::Histogram> counter; \ + scoped_refptr<base::Histogram> counter; \ if (!counter || name != counter->histogram_name()) \ counter = base::LinearHistogram::FactoryGet( \ name, 1, boundary_value, boundary_value + 1, \ |