OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 if (rv == ERR_IO_PENDING) { | 358 if (rv == ERR_IO_PENDING) { |
359 DCHECK(!callback_); | 359 DCHECK(!callback_); |
360 callback_ = callback; | 360 callback_ = callback; |
361 } | 361 } |
362 return rv; | 362 return rv; |
363 } | 363 } |
364 | 364 |
365 void HttpCache::Transaction::StopCaching() { | 365 void HttpCache::Transaction::StopCaching() { |
366 } | 366 } |
367 | 367 |
| 368 void HttpCache::Transaction::DoneReading() { |
| 369 if (cache_ && entry_) { |
| 370 DCHECK(reading_); |
| 371 DCHECK_NE(mode_, UPDATE); |
| 372 if (mode_ & WRITE) |
| 373 DoneWritingToEntry(true); |
| 374 } |
| 375 } |
| 376 |
368 const HttpResponseInfo* HttpCache::Transaction::GetResponseInfo() const { | 377 const HttpResponseInfo* HttpCache::Transaction::GetResponseInfo() const { |
369 // Null headers means we encountered an error or haven't a response yet | 378 // Null headers means we encountered an error or haven't a response yet |
370 if (auth_response_.headers) | 379 if (auth_response_.headers) |
371 return &auth_response_; | 380 return &auth_response_; |
372 return (response_.headers || response_.ssl_info.cert || | 381 return (response_.headers || response_.ssl_info.cert || |
373 response_.cert_request_info) ? &response_ : NULL; | 382 response_.cert_request_info) ? &response_ : NULL; |
374 } | 383 } |
375 | 384 |
376 LoadState HttpCache::Transaction::GetLoadState() const { | 385 LoadState HttpCache::Transaction::GetLoadState() const { |
377 LoadState state = GetWriterLoadState(); | 386 LoadState state = GetWriterLoadState(); |
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 return false; | 2054 return false; |
2046 | 2055 |
2047 return true; | 2056 return true; |
2048 } | 2057 } |
2049 | 2058 |
2050 void HttpCache::Transaction::OnIOComplete(int result) { | 2059 void HttpCache::Transaction::OnIOComplete(int result) { |
2051 DoLoop(result); | 2060 DoLoop(result); |
2052 } | 2061 } |
2053 | 2062 |
2054 } // namespace net | 2063 } // namespace net |
OLD | NEW |