summaryrefslogtreecommitdiffstats
path: root/net/filter
diff options
context:
space:
mode:
authorAvi Drissman <avi@chromium.org>2015-12-19 23:40:46 -0500
committerAvi Drissman <avi@chromium.org>2015-12-20 04:42:28 +0000
commit13fc893acb88fdd82ad7eea72f9499d123bf5a89 (patch)
tree76aa2bdaa56cb2d05bbf2a6af57e440f9661c7f0 /net/filter
parente40cbca89ebc83b5bef0f892d80604b00a98abc8 (diff)
downloadchromium_src-13fc893acb88fdd82ad7eea72f9499d123bf5a89.zip
chromium_src-13fc893acb88fdd82ad7eea72f9499d123bf5a89.tar.gz
chromium_src-13fc893acb88fdd82ad7eea72f9499d123bf5a89.tar.bz2
Switch to standard integer types in net/.
BUG=488550 TBR=mmenke@chromium.org Review URL: https://codereview.chromium.org/1535363003 . Cr-Commit-Position: refs/heads/master@{#366297}
Diffstat (limited to 'net/filter')
-rw-r--r--net/filter/filter.h6
-rw-r--r--net/filter/filter_unittest.cc1
-rw-r--r--net/filter/gzip_filter.h2
-rw-r--r--net/filter/gzip_header.cc15
-rw-r--r--net/filter/gzip_header.h10
-rw-r--r--net/filter/mock_filter_context.cc4
-rw-r--r--net/filter/mock_filter_context.h5
-rw-r--r--net/filter/sdch_filter.h3
-rw-r--r--net/filter/sdch_filter_unittest.cc1
9 files changed, 30 insertions, 17 deletions
diff --git a/net/filter/filter.h b/net/filter/filter.h
index 1904a8c..6e111e1 100644
--- a/net/filter/filter.h
+++ b/net/filter/filter.h
@@ -46,11 +46,13 @@
#ifndef NET_FILTER_FILTER_H__
#define NET_FILTER_FILTER_H__
+#include <stdint.h>
+
#include <string>
#include <vector>
-#include "base/basictypes.h"
#include "base/gtest_prod_util.h"
+#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/time/time.h"
@@ -113,7 +115,7 @@ class NET_EXPORT_PRIVATE FilterContext {
// How many bytes were read from the net or cache so far (and potentially
// pushed into a filter for processing)?
- virtual int64 GetByteReadCount() const = 0;
+ virtual int64_t GetByteReadCount() const = 0;
// What response code was received with the associated network transaction?
// For example: 200 is ok. 4xx are error codes. etc.
diff --git a/net/filter/filter_unittest.cc b/net/filter/filter_unittest.cc
index d0441fa..c44f23b 100644
--- a/net/filter/filter_unittest.cc
+++ b/net/filter/filter_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/macros.h"
#include "net/base/io_buffer.h"
#include "net/filter/filter.h"
#include "net/filter/mock_filter_context.h"
diff --git a/net/filter/gzip_filter.h b/net/filter/gzip_filter.h
index 2306c9b..67330d7 100644
--- a/net/filter/gzip_filter.h
+++ b/net/filter/gzip_filter.h
@@ -15,7 +15,7 @@
#ifndef NET_FILTER_GZIP_FILTER_H_
#define NET_FILTER_GZIP_FILTER_H_
-#include "base/basictypes.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/filter/filter.h"
diff --git a/net/filter/gzip_header.cc b/net/filter/gzip_header.cc
index f4aca6b..36a1c86 100644
--- a/net/filter/gzip_header.cc
+++ b/net/filter/gzip_header.cc
@@ -11,7 +11,7 @@
namespace net {
-const uint8 GZipHeader::magic[] = { 0x1f, 0x8b };
+const uint8_t GZipHeader::magic[] = {0x1f, 0x8b};
GZipHeader::GZipHeader() {
Reset();
@@ -29,8 +29,8 @@ void GZipHeader::Reset() {
GZipHeader::Status GZipHeader::ReadMore(const char* inbuf, int inbuf_len,
const char** header_end) {
DCHECK_GE(inbuf_len, 0);
- const uint8* pos = reinterpret_cast<const uint8*>(inbuf);
- const uint8* const end = pos + inbuf_len;
+ const uint8_t* pos = reinterpret_cast<const uint8_t*>(inbuf);
+ const uint8_t* const end = pos + inbuf_len;
while ( pos < end ) {
switch ( state_ ) {
@@ -105,9 +105,8 @@ GZipHeader::Status GZipHeader::ReadMore(const char* inbuf, int inbuf_len,
case IN_FEXTRA: {
// Grab the rest of the bytes in the extra field, or as many
// of them as are actually present so far.
- const uint16 num_extra_bytes = static_cast<uint16>(std::min(
- static_cast<ptrdiff_t>(extra_length_),
- (end - pos)));
+ const uint16_t num_extra_bytes = static_cast<uint16_t>(
+ std::min(static_cast<ptrdiff_t>(extra_length_), (end - pos)));
pos += num_extra_bytes;
extra_length_ -= num_extra_bytes;
if ( extra_length_ == 0 ) {
@@ -123,7 +122,7 @@ GZipHeader::Status GZipHeader::ReadMore(const char* inbuf, int inbuf_len,
break;
}
// See if we can find the end of the \0-terminated FNAME field.
- pos = reinterpret_cast<const uint8*>(memchr(pos, '\0', (end - pos)));
+ pos = reinterpret_cast<const uint8_t*>(memchr(pos, '\0', (end - pos)));
if ( pos != NULL ) {
pos++; // advance past the '\0'
flags_ &= ~FLAG_FNAME; // we're done with the FNAME stuff
@@ -139,7 +138,7 @@ GZipHeader::Status GZipHeader::ReadMore(const char* inbuf, int inbuf_len,
break;
}
// See if we can find the end of the \0-terminated FCOMMENT field.
- pos = reinterpret_cast<const uint8*>(memchr(pos, '\0', (end - pos)));
+ pos = reinterpret_cast<const uint8_t*>(memchr(pos, '\0', (end - pos)));
if ( pos != NULL ) {
pos++; // advance past the '\0'
flags_ &= ~FLAG_FCOMMENT; // we're done with the FCOMMENT stuff
diff --git a/net/filter/gzip_header.h b/net/filter/gzip_header.h
index 986afc4..91d6955 100644
--- a/net/filter/gzip_header.h
+++ b/net/filter/gzip_header.h
@@ -15,7 +15,9 @@
#ifndef NET_FILTER_GZIP_HEADER_H_
#define NET_FILTER_GZIP_HEADER_H_
-#include "base/basictypes.h"
+#include <stdint.h>
+
+#include "base/macros.h"
namespace net {
@@ -80,11 +82,11 @@ class GZipHeader {
IN_DONE,
};
- static const uint8 magic[]; // gzip magic header
+ static const uint8_t magic[]; // gzip magic header
int state_; // our current State in the parsing FSM: an int so we can ++
- uint8 flags_; // the flags byte of the header ("FLG" in the RFC)
- uint16 extra_length_; // how much of the "extra field" we have yet to read
+ uint8_t flags_; // the flags byte of the header ("FLG" in the RFC)
+ uint16_t extra_length_; // how much of the "extra field" we have yet to read
DISALLOW_COPY_AND_ASSIGN(GZipHeader);
};
diff --git a/net/filter/mock_filter_context.cc b/net/filter/mock_filter_context.cc
index ebcaa18..2165aa05 100644
--- a/net/filter/mock_filter_context.cc
+++ b/net/filter/mock_filter_context.cc
@@ -48,7 +48,9 @@ MockFilterContext::SdchDictionariesAdvertised() const {
return dictionaries_handle_.get();
}
-int64 MockFilterContext::GetByteReadCount() const { return 0; }
+int64_t MockFilterContext::GetByteReadCount() const {
+ return 0;
+}
int MockFilterContext::GetResponseCode() const { return response_code_; }
diff --git a/net/filter/mock_filter_context.h b/net/filter/mock_filter_context.h
index 33d41a6..6646cfd 100644
--- a/net/filter/mock_filter_context.h
+++ b/net/filter/mock_filter_context.h
@@ -5,8 +5,11 @@
#ifndef NET_FILTER_MOCK_FILTER_CONTEXT_H_
#define NET_FILTER_MOCK_FILTER_CONTEXT_H_
+#include <stdint.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/sdch_manager.h"
#include "net/filter/filter.h"
@@ -55,7 +58,7 @@ class MockFilterContext : public FilterContext {
SdchManager::DictionarySet* SdchDictionariesAdvertised() const override;
// How many bytes were fed to filter(s) so far?
- int64 GetByteReadCount() const override;
+ int64_t GetByteReadCount() const override;
int GetResponseCode() const override;
diff --git a/net/filter/sdch_filter.h b/net/filter/sdch_filter.h
index 43125e8..83e29c5 100644
--- a/net/filter/sdch_filter.h
+++ b/net/filter/sdch_filter.h
@@ -14,8 +14,11 @@
#ifndef NET_FILTER_SDCH_FILTER_H_
#define NET_FILTER_SDCH_FILTER_H_
+#include <stddef.h>
+
#include <string>
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/net_export.h"
#include "net/base/sdch_dictionary.h"
diff --git a/net/filter/sdch_filter_unittest.cc b/net/filter/sdch_filter_unittest.cc
index 35276cb..35c7ecc 100644
--- a/net/filter/sdch_filter_unittest.cc
+++ b/net/filter/sdch_filter_unittest.cc
@@ -9,6 +9,7 @@
#include <vector>
#include "base/logging.h"
+#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
#include "base/test/histogram_tester.h"
#include "base/test/simple_test_clock.h"