Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(97)

Side by Side Diff: net/http/http_cache_transaction.cc

Issue 12886022: Implement offline mode behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added back in removed whitespace. Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 // If we have an authentication response, we are exposed to weird things 877 // If we have an authentication response, we are exposed to weird things
878 // hapenning if the user cancels the authentication before we receive 878 // hapenning if the user cancels the authentication before we receive
879 // the new response. 879 // the new response.
880 UpdateTransactionPattern(PATTERN_NOT_COVERED); 880 UpdateTransactionPattern(PATTERN_NOT_COVERED);
881 response_ = HttpResponseInfo(); 881 response_ = HttpResponseInfo();
882 network_trans_.reset(); 882 network_trans_.reset();
883 new_response_ = NULL; 883 new_response_ = NULL;
884 next_state_ = STATE_SEND_REQUEST; 884 next_state_ = STATE_SEND_REQUEST;
885 return OK; 885 return OK;
886 } 886 }
887
888 response_.network_verified = true;
889
887 if (handling_206_ && mode_ == READ_WRITE && !truncated_ && !is_sparse_) { 890 if (handling_206_ && mode_ == READ_WRITE && !truncated_ && !is_sparse_) {
888 // We have stored the full entry, but it changed and the server is 891 // We have stored the full entry, but it changed and the server is
889 // sending a range. We have to delete the old entry. 892 // sending a range. We have to delete the old entry.
890 UpdateTransactionPattern(PATTERN_NOT_COVERED); 893 UpdateTransactionPattern(PATTERN_NOT_COVERED);
891 DoneWritingToEntry(false); 894 DoneWritingToEntry(false);
892 } 895 }
893 if (new_response_->headers->response_code() == 416 && 896 if (new_response_->headers->response_code() == 416 &&
894 (request_->method == "GET" || request_->method == "POST")) { 897 (request_->method == "GET" || request_->method == "POST")) {
895 DCHECK_EQ(NONE, mode_); 898 DCHECK_EQ(NONE, mode_);
896 response_ = *new_response_; 899 response_ = *new_response_;
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after
2546 } 2549 }
2547 2550
2548 int HttpCache::Transaction::ResetCacheIOStart(int return_value) { 2551 int HttpCache::Transaction::ResetCacheIOStart(int return_value) {
2549 DCHECK(cache_io_start_.is_null()); 2552 DCHECK(cache_io_start_.is_null());
2550 if (return_value == ERR_IO_PENDING) 2553 if (return_value == ERR_IO_PENDING)
2551 cache_io_start_ = base::TimeTicks::Now(); 2554 cache_io_start_ = base::TimeTicks::Now();
2552 return return_value; 2555 return return_value;
2553 } 2556 }
2554 2557
2555 } // namespace net 2558 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698