summaryrefslogtreecommitdiffstats
path: root/net/http/http_cache_transaction.cc
diff options
context:
space:
mode:
authorpasko@google.com <pasko@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-06 12:24:05 +0000
committerpasko@google.com <pasko@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2013-05-06 12:24:05 +0000
commitc8fd958b9575d9a3c44af4f472f9650803e97fd7 (patch)
tree38dc84b19a3d9492cc1d48ecb69cfaba4eb7599f /net/http/http_cache_transaction.cc
parent3d7c6a994d885fe3de4251b2c217fa8a5c4ffc67 (diff)
downloadchromium_src-c8fd958b9575d9a3c44af4f472f9650803e97fd7.zip
chromium_src-c8fd958b9575d9a3c44af4f472f9650803e97fd7.tar.gz
chromium_src-c8fd958b9575d9a3c44af4f472f9650803e97fd7.tar.bz2
Revert r197164: Avoid crashing the browser on truncated reads [...]
After a long discussion it was decided that the backend is the only proper place for this kind of correctness checks. All backends should do that. BUG=236384 Review URL: https://chromiumcodereview.appspot.com/14740016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198425 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_cache_transaction.cc')
-rw-r--r--net/http/http_cache_transaction.cc26
1 files changed, 2 insertions, 24 deletions
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 0d08f78..9559597 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -1384,17 +1384,6 @@ int HttpCache::Transaction::DoCacheReadResponse() {
next_state_ = STATE_CACHE_READ_RESPONSE_COMPLETE;
io_buf_len_ = entry_->disk_entry->GetDataSize(kResponseInfoIndex);
- if (io_buf_len_ > 0) {
- UMA_HISTOGRAM_BOOLEAN("HttpCache.TruncatedHeader", false);
- } else {
- UMA_HISTOGRAM_BOOLEAN("HttpCache.TruncatedHeader", true);
- DLOG(WARNING) << "Truncated cache entry header encountered";
- mode_ = NONE;
- if (partial_.get())
- partial_->RestoreHeaders(&custom_request_->extra_headers);
- next_state_ = STATE_SEND_REQUEST;
- return OK;
- }
read_buf_ = new IOBuffer(io_buf_len_);
net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_INFO);
@@ -1492,19 +1481,8 @@ int HttpCache::Transaction::DoCacheReadMetadata() {
DCHECK(!response_.metadata);
next_state_ = STATE_CACHE_READ_METADATA_COMPLETE;
- int32 data_size = entry_->disk_entry->GetDataSize(kMetadataIndex);
- if (data_size > 0) {
- UMA_HISTOGRAM_BOOLEAN("HttpCache.TruncatedMetadata", false);
- } else {
- UMA_HISTOGRAM_BOOLEAN("HttpCache.TruncatedMetadata", true);
- DLOG(WARNING) << "Truncated cache entry metadata encountered";
- mode_ = NONE;
- if (partial_.get())
- partial_->RestoreHeaders(&custom_request_->extra_headers);
- next_state_ = STATE_SEND_REQUEST;
- return OK;
- }
- response_.metadata = new IOBufferWithSize(data_size);
+ response_.metadata =
+ new IOBufferWithSize(entry_->disk_entry->GetDataSize(kMetadataIndex));
net_log_.BeginEvent(NetLog::TYPE_HTTP_CACHE_READ_INFO);
ReportCacheActionStart();