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

Unified Diff: net/http/http_cache_transaction.cc

Issue 1041763002: Remove stale-while-revalidate experimental implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing header includes. Created 5 years, 7 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
Index: net/http/http_cache_transaction.cc
diff --git a/net/http/http_cache_transaction.cc b/net/http/http_cache_transaction.cc
index 2b96817e56ccb6ecfc17e161b52067e6c9bd13ee..84c7f4ff76c0bc79d41ba21dd0a3a70ef0f726bb 100644
--- a/net/http/http_cache_transaction.cc
+++ b/net/http/http_cache_transaction.cc
@@ -17,7 +17,6 @@
#include "base/compiler_specific.h"
#include "base/format_macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
@@ -182,18 +181,6 @@ void RecordNoStoreHeaderHistogram(int load_flags,
}
}
-scoped_ptr<base::Value> NetLogAsyncRevalidationInfoCallback(
- const NetLog::Source& source,
- const HttpRequestInfo* request,
- NetLogCaptureMode capture_mode) {
- scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
- source.AddToEventParameters(dict.get());
-
- dict->SetString("url", request->url.possibly_invalid_spec());
- dict->SetString("method", request->method);
- return dict.Pass();
-}
-
enum ExternallyConditionalizedType {
EXTERNALLY_CONDITIONALIZED_CACHE_REQUIRES_VALIDATION,
EXTERNALLY_CONDITIONALIZED_CACHE_USABLE,
@@ -2132,13 +2119,6 @@ int HttpCache::Transaction::BeginCacheValidation() {
bool skip_validation = (required_validation == VALIDATION_NONE);
- if (required_validation == VALIDATION_ASYNCHRONOUS &&
- !(request_->method == "GET" && (truncated_ || partial_)) && cache_ &&
- cache_->use_stale_while_revalidate()) {
- TriggerAsyncValidation();
- skip_validation = true;
- }
-
if (request_->method == "HEAD" &&
(truncated_ || response_.headers->response_code() == 206)) {
DCHECK(!partial_);
@@ -2167,7 +2147,6 @@ int HttpCache::Transaction::BeginCacheValidation() {
}
if (skip_validation) {
- // TODO(ricea): Is this pattern okay for asynchronous revalidations?
UpdateTransactionPattern(PATTERN_ENTRY_USED);
return SetupEntryForRead();
} else {
@@ -2347,7 +2326,7 @@ ValidationType HttpCache::Transaction::RequiresValidation() {
return VALIDATION_NONE;
}
- if (effective_load_flags_ & (LOAD_VALIDATE_CACHE | LOAD_ASYNC_REVALIDATION))
+ if (effective_load_flags_ & LOAD_VALIDATE_CACHE)
return VALIDATION_SYNCHRONOUS;
if (request_->method == "PUT" || request_->method == "DELETE")
@@ -2601,25 +2580,6 @@ void HttpCache::Transaction::FixHeadersForHead() {
}
}
-void HttpCache::Transaction::TriggerAsyncValidation() {
- DCHECK(!request_->upload_data_stream);
- BoundNetLog async_revalidation_net_log(
- BoundNetLog::Make(net_log_.net_log(), NetLog::SOURCE_ASYNC_REVALIDATION));
- net_log_.AddEvent(
- NetLog::TYPE_HTTP_CACHE_VALIDATE_RESOURCE_ASYNC,
- async_revalidation_net_log.source().ToEventParametersCallback());
- async_revalidation_net_log.BeginEvent(
- NetLog::TYPE_ASYNC_REVALIDATION,
- base::Bind(
- &NetLogAsyncRevalidationInfoCallback, net_log_.source(), request_));
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&HttpCache::PerformAsyncValidation,
- cache_, // cache_ is a weak pointer.
- *request_,
- async_revalidation_net_log));
-}
-
void HttpCache::Transaction::FailRangeRequest() {
response_ = *new_response_;
partial_->FixResponseHeaders(response_.headers.get(), false);

Powered by Google App Engine
This is Rietveld 408576698