Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(977)

Unified Diff: net/http/http_cache_transaction.cc

Issue 14740016: Revert r197164: Avoid crashing the browser on truncated reads [...] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 0d08f783387b360cab2b5843cf4b4c469b7abc4e..95595976bcbeed5627b43477508264c2446e023c 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();
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698