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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 | 573 |
574 next_state_ = STATE_HEADERS_PHASE_CANNOT_PROCEED; | 574 next_state_ = STATE_HEADERS_PHASE_CANNOT_PROCEED; |
575 entry_ = nullptr; | 575 entry_ = nullptr; |
576 } | 576 } |
577 | 577 |
578 size_t HttpCache::Transaction::EstimateMemoryUsage() const { | 578 size_t HttpCache::Transaction::EstimateMemoryUsage() const { |
579 // TODO(xunjieli): Consider improving the coverage. crbug.com/669108. | 579 // TODO(xunjieli): Consider improving the coverage. crbug.com/669108. |
580 return 0; | 580 return 0; |
581 } | 581 } |
582 | 582 |
| 583 void HttpCache::Transaction::SetSharedWritingFailState(int result) { |
| 584 // TODO(shivanisha): Implement when integrating with HttpCache::Writers. |
| 585 NOTIMPLEMENTED(); |
| 586 } |
| 587 |
583 //----------------------------------------------------------------------------- | 588 //----------------------------------------------------------------------------- |
584 | 589 |
585 // A few common patterns: (Foo* means Foo -> FooComplete) | 590 // A few common patterns: (Foo* means Foo -> FooComplete) |
586 // | 591 // |
587 // 1. Not-cached entry: | 592 // 1. Not-cached entry: |
588 // Start(): | 593 // Start(): |
589 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> | 594 // GetBackend* -> InitEntry -> OpenEntry* -> CreateEntry* -> AddToEntry* -> |
590 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> | 595 // SendRequest* -> SuccessfulSendRequest -> OverwriteCachedResponse -> |
591 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> | 596 // CacheWriteResponse* -> TruncateCachedData* -> TruncateCachedMetadata* -> |
592 // PartialHeadersReceived -> FinishHeaders* | 597 // PartialHeadersReceived -> FinishHeaders* |
(...skipping 2626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3219 } | 3224 } |
3220 | 3225 |
3221 void HttpCache::Transaction::TransitionToState(State state) { | 3226 void HttpCache::Transaction::TransitionToState(State state) { |
3222 // Ensure that the state is only set once per Do* state. | 3227 // Ensure that the state is only set once per Do* state. |
3223 DCHECK(in_do_loop_); | 3228 DCHECK(in_do_loop_); |
3224 DCHECK_EQ(STATE_UNSET, next_state_) << "Next state is " << state; | 3229 DCHECK_EQ(STATE_UNSET, next_state_) << "Next state is " << state; |
3225 next_state_ = state; | 3230 next_state_ = state; |
3226 } | 3231 } |
3227 | 3232 |
3228 } // namespace net | 3233 } // namespace net |
OLD | NEW |