diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 07:29:53 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-08 07:29:53 +0000 |
commit | dcc8d7646c0c811e63dd2d1f3aec3ff851c710f5 (patch) | |
tree | c24ebef7453db895b7dc0f19f2b1b0703a723d23 /net/base | |
parent | 28df6a0e78c530665486ba8decaecd7a00a6d96f (diff) | |
download | chromium_src-dcc8d7646c0c811e63dd2d1f3aec3ff851c710f5.zip chromium_src-dcc8d7646c0c811e63dd2d1f3aec3ff851c710f5.tar.gz chromium_src-dcc8d7646c0c811e63dd2d1f3aec3ff851c710f5.tar.bz2 |
net: Enhance UploadElementReaders' const correctness
BUG=None
TEST=net_unittests
Review URL: https://chromiumcodereview.appspot.com/11364119
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166630 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/base')
-rw-r--r-- | net/base/upload_bytes_element_reader.h | 4 | ||||
-rw-r--r-- | net/base/upload_file_element_reader.h | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/net/base/upload_bytes_element_reader.h b/net/base/upload_bytes_element_reader.h index 5edb11c..e9b9967 100644 --- a/net/base/upload_bytes_element_reader.h +++ b/net/base/upload_bytes_element_reader.h @@ -28,8 +28,8 @@ class NET_EXPORT_PRIVATE UploadBytesElementReader : public UploadElementReader { virtual int ReadSync(IOBuffer* buf, int buf_length) OVERRIDE; private: - const char* bytes_; - int bytes_length_; + const char* const bytes_; + const int bytes_length_; int offset_; DISALLOW_COPY_AND_ASSIGN(UploadBytesElementReader); diff --git a/net/base/upload_file_element_reader.h b/net/base/upload_file_element_reader.h index 1a9b9bf..da3e502 100644 --- a/net/base/upload_file_element_reader.h +++ b/net/base/upload_file_element_reader.h @@ -46,6 +46,14 @@ class NET_EXPORT_PRIVATE UploadFileElementReader : public UploadElementReader { virtual int ReadSync(IOBuffer* buf, int buf_length) OVERRIDE; private: + FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength); + FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, + UploadFileSmallerThanLength); + FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionSpdy2Test, + UploadFileSmallerThanLength); + FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionSpdy3Test, + UploadFileSmallerThanLength); + // Resets this instance to the uninitialized state. void Reset(); @@ -67,23 +75,15 @@ class NET_EXPORT_PRIVATE UploadFileElementReader : public UploadElementReader { ~ScopedOverridingContentLengthForTests(); }; - FilePath path_; - uint64 range_offset_; - uint64 range_length_; - base::Time expected_modification_time_; + const FilePath path_; + const uint64 range_offset_; + const uint64 range_length_; + const base::Time expected_modification_time_; ScopedFileStreamPtr file_stream_; uint64 content_length_; uint64 bytes_remaining_; base::WeakPtrFactory<UploadFileElementReader> weak_ptr_factory_; - FRIEND_TEST_ALL_PREFIXES(UploadDataStreamTest, FileSmallerThanLength); - FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionTest, - UploadFileSmallerThanLength); - FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionSpdy2Test, - UploadFileSmallerThanLength); - FRIEND_TEST_ALL_PREFIXES(HttpNetworkTransactionSpdy3Test, - UploadFileSmallerThanLength); - DISALLOW_COPY_AND_ASSIGN(UploadFileElementReader); }; |