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

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

Issue 12886022: Implement offline mode behind a flag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Setup OfflinePolicy for all started requests. 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
« no previous file with comments | « net/http/http_network_layer_unittest.cc ('k') | net/http/http_response_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
818 send_start_time_ = base::TimeTicks::Now(); 818 send_start_time_ = base::TimeTicks::Now();
819 next_state_ = STATE_SEND_REQUEST_COMPLETE; 819 next_state_ = STATE_SEND_REQUEST_COMPLETE;
820 820
821 return stream_->SendRequest(request_headers_, &response_, io_callback_); 821 return stream_->SendRequest(request_headers_, &response_, io_callback_);
822 } 822 }
823 823
824 int HttpNetworkTransaction::DoSendRequestComplete(int result) { 824 int HttpNetworkTransaction::DoSendRequestComplete(int result) {
825 send_end_time_ = base::TimeTicks::Now(); 825 send_end_time_ = base::TimeTicks::Now();
826 if (result < 0) 826 if (result < 0)
827 return HandleIOError(result); 827 return HandleIOError(result);
828 response_.network_accessed = true;
828 next_state_ = STATE_READ_HEADERS; 829 next_state_ = STATE_READ_HEADERS;
829 return OK; 830 return OK;
830 } 831 }
831 832
832 int HttpNetworkTransaction::DoReadHeaders() { 833 int HttpNetworkTransaction::DoReadHeaders() {
833 next_state_ = STATE_READ_HEADERS_COMPLETE; 834 next_state_ = STATE_READ_HEADERS_COMPLETE;
834 return stream_->ReadResponseHeaders(io_callback_); 835 return stream_->ReadResponseHeaders(io_callback_);
835 } 836 }
836 837
837 int HttpNetworkTransaction::HandleConnectionClosedBeforeEndOfHeaders() { 838 int HttpNetworkTransaction::HandleConnectionClosedBeforeEndOfHeaders() {
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
1428 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1429 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1429 state); 1430 state);
1430 break; 1431 break;
1431 } 1432 }
1432 return description; 1433 return description;
1433 } 1434 }
1434 1435
1435 #undef STATE_CASE 1436 #undef STATE_CASE
1436 1437
1437 } // namespace net 1438 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_network_layer_unittest.cc ('k') | net/http/http_response_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698