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

Side by Side Diff: net/url_request/sdch_dictionary_fetcher.cc

Issue 2763393002: Remove stale-while-revalidate from net (Closed)
Patch Set: fixes Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « net/http/http_response_info_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/url_request/sdch_dictionary_fetcher.h" 5 #include "net/url_request/sdch_dictionary_fetcher.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 10
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 DCHECK_EQ(request, current_request_.get()); 160 DCHECK_EQ(request, current_request_.get());
161 DCHECK_EQ(next_state_, STATE_SEND_REQUEST_PENDING); 161 DCHECK_EQ(next_state_, STATE_SEND_REQUEST_PENDING);
162 DCHECK(!in_loop_); 162 DCHECK(!in_loop_);
163 DCHECK_NE(ERR_IO_PENDING, net_error); 163 DCHECK_NE(ERR_IO_PENDING, net_error);
164 164
165 // Confirm that the response isn't a stale read from the cache (as 165 // Confirm that the response isn't a stale read from the cache (as
166 // may happen in the reload case). If the response was not retrieved over 166 // may happen in the reload case). If the response was not retrieved over
167 // HTTP, it is presumed to be fresh. 167 // HTTP, it is presumed to be fresh.
168 HttpResponseHeaders* response_headers = request->response_headers(); 168 HttpResponseHeaders* response_headers = request->response_headers();
169 if (net_error == OK && response_headers) { 169 if (net_error == OK && response_headers) {
170 ValidationType validation_type = response_headers->RequiresValidation( 170 bool requires_validation = response_headers->RequiresValidation(
171 request->response_info().request_time, 171 request->response_info().request_time,
172 request->response_info().response_time, base::Time::Now()); 172 request->response_info().response_time, base::Time::Now());
173 // TODO(rdsmith): Maybe handle VALIDATION_ASYNCHRONOUS by queueing 173 if (requires_validation)
174 // a non-reload request for the dictionary.
175 if (validation_type != VALIDATION_NONE)
176 net_error = ERR_FAILED; 174 net_error = ERR_FAILED;
177 } 175 }
178 176
179 DoLoop(net_error); 177 DoLoop(net_error);
180 } 178 }
181 179
182 void SdchDictionaryFetcher::OnReadCompleted(URLRequest* request, 180 void SdchDictionaryFetcher::OnReadCompleted(URLRequest* request,
183 int bytes_read) { 181 int bytes_read) {
184 DCHECK(CalledOnValidThread()); 182 DCHECK(CalledOnValidThread());
185 DCHECK_EQ(request, current_request_.get()); 183 DCHECK_EQ(request, current_request_.get());
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 current_request_->net_log(), 368 current_request_->net_log(),
371 current_request_->was_cached()); 369 current_request_->was_cached());
372 } 370 }
373 371
374 ResetRequest(); 372 ResetRequest();
375 next_state_ = STATE_SEND_REQUEST; 373 next_state_ = STATE_SEND_REQUEST;
376 return OK; 374 return OK;
377 } 375 }
378 376
379 } // namespace net 377 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_response_info_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698