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

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 11419034: net: Move ownership of UploadDataStream from URLRequestHttpJob to URLRequest (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix ASAN Created 8 years, 1 month 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
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/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 #include "net/base/filter.h" 21 #include "net/base/filter.h"
22 #include "net/base/host_port_pair.h" 22 #include "net/base/host_port_pair.h"
23 #include "net/base/load_flags.h" 23 #include "net/base/load_flags.h"
24 #include "net/base/mime_util.h" 24 #include "net/base/mime_util.h"
25 #include "net/base/net_errors.h" 25 #include "net/base/net_errors.h"
26 #include "net/base/net_util.h" 26 #include "net/base/net_util.h"
27 #include "net/base/network_delegate.h" 27 #include "net/base/network_delegate.h"
28 #include "net/base/sdch_manager.h" 28 #include "net/base/sdch_manager.h"
29 #include "net/base/ssl_cert_request_info.h" 29 #include "net/base/ssl_cert_request_info.h"
30 #include "net/base/ssl_config_service.h" 30 #include "net/base/ssl_config_service.h"
31 #include "net/base/upload_data_stream.h"
32 #include "net/cookies/cookie_monster.h" 31 #include "net/cookies/cookie_monster.h"
33 #include "net/http/http_network_session.h" 32 #include "net/http/http_network_session.h"
34 #include "net/http/http_request_headers.h" 33 #include "net/http/http_request_headers.h"
35 #include "net/http/http_response_headers.h" 34 #include "net/http/http_response_headers.h"
36 #include "net/http/http_response_info.h" 35 #include "net/http/http_response_info.h"
37 #include "net/http/http_status_code.h" 36 #include "net/http/http_status_code.h"
38 #include "net/http/http_transaction.h" 37 #include "net/http/http_transaction.h"
39 #include "net/http/http_transaction_delegate.h" 38 #include "net/http/http_transaction_delegate.h"
40 #include "net/http/http_transaction_factory.h" 39 #include "net/http/http_transaction_factory.h"
41 #include "net/http/http_util.h" 40 #include "net/http/http_util.h"
(...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after
887 ResetTimer(); 886 ResetTimer();
888 887
889 // Update the cookies, since the cookie store may have been updated from the 888 // Update the cookies, since the cookie store may have been updated from the
890 // headers in the 401/407. Since cookies were already appended to 889 // headers in the 401/407. Since cookies were already appended to
891 // extra_headers, we need to strip them out before adding them again. 890 // extra_headers, we need to strip them out before adding them again.
892 request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kCookie); 891 request_info_.extra_headers.RemoveHeader(HttpRequestHeaders::kCookie);
893 892
894 AddCookieHeaderAndStart(); 893 AddCookieHeaderAndStart();
895 } 894 }
896 895
897 void URLRequestHttpJob::SetUpload(UploadData* upload) { 896 void URLRequestHttpJob::SetUpload(UploadDataStream* upload) {
898 DCHECK(!transaction_.get()) << "cannot change once started"; 897 DCHECK(!transaction_.get()) << "cannot change once started";
899 upload_data_stream_.reset(new UploadDataStream(upload)); 898 request_info_.upload_data_stream = upload;
900 request_info_.upload_data_stream = upload_data_stream_.get();
901 } 899 }
902 900
903 void URLRequestHttpJob::SetExtraRequestHeaders( 901 void URLRequestHttpJob::SetExtraRequestHeaders(
904 const HttpRequestHeaders& headers) { 902 const HttpRequestHeaders& headers) {
905 DCHECK(!transaction_.get()) << "cannot change once started"; 903 DCHECK(!transaction_.get()) << "cannot change once started";
906 request_info_.extra_headers.CopyFrom(headers); 904 request_info_.extra_headers.CopyFrom(headers);
907 } 905 }
908 906
909 void URLRequestHttpJob::Start() { 907 void URLRequestHttpJob::Start() {
910 DCHECK(!transaction_.get()); 908 DCHECK(!transaction_.get());
(...skipping 665 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 1574
1577 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1575 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1578 awaiting_callback_ = false; 1576 awaiting_callback_ = false;
1579 } 1577 }
1580 1578
1581 void URLRequestHttpJob::OnDetachRequest() { 1579 void URLRequestHttpJob::OnDetachRequest() {
1582 http_transaction_delegate_->OnDetachRequest(); 1580 http_transaction_delegate_->OnDetachRequest();
1583 } 1581 }
1584 1582
1585 } // namespace net 1583 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698