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

Unified Diff: net/base/mime_sniffer.cc

Issue 28046: Use string for Histogram names since these are all ASCII anyway wide-characte... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 10 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 | « net/base/file_stream_win.cc ('k') | net/base/sdch_filter.cc » ('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 10269)
+++ net/base/mime_sniffer.cc (working copy)
@@ -103,7 +103,7 @@
class SnifferHistogram : public LinearHistogram {
public:
- SnifferHistogram(const wchar_t* name, int array_size)
+ SnifferHistogram(const char* name, int array_size)
: LinearHistogram(name, 0, array_size - 1, array_size) {
SetFlags(kUmaTargetedHistogramFlag);
}
@@ -273,7 +273,7 @@
if (!IsAsciiWhitespace(*pos))
break;
}
- static SnifferHistogram counter(L"mime_sniffer.kSniffableTags2",
+ static SnifferHistogram counter("mime_sniffer.kSniffableTags2",
arraysize(kSniffableTags));
// |pos| now points to first non-whitespace character (or at end).
return CheckForMagicNumbers(pos, end - pos,
@@ -284,7 +284,7 @@
static bool SniffForMagicNumbers(const char* content, size_t size,
std::string* result) {
// Check our big table of Magic Numbers
- static SnifferHistogram counter(L"mime_sniffer.kMagicNumbers2",
+ static SnifferHistogram counter("mime_sniffer.kMagicNumbers2",
arraysize(kMagicNumbers));
return CheckForMagicNumbers(content, size,
kMagicNumbers, arraysize(kMagicNumbers),
@@ -320,7 +320,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 SnifferHistogram counter(L"mime_sniffer.kMagicXML2",
+ static SnifferHistogram counter("mime_sniffer.kMagicXML2",
arraysize(kMagicXML));
const int kMaxTagIterations = 5;
for (int i = 0; i < kMaxTagIterations && pos < end; ++i) {
@@ -387,7 +387,7 @@
static bool LooksBinary(const char* content, size_t size) {
// First, we look for a BOM.
- static SnifferHistogram counter(L"mime_sniffer.kByteOrderMark2",
+ static SnifferHistogram counter("mime_sniffer.kByteOrderMark2",
arraysize(kByteOrderMark));
std::string unused;
if (CheckForMagicNumbers(content, size,
@@ -421,7 +421,7 @@
// Firefox rejects a mime type if it is exactly */*
"*/*",
};
- static SnifferHistogram counter(L"mime_sniffer.kUnknownMimeTypes2",
+ static SnifferHistogram counter("mime_sniffer.kUnknownMimeTypes2",
arraysize(kUnknownMimeTypes) + 1);
for (size_t i = 0; i < arraysize(kUnknownMimeTypes); ++i) {
if (mime_type == kUnknownMimeTypes[i]) {
@@ -439,7 +439,7 @@
bool ShouldSniffMimeType(const GURL& url, const std::string& mime_type) {
static SnifferHistogram should_sniff_counter(
- L"mime_sniffer.ShouldSniffMimeType2", 3);
+ "mime_sniffer.ShouldSniffMimeType2", 3);
// We are willing to sniff the mime type for HTTP, HTTPS, and FTP
bool sniffable_scheme = url.is_empty() ||
url.SchemeIs("http") ||
@@ -463,7 +463,7 @@
"text/xml",
"application/xml",
};
- static SnifferHistogram counter(L"mime_sniffer.kSniffableTypes2",
+ static SnifferHistogram counter("mime_sniffer.kSniffableTypes2",
arraysize(kSniffableTypes) + 1);
for (size_t i = 0; i < arraysize(kSniffableTypes); ++i) {
if (mime_type == kSniffableTypes[i]) {
@@ -555,4 +555,3 @@
}
} // namespace net
-
« no previous file with comments | « net/base/file_stream_win.cc ('k') | net/base/sdch_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698