| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1226 return HandleResult(result); | 1226 return HandleResult(result); |
| 1227 } | 1227 } |
| 1228 | 1228 |
| 1229 int HttpCache::Transaction::DoPartialCacheReadCompleted(int result) { | 1229 int HttpCache::Transaction::DoPartialCacheReadCompleted(int result) { |
| 1230 partial_->OnCacheReadCompleted(result); | 1230 partial_->OnCacheReadCompleted(result); |
| 1231 | 1231 |
| 1232 if (result == 0) { // End of file. | 1232 if (result == 0) { // End of file. |
| 1233 if (partial_.get() && mode_ == READ_WRITE) { | 1233 if (partial_.get() && mode_ == READ_WRITE) { |
| 1234 // We need to move on to the next range. | 1234 // We need to move on to the next range. |
| 1235 result = ContinuePartialCacheValidation(); | 1235 result = ContinuePartialCacheValidation(); |
| 1236 if (result != OK) | 1236 if (result != OK || !entry_) { |
| 1237 // Any error was already handled. | 1237 // Any error was already handled. |
| 1238 return result; | 1238 return result; |
| 1239 } |
| 1239 cache_->ConvertWriterToReader(entry_); | 1240 cache_->ConvertWriterToReader(entry_); |
| 1240 } | 1241 } |
| 1241 cache_->DoneReadingFromEntry(entry_, this); | 1242 cache_->DoneReadingFromEntry(entry_, this); |
| 1242 entry_ = NULL; | 1243 entry_ = NULL; |
| 1243 } | 1244 } |
| 1244 return HandleResult(result); | 1245 return HandleResult(result); |
| 1245 } | 1246 } |
| 1246 | 1247 |
| 1247 int HttpCache::Transaction::DoCacheWriteCompleted(int result) { | 1248 int HttpCache::Transaction::DoCacheWriteCompleted(int result) { |
| 1248 DCHECK(cache_); | 1249 DCHECK(cache_); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 void HttpCache::Transaction::OnCacheWriteCompleted(int result) { | 1397 void HttpCache::Transaction::OnCacheWriteCompleted(int result) { |
| 1397 DoCacheWriteCompleted(result); | 1398 DoCacheWriteCompleted(result); |
| 1398 } | 1399 } |
| 1399 | 1400 |
| 1400 void HttpCache::Transaction::OnCacheEntryReady(int result) { | 1401 void HttpCache::Transaction::OnCacheEntryReady(int result) { |
| 1401 DCHECK_EQ(OK, result); | 1402 DCHECK_EQ(OK, result); |
| 1402 ValidateEntryHeadersAndContinue(true); | 1403 ValidateEntryHeadersAndContinue(true); |
| 1403 } | 1404 } |
| 1404 | 1405 |
| 1405 } // namespace net | 1406 } // namespace net |
| OLD | NEW |