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

Side by Side Diff: net/http/http_cache.cc

Issue 2398613002: [HttpCache] LOAD_ONLY_FROM_CACHE should not imply LOAD_PREFERRING_CACHE (Closed)
Patch Set: Nit 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/http/http_cache.h" 5 #include "net/http/http_cache.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 224
225 void HttpCache::MetadataWriter::Write(const GURL& url, 225 void HttpCache::MetadataWriter::Write(const GURL& url,
226 base::Time expected_response_time, 226 base::Time expected_response_time,
227 IOBuffer* buf, 227 IOBuffer* buf,
228 int buf_len) { 228 int buf_len) {
229 DCHECK_GT(buf_len, 0); 229 DCHECK_GT(buf_len, 0);
230 DCHECK(buf); 230 DCHECK(buf);
231 DCHECK(buf->data()); 231 DCHECK(buf->data());
232 request_info_.url = url; 232 request_info_.url = url;
233 request_info_.method = "GET"; 233 request_info_.method = "GET";
234 request_info_.load_flags = LOAD_ONLY_FROM_CACHE; 234 request_info_.load_flags = LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION;
235 235
236 expected_response_time_ = expected_response_time; 236 expected_response_time_ = expected_response_time;
237 buf_ = buf; 237 buf_ = buf;
238 buf_len_ = buf_len; 238 buf_len_ = buf_len;
239 verified_ = false; 239 verified_ = false;
240 240
241 int rv = transaction_->Start( 241 int rv = transaction_->Start(
242 &request_info_, 242 &request_info_,
243 base::Bind(&MetadataWriter::OnIOComplete, base::Unretained(this)), 243 base::Bind(&MetadataWriter::OnIOComplete, base::Unretained(this)),
244 NetLogWithSource()); 244 NetLogWithSource());
(...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 building_backend_ = false; 1155 building_backend_ = false;
1156 DeletePendingOp(pending_op); 1156 DeletePendingOp(pending_op);
1157 } 1157 }
1158 1158
1159 // The cache may be gone when we return from the callback. 1159 // The cache may be gone when we return from the callback.
1160 if (!item->DoCallback(result, disk_cache_.get())) 1160 if (!item->DoCallback(result, disk_cache_.get()))
1161 item->NotifyTransaction(result, NULL); 1161 item->NotifyTransaction(result, NULL);
1162 } 1162 }
1163 1163
1164 } // namespace net 1164 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698