summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/base/bzip2_filter_unittest.cc2
-rw-r--r--net/base/file_stream_posix.cc7
-rw-r--r--net/base/file_stream_unittest.cc2
-rw-r--r--net/base/file_stream_win.cc7
-rw-r--r--net/base/gzip_filter_unittest.cc2
-rw-r--r--net/disk_cache/block_files_unittest.cc2
-rw-r--r--net/url_request/url_request_view_cache_job.cc3
7 files changed, 16 insertions, 9 deletions
diff --git a/net/base/bzip2_filter_unittest.cc b/net/base/bzip2_filter_unittest.cc
index 9b1eab5..3dd5e14 100644
--- a/net/base/bzip2_filter_unittest.cc
+++ b/net/base/bzip2_filter_unittest.cc
@@ -43,7 +43,7 @@ class BZip2FilterUnitTest : public PlatformTest {
file_path = file_path.AppendASCII("google.txt");
// Read data from the file into buffer.
- file_util::ReadFileToString(file_path, &source_buffer_);
+ ASSERT_TRUE(file_util::ReadFileToString(file_path, &source_buffer_));
// Append the extra data to end of source
source_buffer_.append(kExtraData, kExtraDataBufferSize);
diff --git a/net/base/file_stream_posix.cc b/net/base/file_stream_posix.cc
index 5c55781..aac0be2 100644
--- a/net/base/file_stream_posix.cc
+++ b/net/base/file_stream_posix.cc
@@ -290,12 +290,15 @@ void FileStream::AsyncContext::RunAsynchronousCallback() {
// FileStream ------------------------------------------------------------
-FileStream::FileStream() : file_(base::kInvalidPlatformFileValue) {
+FileStream::FileStream()
+ : file_(base::kInvalidPlatformFileValue),
+ open_flags_(0) {
DCHECK(!IsOpen());
}
FileStream::FileStream(base::PlatformFile file, int flags)
- : file_(file), open_flags_(flags) {
+ : file_(file),
+ open_flags_(flags) {
// If the file handle is opened with base::PLATFORM_FILE_ASYNC, we need to
// make sure we will perform asynchronous File IO to it.
if (flags & base::PLATFORM_FILE_ASYNC) {
diff --git a/net/base/file_stream_unittest.cc b/net/base/file_stream_unittest.cc
index 4b8b12b..f430d8e 100644
--- a/net/base/file_stream_unittest.cc
+++ b/net/base/file_stream_unittest.cc
@@ -885,7 +885,7 @@ TEST_F(FileStreamTest, Truncate) {
// Read in the contents and make sure we get back what we expected.
std::string read_contents;
- file_util::ReadFileToString(temp_file_path(), &read_contents);
+ EXPECT_TRUE(file_util::ReadFileToString(temp_file_path(), &read_contents));
EXPECT_EQ("01230123", read_contents);
}
diff --git a/net/base/file_stream_win.cc b/net/base/file_stream_win.cc
index 09ad88e..cec6a9d 100644
--- a/net/base/file_stream_win.cc
+++ b/net/base/file_stream_win.cc
@@ -115,11 +115,14 @@ void FileStream::AsyncContext::OnIOCompleted(
// FileStream ------------------------------------------------------------
-FileStream::FileStream() : file_(INVALID_HANDLE_VALUE) {
+FileStream::FileStream()
+ : file_(INVALID_HANDLE_VALUE),
+ open_flags_(0) {
}
FileStream::FileStream(base::PlatformFile file, int flags)
- : file_(file), open_flags_(flags) {
+ : file_(file),
+ open_flags_(flags) {
// If the file handle is opened with base::PLATFORM_FILE_ASYNC, we need to
// make sure we will perform asynchronous File IO to it.
if (flags & base::PLATFORM_FILE_ASYNC) {
diff --git a/net/base/gzip_filter_unittest.cc b/net/base/gzip_filter_unittest.cc
index c933014..91409a9 100644
--- a/net/base/gzip_filter_unittest.cc
+++ b/net/base/gzip_filter_unittest.cc
@@ -66,7 +66,7 @@ class GZipUnitTest : public PlatformTest {
file_path = file_path.AppendASCII("google.txt");
// Read data from the file into buffer.
- file_util::ReadFileToString(file_path, &source_buffer_);
+ ASSERT_TRUE(file_util::ReadFileToString(file_path, &source_buffer_));
// Encode the data with deflate
deflate_encode_buffer_ = new char[kDefaultBufferSize];
diff --git a/net/disk_cache/block_files_unittest.cc b/net/disk_cache/block_files_unittest.cc
index ce76fd6..b4ce107 100644
--- a/net/disk_cache/block_files_unittest.cc
+++ b/net/disk_cache/block_files_unittest.cc
@@ -14,7 +14,7 @@ using base::Time;
namespace {
// Returns the number of files in this folder.
-int NumberOfFiles(const std::wstring path) {
+int NumberOfFiles(const std::wstring& path) {
file_util::FileEnumerator iter(FilePath::FromWStringHack(path), false,
file_util::FileEnumerator::FILES);
int count = 0;
diff --git a/net/url_request/url_request_view_cache_job.cc b/net/url_request/url_request_view_cache_job.cc
index 6fd4e23..4217f4f 100644
--- a/net/url_request/url_request_view_cache_job.cc
+++ b/net/url_request/url_request_view_cache_job.cc
@@ -66,7 +66,8 @@ static std::string FormatEntryDetails(disk_cache::Entry* entry) {
std::string result = EscapeForHTML(entry->GetKey());
net::HttpResponseInfo response;
- net::HttpCache::ReadResponseInfo(entry, &response);
+ if (!net::HttpCache::ReadResponseInfo(entry, &response))
+ return "error reading cache entry";
if (response.headers) {
result.append("<hr><pre>");