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

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

Issue 2398613002: [HttpCache] LOAD_ONLY_FROM_CACHE should not imply LOAD_PREFERRING_CACHE (Closed)
Patch Set: Always check vary Created 4 years, 2 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_cache_unittest.cc ('k') | net/url_request/url_request_unittest.cc » ('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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 } 276 }
277 277
278 next_state_ = STATE_SEND_REQUEST_PENDING; 278 next_state_ = STATE_SEND_REQUEST_PENDING;
279 279
280 FetchInfo info; 280 FetchInfo info;
281 bool success = fetch_queue_->Pop(&info); 281 bool success = fetch_queue_->Pop(&info);
282 DCHECK(success); 282 DCHECK(success);
283 current_request_ = context_->CreateRequest(info.url, IDLE, this); 283 current_request_ = context_->CreateRequest(info.url, IDLE, this);
284 int load_flags = LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES; 284 int load_flags = LOAD_DO_NOT_SEND_COOKIES | LOAD_DO_NOT_SAVE_COOKIES;
285 if (info.cache_only) 285 if (info.cache_only)
286 load_flags |= LOAD_ONLY_FROM_CACHE; 286 load_flags |= LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
287 current_request_->SetLoadFlags(load_flags); 287 current_request_->SetLoadFlags(load_flags);
288 288
289 buffer_ = new IOBuffer(kBufferSize); 289 buffer_ = new IOBuffer(kBufferSize);
290 dictionary_.reset(new std::string()); 290 dictionary_.reset(new std::string());
291 current_callback_ = info.callback; 291 current_callback_ = info.callback;
292 292
293 current_request_->Start(); 293 current_request_->Start();
294 current_request_->net_log().AddEvent(NetLogEventType::SDCH_DICTIONARY_FETCH); 294 current_request_->net_log().AddEvent(NetLogEventType::SDCH_DICTIONARY_FETCH);
295 295
296 return ERR_IO_PENDING; 296 return ERR_IO_PENDING;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 current_request_->net_log(), 370 current_request_->net_log(),
371 current_request_->was_cached()); 371 current_request_->was_cached());
372 } 372 }
373 373
374 ResetRequest(); 374 ResetRequest();
375 next_state_ = STATE_SEND_REQUEST; 375 next_state_ = STATE_SEND_REQUEST;
376 return OK; 376 return OK;
377 } 377 }
378 378
379 } // namespace net 379 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_cache_unittest.cc ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698