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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 341 |
342 return rv; | 342 return rv; |
343 } | 343 } |
344 | 344 |
345 bool HttpCache::Transaction::IsReadyToRestartForAuth() { | 345 bool HttpCache::Transaction::IsReadyToRestartForAuth() { |
346 if (!network_trans_.get()) | 346 if (!network_trans_.get()) |
347 return false; | 347 return false; |
348 return network_trans_->IsReadyToRestartForAuth(); | 348 return network_trans_->IsReadyToRestartForAuth(); |
349 } | 349 } |
350 | 350 |
| 351 bool HttpCache::Transaction::HasAuth() const { |
| 352 return network_trans_.get() ? network_trans_->HasAuth() : false; |
| 353 } |
| 354 |
351 int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len, | 355 int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len, |
352 const CompletionCallback& callback) { | 356 const CompletionCallback& callback) { |
353 DCHECK(buf); | 357 DCHECK(buf); |
354 DCHECK_GT(buf_len, 0); | 358 DCHECK_GT(buf_len, 0); |
355 DCHECK(!callback.is_null()); | 359 DCHECK(!callback.is_null()); |
356 | 360 |
357 DCHECK(callback_.is_null()); | 361 DCHECK(callback_.is_null()); |
358 | 362 |
359 if (!cache_) | 363 if (!cache_) |
360 return ERR_UNEXPECTED; | 364 return ERR_UNEXPECTED; |
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2519 } | 2523 } |
2520 | 2524 |
2521 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { | 2525 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { |
2522 DCHECK(cache_io_start_.is_null()); | 2526 DCHECK(cache_io_start_.is_null()); |
2523 if (return_value == ERR_IO_PENDING) | 2527 if (return_value == ERR_IO_PENDING) |
2524 cache_io_start_ = base::TimeTicks::Now(); | 2528 cache_io_start_ = base::TimeTicks::Now(); |
2525 return return_value; | 2529 return return_value; |
2526 } | 2530 } |
2527 | 2531 |
2528 } // namespace net | 2532 } // namespace net |
OLD | NEW |