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

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

Issue 10913179: net: Make UploadDataStream::Init() asynchronous. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: changed argument order Created 8 years, 3 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/base/upload_file_element_reader.cc ('k') | net/http/http_stream_parser_unittest.cc » ('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 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
740 &request_headers_); 740 &request_headers_);
741 741
742 request_headers_.MergeFrom(request_->extra_headers); 742 request_headers_.MergeFrom(request_->extra_headers);
743 } 743 }
744 744
745 int HttpNetworkTransaction::DoBuildRequest() { 745 int HttpNetworkTransaction::DoBuildRequest() {
746 next_state_ = STATE_BUILD_REQUEST_COMPLETE; 746 next_state_ = STATE_BUILD_REQUEST_COMPLETE;
747 request_body_.reset(NULL); 747 request_body_.reset(NULL);
748 if (request_->upload_data) { 748 if (request_->upload_data) {
749 request_body_.reset(new UploadDataStream(request_->upload_data)); 749 request_body_.reset(new UploadDataStream(request_->upload_data));
750 const int error_code = request_body_->Init(); 750 const int error_code = request_body_->InitSync();
751 if (error_code != OK) { 751 if (error_code != OK) {
752 request_body_.reset(NULL); 752 request_body_.reset(NULL);
753 return error_code; 753 return error_code;
754 } 754 }
755 } 755 }
756 756
757 headers_valid_ = false; 757 headers_valid_ = false;
758 758
759 // This is constructed lazily (instead of within our Start method), so that 759 // This is constructed lazily (instead of within our Start method), so that
760 // we have proxy info available. 760 // we have proxy info available.
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1414 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, 1414 description = base::StringPrintf("Unknown state 0x%08X (%u)", state,
1415 state); 1415 state);
1416 break; 1416 break;
1417 } 1417 }
1418 return description; 1418 return description;
1419 } 1419 }
1420 1420
1421 #undef STATE_CASE 1421 #undef STATE_CASE
1422 1422
1423 } // namespace net 1423 } // namespace net
OLDNEW
« no previous file with comments | « net/base/upload_file_element_reader.cc ('k') | net/http/http_stream_parser_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698