| 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_transaction.h" | 5 #include "net/http/http_cache_transaction.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 Invalid_number_of_validation_headers); | 340 Invalid_number_of_validation_headers); |
| 341 } | 341 } |
| 342 | 342 |
| 343 HttpCache::Transaction::~Transaction() { | 343 HttpCache::Transaction::~Transaction() { |
| 344 // We may have to issue another IO, but we should never invoke the callback_ | 344 // We may have to issue another IO, but we should never invoke the callback_ |
| 345 // after this point. | 345 // after this point. |
| 346 callback_.Reset(); | 346 callback_.Reset(); |
| 347 | 347 |
| 348 if (cache_) { | 348 if (cache_) { |
| 349 if (entry_) { | 349 if (entry_) { |
| 350 bool cancel_request = reading_ && response_.headers; | 350 bool cancel_request = reading_ && response_.headers.get(); |
| 351 if (cancel_request) { | 351 if (cancel_request) { |
| 352 if (partial_) { | 352 if (partial_) { |
| 353 entry_->disk_entry->CancelSparseIO(); | 353 entry_->disk_entry->CancelSparseIO(); |
| 354 } else { | 354 } else { |
| 355 cancel_request &= (response_.headers->response_code() == 200); | 355 cancel_request &= (response_.headers->response_code() == 200); |
| 356 } | 356 } |
| 357 } | 357 } |
| 358 | 358 |
| 359 cache_->DoneWithEntry(entry_, this, cancel_request); | 359 cache_->DoneWithEntry(entry_, this, cancel_request); |
| 360 } else if (cache_pending_) { | 360 } else if (cache_pending_) { |
| (...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2862 default: | 2862 default: |
| 2863 NOTREACHED(); | 2863 NOTREACHED(); |
| 2864 } | 2864 } |
| 2865 } | 2865 } |
| 2866 | 2866 |
| 2867 void HttpCache::Transaction::OnIOComplete(int result) { | 2867 void HttpCache::Transaction::OnIOComplete(int result) { |
| 2868 DoLoop(result); | 2868 DoLoop(result); |
| 2869 } | 2869 } |
| 2870 | 2870 |
| 2871 } // namespace net | 2871 } // namespace net |
| OLD | NEW |