Commit e2a36674 authored by wtc's avatar wtc Committed by Commit bot

Use the exact-width integer types defined in <stdint.h> rather than

"base/basictypes.h" in net/base/mime_sniffer*.

R=asanka@chromium.org
BUG=488550
TEST=none

Review URL: https://codereview.chromium.org/1151353005

Cr-Commit-Position: refs/heads/master@{#333098}
parent ed7eba6c
......@@ -92,11 +92,11 @@
// Note that our definition of HTML payload is much stricter than IE's
// definition and roughly the same as Firefox's definition.
#include <stdint.h>
#include <string>
#include "net/base/mime_sniffer.h"
#include "base/basictypes.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
......@@ -949,10 +949,10 @@ bool LooksLikeBinary(const char* content, size_t size) {
// one bit per byte, with 1 for a "binary" bit, and 0 for a "text" bit. The
// least-significant bit represents byte 0x00, the most-significant bit
// represents byte 0x1F.
const uint32 kBinaryBits =
const uint32_t kBinaryBits =
~(1u << '\t' | 1u << '\n' | 1u << '\r' | 1u << '\f' | 1u << '\x1b');
for (size_t i = 0; i < size; ++i) {
uint8 byte = static_cast<uint8>(content[i]);
uint8_t byte = static_cast<uint8_t>(content[i]);
if (byte < 0x20 && (kBinaryBits & (1u << byte)))
return true;
}
......
......@@ -99,7 +99,7 @@ TEST(MimeSnifferTest, PlainTextPerfTest) {
base::ElapsedTimer elapsed_timer;
RunLooksLikeBinary(plaintext, kMeasuredIterations);
LOG(INFO) << (elapsed_timer.Elapsed().InMicroseconds() * 1000 * 1024 /
(static_cast<int64>(plaintext.size()) * kMeasuredIterations))
(static_cast<int64_t>(plaintext.size()) * kMeasuredIterations))
<< "ns per KB";
}
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "net/base/mime_sniffer.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment