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 2867 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2878 else if (mode_ & READ && entry_) | 2878 else if (mode_ & READ && entry_) |
2879 cache_->DoneReadingFromEntry(entry_, this); | 2879 cache_->DoneReadingFromEntry(entry_, this); |
2880 | 2880 |
2881 partial_.reset(NULL); | 2881 partial_.reset(NULL); |
2882 entry_ = NULL; | 2882 entry_ = NULL; |
2883 mode_ = NONE; | 2883 mode_ = NONE; |
2884 } | 2884 } |
2885 | 2885 |
2886 void HttpCache::Transaction::FixHeadersForHead() { | 2886 void HttpCache::Transaction::FixHeadersForHead() { |
2887 if (response_.headers->response_code() == 206) { | 2887 if (response_.headers->response_code() == 206) { |
2888 response_.headers->RemoveHeader("Content-Length"); | |
2889 response_.headers->RemoveHeader("Content-Range"); | 2888 response_.headers->RemoveHeader("Content-Range"); |
2890 response_.headers->ReplaceStatusLine("HTTP/1.1 200 OK"); | 2889 response_.headers->ReplaceStatusLine("HTTP/1.1 200 OK"); |
2891 } | 2890 } |
2892 } | 2891 } |
2893 | 2892 |
2894 void HttpCache::Transaction::TriggerAsyncValidation() { | 2893 void HttpCache::Transaction::TriggerAsyncValidation() { |
2895 DCHECK(!request_->upload_data_stream); | 2894 DCHECK(!request_->upload_data_stream); |
2896 BoundNetLog async_revalidation_net_log( | 2895 BoundNetLog async_revalidation_net_log( |
2897 BoundNetLog::Make(net_log_.net_log(), NetLog::SOURCE_ASYNC_REVALIDATION)); | 2896 BoundNetLog::Make(net_log_.net_log(), NetLog::SOURCE_ASYNC_REVALIDATION)); |
2898 net_log_.AddEvent( | 2897 net_log_.AddEvent( |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3271 | 3270 |
3272 void HttpCache::Transaction::OnIOComplete(int result) { | 3271 void HttpCache::Transaction::OnIOComplete(int result) { |
3273 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. | 3272 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. |
3274 tracked_objects::ScopedTracker tracking_profile( | 3273 tracked_objects::ScopedTracker tracking_profile( |
3275 FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 Transaction::OnIOComplete")); | 3274 FROM_HERE_WITH_EXPLICIT_FUNCTION("422516 Transaction::OnIOComplete")); |
3276 | 3275 |
3277 DoLoop(result); | 3276 DoLoop(result); |
3278 } | 3277 } |
3279 | 3278 |
3280 } // namespace net | 3279 } // namespace net |
OLD | NEW |