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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 request_info_.load_flags = LOAD_ONLY_FROM_CACHE; | 233 request_info_.load_flags = LOAD_ONLY_FROM_CACHE; |
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 BoundNetLog()); | 243 NetLogWithSource()); |
244 if (rv != ERR_IO_PENDING) | 244 if (rv != ERR_IO_PENDING) |
245 VerifyResponse(rv); | 245 VerifyResponse(rv); |
246 } | 246 } |
247 | 247 |
248 void HttpCache::MetadataWriter::VerifyResponse(int result) { | 248 void HttpCache::MetadataWriter::VerifyResponse(int result) { |
249 verified_ = true; | 249 verified_ = true; |
250 if (result != OK) | 250 if (result != OK) |
251 return SelfDestroy(); | 251 return SelfDestroy(); |
252 | 252 |
253 const HttpResponseInfo* response_info = transaction_->GetResponseInfo(); | 253 const HttpResponseInfo* response_info = transaction_->GetResponseInfo(); |
(...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 building_backend_ = false; | 1154 building_backend_ = false; |
1155 DeletePendingOp(pending_op); | 1155 DeletePendingOp(pending_op); |
1156 } | 1156 } |
1157 | 1157 |
1158 // The cache may be gone when we return from the callback. | 1158 // The cache may be gone when we return from the callback. |
1159 if (!item->DoCallback(result, disk_cache_.get())) | 1159 if (!item->DoCallback(result, disk_cache_.get())) |
1160 item->NotifyTransaction(result, NULL); | 1160 item->NotifyTransaction(result, NULL); |
1161 } | 1161 } |
1162 | 1162 |
1163 } // namespace net | 1163 } // namespace net |
OLD | NEW |