| 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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 | 569 |
| 570 next_state_ = STATE_HEADERS_PHASE_CANNOT_PROCEED; | 570 next_state_ = STATE_HEADERS_PHASE_CANNOT_PROCEED; |
| 571 entry_ = nullptr; | 571 entry_ = nullptr; |
| 572 } | 572 } |
| 573 | 573 |
| 574 size_t HttpCache::Transaction::EstimateMemoryUsage() const { | 574 size_t HttpCache::Transaction::EstimateMemoryUsage() const { |
| 575 // TODO(xunjieli): Consider improving the coverage. crbug.com/669108. | 575 // TODO(xunjieli): Consider improving the coverage. crbug.com/669108. |
| 576 return 0; | 576 return 0; |
| 577 } | 577 } |
| 578 | 578 |
| 579 void HttpCache::Transaction::SetSharedWritingFailState(int result) { |
| 580 // TODO(shivanisha): Implement when integrating with HttpCache::Writers. |
| 581 NOTIMPLEMENTED(); |
| 582 } |
| 583 |
| 579 //----------------------------------------------------------------------------- | 584 //----------------------------------------------------------------------------- |
| 580 | 585 |
| 581 // A few common patterns: (Foo* means Foo -> FooComplete) | 586 // A few common patterns: (Foo* means Foo -> FooComplete) |
| 582 // | 587 // |
| 583 // 1. Not-cached entry: | 588 // 1. Not-cached entry: |
| 584 // Start(): | 589 // Start(): |
| 585 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> | 590 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> |
| 586 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> | 591 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> |
| 587 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> | 592 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> |
| 588 // PartialHeadersReceived -> FinishHeaders* | 593 // PartialHeadersReceived -> FinishHeaders* |
| (...skipping 2535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3124 } | 3129 } |
| 3125 | 3130 |
| 3126 void HttpCache::Transaction::TransitionToState(State state) { | 3131 void HttpCache::Transaction::TransitionToState(State state) { |
| 3127 // Ensure that the state is only set once per Do* state. | 3132 // Ensure that the state is only set once per Do* state. |
| 3128 DCHECK(in_do_loop_); | 3133 DCHECK(in_do_loop_); |
| 3129 DCHECK_EQ(STATE_UNSET, next_state_) << "Next state is " << state; | 3134 DCHECK_EQ(STATE_UNSET, next_state_) << "Next state is " << state; |
| 3130 next_state_ = state; | 3135 next_state_ = state; |
| 3131 } | 3136 } |
| 3132 | 3137 |
| 3133 } // namespace net | 3138 } // namespace net |
| OLD | NEW |