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

Unified Diff: net/base/mime_sniffer.cc

Issue 6825056: Merge 78809 - Removed static variable for histograms to avoid race withhistogram initialization a... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/696/src/
Patch Set: Created 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/buffered_resource_handler.cc ('k') | net/disk_cache/histogram_macros.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/mime_sniffer.cc
===================================================================
--- net/base/mime_sniffer.cc (revision 81175)
+++ net/base/mime_sniffer.cc (working copy)
@@ -308,7 +308,7 @@
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 @@
*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 @@
// 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 @@
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 @@
// 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 @@
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 @@
}
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 @@
"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) {
« no previous file with comments | « content/browser/renderer_host/buffered_resource_handler.cc ('k') | net/disk_cache/histogram_macros.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698