| 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 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1597 partial_->FixContentLength(new_response_->headers); | 1597 partial_->FixContentLength(new_response_->headers); |
| 1598 | 1598 |
| 1599 response_ = *new_response_; | 1599 response_ = *new_response_; |
| 1600 target_state_ = STATE_TRUNCATE_CACHED_DATA; | 1600 target_state_ = STATE_TRUNCATE_CACHED_DATA; |
| 1601 next_state_ = truncated_ ? STATE_CACHE_WRITE_TRUNCATED_RESPONSE : | 1601 next_state_ = truncated_ ? STATE_CACHE_WRITE_TRUNCATED_RESPONSE : |
| 1602 STATE_CACHE_WRITE_RESPONSE; | 1602 STATE_CACHE_WRITE_RESPONSE; |
| 1603 return OK; | 1603 return OK; |
| 1604 } | 1604 } |
| 1605 | 1605 |
| 1606 int HttpCache::Transaction::DoTruncateCachedDataComplete(int result) { | 1606 int HttpCache::Transaction::DoTruncateCachedDataComplete(int result) { |
| 1607 // If this response is a redirect, then we can stop writing now. (We don't | 1607 // If this response is a redirect, then we can stop writing now. (We don't |
| 1608 // need to cache the response body of a redirect.) | 1608 // need to cache the response body of a redirect.) |
| 1609 if (response_.headers->IsRedirect(NULL)) | 1609 if (response_.headers->IsRedirect(NULL)) |
| 1610 DoneWritingToEntry(true); | 1610 DoneWritingToEntry(true); |
| 1611 next_state_ = STATE_PARTIAL_HEADERS_RECEIVED; | 1611 next_state_ = STATE_PARTIAL_HEADERS_RECEIVED; |
| 1612 return OK; | 1612 return OK; |
| 1613 } | 1613 } |
| 1614 | 1614 |
| 1615 int HttpCache::Transaction::DoPartialHeadersReceived() { | 1615 int HttpCache::Transaction::DoPartialHeadersReceived() { |
| 1616 new_response_ = NULL; | 1616 new_response_ = NULL; |
| 1617 if (!partial_.get()) | 1617 if (!partial_.get()) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 response_.cert_request_info = response->cert_request_info; | 1652 response_.cert_request_info = response->cert_request_info; |
| 1653 } | 1653 } |
| 1654 return result; | 1654 return result; |
| 1655 } | 1655 } |
| 1656 | 1656 |
| 1657 void HttpCache::Transaction::OnIOComplete(int result) { | 1657 void HttpCache::Transaction::OnIOComplete(int result) { |
| 1658 DoLoop(result); | 1658 DoLoop(result); |
| 1659 } | 1659 } |
| 1660 | 1660 |
| 1661 } // namespace net | 1661 } // namespace net |
| OLD | NEW |