| OLD | NEW |
| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 void HttpCache::MetadataWriter::Write(const GURL& url, | 224 void HttpCache::MetadataWriter::Write(const GURL& url, |
| 225 base::Time expected_response_time, | 225 base::Time expected_response_time, |
| 226 IOBuffer* buf, | 226 IOBuffer* buf, |
| 227 int buf_len) { | 227 int buf_len) { |
| 228 DCHECK_GT(buf_len, 0); | 228 DCHECK_GT(buf_len, 0); |
| 229 DCHECK(buf); | 229 DCHECK(buf); |
| 230 DCHECK(buf->data()); | 230 DCHECK(buf->data()); |
| 231 request_info_.url = url; | 231 request_info_.url = url; |
| 232 request_info_.method = "GET"; | 232 request_info_.method = "GET"; |
| 233 request_info_.load_flags = LOAD_ONLY_FROM_CACHE; | 233 request_info_.load_flags = LOAD_ONLY_FROM_CACHE | LOAD_SKIP_CACHE_VALIDATION; |
| 234 | 234 |
| 235 expected_response_time_ = expected_response_time; | 235 expected_response_time_ = expected_response_time; |
| 236 buf_ = buf; | 236 buf_ = buf; |
| 237 buf_len_ = buf_len; | 237 buf_len_ = buf_len; |
| 238 verified_ = false; | 238 verified_ = false; |
| 239 | 239 |
| 240 int rv = transaction_->Start( | 240 int rv = transaction_->Start( |
| 241 &request_info_, | 241 &request_info_, |
| 242 base::Bind(&MetadataWriter::OnIOComplete, base::Unretained(this)), | 242 base::Bind(&MetadataWriter::OnIOComplete, base::Unretained(this)), |
| 243 NetLogWithSource()); | 243 NetLogWithSource()); |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1151 building_backend_ = false; | 1151 building_backend_ = false; |
| 1152 DeletePendingOp(pending_op); | 1152 DeletePendingOp(pending_op); |
| 1153 } | 1153 } |
| 1154 | 1154 |
| 1155 // The cache may be gone when we return from the callback. | 1155 // The cache may be gone when we return from the callback. |
| 1156 if (!item->DoCallback(result, disk_cache_.get())) | 1156 if (!item->DoCallback(result, disk_cache_.get())) |
| 1157 item->NotifyTransaction(result, NULL); | 1157 item->NotifyTransaction(result, NULL); |
| 1158 } | 1158 } |
| 1159 | 1159 |
| 1160 } // namespace net | 1160 } // namespace net |
| OLD | NEW |