Index: net/disk_cache/mapped_file_posix.cc |
=================================================================== |
--- net/disk_cache/mapped_file_posix.cc (revision 138404) |
+++ net/disk_cache/mapped_file_posix.cc (working copy) |
@@ -28,6 +28,12 @@ |
if (reinterpret_cast<intptr_t>(buffer_) == -1) |
buffer_ = 0; |
+ // Make sure we detect hardware failures reading the headers. |
+ size_t temp_len = size ? size : 4096 * 2; |
gavinp
2012/05/31 19:59:50
Isn't it just an error if size is 0 here? How wou
rvargas (doing something else)
2012/05/31 20:07:05
Well... that's one of the details that I was hopin
gavinp
2012/05/31 20:50:34
If I missed a request to help earlier, I'm very so
|
+ scoped_array<char> temp(new char[temp_len]); |
+ if (!Read(temp.get(), temp_len, 0)) |
+ return NULL; |
+ |
view_size_ = size; |
return buffer_; |
} |