| 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" // For OS_POSIX | 7 #include "build/build_config.h" // For OS_POSIX |
| 8 | 8 |
| 9 #if defined(OS_POSIX) | 9 #if defined(OS_POSIX) |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 | 572 |
| 573 next_state_ = STATE_HEADERS_PHASE_CANNOT_PROCEED; | 573 next_state_ = STATE_HEADERS_PHASE_CANNOT_PROCEED; |
| 574 entry_ = nullptr; | 574 entry_ = nullptr; |
| 575 } | 575 } |
| 576 | 576 |
| 577 size_t HttpCache::Transaction::EstimateMemoryUsage() const { | 577 size_t HttpCache::Transaction::EstimateMemoryUsage() const { |
| 578 // TODO(xunjieli): Consider improving the coverage. crbug.com/669108. | 578 // TODO(xunjieli): Consider improving the coverage. crbug.com/669108. |
| 579 return 0; | 579 return 0; |
| 580 } | 580 } |
| 581 | 581 |
| 582 void HttpCache::Transaction::SetSharedWritingFailState(int result) { |
| 583 // TODO(shivanisha): Implement when integrating with HttpCache::Writers. |
| 584 NOTIMPLEMENTED(); |
| 585 } |
| 586 |
| 582 //----------------------------------------------------------------------------- | 587 //----------------------------------------------------------------------------- |
| 583 | 588 |
| 584 // A few common patterns: (Foo* means Foo -> FooComplete) | 589 // A few common patterns: (Foo* means Foo -> FooComplete) |
| 585 // | 590 // |
| 586 // 1. Not-cached entry: | 591 // 1. Not-cached entry: |
| 587 // Start(): | 592 // Start(): |
| 588 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> | 593 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> |
| 589 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> | 594 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> |
| 590 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> | 595 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> |
| 591 // PartialHeadersReceived -> FinishHeaders* | 596 // PartialHeadersReceived -> FinishHeaders* |
| (...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3163 } | 3168 } |
| 3164 | 3169 |
| 3165 void HttpCache::Transaction::TransitionToState(State state) { | 3170 void HttpCache::Transaction::TransitionToState(State state) { |
| 3166 // Ensure that the state is only set once per Do* state. | 3171 // Ensure that the state is only set once per Do* state. |
| 3167 DCHECK(in_do_loop_); | 3172 DCHECK(in_do_loop_); |
| 3168 DCHECK_EQ(STATE_UNSET, next_state_) << "Next state is " << state; | 3173 DCHECK_EQ(STATE_UNSET, next_state_) << "Next state is " << state; |
| 3169 next_state_ = state; | 3174 next_state_ = state; |
| 3170 } | 3175 } |
| 3171 | 3176 |
| 3172 } // namespace net | 3177 } // namespace net |
| OLD | NEW |