Index: net/http/http_cache_transaction.cc |
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc |
index cebecda47aa14c2c20ff5671e65b20e660933274..3f70547e7b3725ef16bda27c5ef9ccb8ac61006c 100644 |
--- a/net/http/http_cache_transaction.cc |
+++ b/net/http/http_cache_transaction.cc |
@@ -194,11 +194,6 @@ enum RequestOfflineStatus { |
// a non-offline error. |
OFFLINE_STATUS_NETWORK_FAILED, |
- // A network request was required for a cache entry, it failed with an |
- // offline error, and we could serve stale data if |
- // LOAD_FROM_CACHE_IF_OFFLINE was set. |
- OFFLINE_STATUS_DATA_AVAILABLE_OFFLINE, |
- |
// A network request was required for a cache entry, it failed with |
// an offline error, and there was no servable data in cache (even |
// stale data). |
@@ -207,15 +202,6 @@ enum RequestOfflineStatus { |
OFFLINE_STATUS_MAX_ENTRIES |
}; |
mmenke
2015/04/23 14:41:28
You can remove this entire enum.
mmenke
2015/04/24 12:14:01
It's possible you're making the changes now, just
g.mehndiratt
2015/04/24 12:58:18
On 2015/04/23 14:41:28, mmenke (Out 4-27 to 5-1) w
g.mehndiratt
2015/04/24 12:58:18
On 2015/04/24 12:14:01, mmenke (Out 4-27 to 5-1) w
|
-void RecordOfflineStatus(int load_flags, RequestOfflineStatus status) { |
- // Restrict to main frame to keep statistics close to |
- // "would have shown them something useful if offline mode was enabled". |
- if (load_flags & net::LOAD_MAIN_FRAME) { |
- UMA_HISTOGRAM_ENUMERATION("HttpCache.OfflineStatus", status, |
- OFFLINE_STATUS_MAX_ENTRIES); |
- } |
-} |
- |
void RecordNoStoreHeaderHistogram(int load_flags, |
const net::HttpResponseInfo* response) { |
if (load_flags & net::LOAD_MAIN_FRAME) { |
@@ -1116,28 +1102,6 @@ int HttpCache::Transaction::DoSendRequestComplete(int result) { |
if (!cache_.get()) |
return ERR_UNEXPECTED; |
- // If requested, and we have a readable cache entry, and we have |
- // an error indicating that we're offline as opposed to in contact |
- // with a bad server, read from cache anyway. |
- if (IsOfflineError(result)) { |
- if (mode_ == READ_WRITE && entry_ && !partial_) { |
- RecordOfflineStatus(effective_load_flags_, |
- OFFLINE_STATUS_DATA_AVAILABLE_OFFLINE); |
- if (effective_load_flags_ & LOAD_FROM_CACHE_IF_OFFLINE) { |
- UpdateTransactionPattern(PATTERN_NOT_COVERED); |
- response_.server_data_unavailable = true; |
- return SetupEntryForRead(); |
- } |
- } else { |
- RecordOfflineStatus(effective_load_flags_, |
- OFFLINE_STATUS_DATA_UNAVAILABLE_OFFLINE); |
- } |
- } else { |
- RecordOfflineStatus(effective_load_flags_, |
- (result == OK ? OFFLINE_STATUS_NETWORK_SUCCEEDED : |
- OFFLINE_STATUS_NETWORK_FAILED)); |
- } |
- |
// If we tried to conditionalize the request and failed, we know |
// we won't be reading from the cache after this point. |
if (couldnt_conditionalize_request_) |
@@ -2226,7 +2190,6 @@ int HttpCache::Transaction::BeginCacheValidation() { |
if (skip_validation) { |
// TODO(ricea): Is this pattern okay for asynchronous revalidations? |
UpdateTransactionPattern(PATTERN_ENTRY_USED); |
- RecordOfflineStatus(effective_load_flags_, OFFLINE_STATUS_FRESH_CACHE); |
return SetupEntryForRead(); |
} else { |
// Make the network request conditional, to see if we may reuse our cached |