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

Side by Side Diff: components/cronet/android/url_request_peer.cc

Issue 367763004: WIP: Some cronet modifications for the AndroidGSA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Second attempt on UploadChannel Created 6 years, 5 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
« no previous file with comments | « components/cronet/android/url_request_peer.h ('k') | net/url_request/url_request.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "url_request_peer.h" 5 #include "url_request_peer.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "net/base/load_flags.h" 8 #include "net/base/load_flags.h"
9 #include "net/http/http_status_code.h" 9 #include "net/http/http_status_code.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 69
70 std::string URLRequestPeer::GetHeader(const std::string &name) const { 70 std::string URLRequestPeer::GetHeader(const std::string &name) const {
71 std::string value; 71 std::string value;
72 if (url_request_ != NULL) { 72 if (url_request_ != NULL) {
73 url_request_->GetResponseHeaderByName(name, &value); 73 url_request_->GetResponseHeaderByName(name, &value);
74 } 74 }
75 return value; 75 return value;
76 } 76 }
77 77
78 bool URLRequestPeer::GetFullRequestHeaders(
79 net::HttpRequestHeaders* headers) const {
80 if (url_request_ == NULL) {
81 return false;
82 }
83 return url_request_->GetFullRequestHeaders(headers);
mef 2014/08/04 21:12:43 This returns *request* headers, not *response* hea
miloslav 2014/08/18 17:42:25 Oh my, I must have been really tired before my vac
84 }
85
86
78 void URLRequestPeer::Start() { 87 void URLRequestPeer::Start() {
79 context_->GetNetworkTaskRunner()->PostTask( 88 context_->GetNetworkTaskRunner()->PostTask(
80 FROM_HERE, 89 FROM_HERE,
81 base::Bind(&URLRequestPeer::OnInitiateConnection, 90 base::Bind(&URLRequestPeer::OnInitiateConnection,
82 base::Unretained(this))); 91 base::Unretained(this)));
83 } 92 }
84 93
85 void URLRequestPeer::OnAppendChunk(const char* bytes, 94 void URLRequestPeer::OnAppendChunk(const char* bytes,
86 int bytes_len, 95 int bytes_len,
87 bool is_last_chunk) { 96 bool is_last_chunk) {
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 280
272 delegate_->OnBytesRead(this); 281 delegate_->OnBytesRead(this);
273 delegate_->OnRequestFinished(this); 282 delegate_->OnRequestFinished(this);
274 } 283 }
275 284
276 unsigned char* URLRequestPeer::Data() const { 285 unsigned char* URLRequestPeer::Data() const {
277 return reinterpret_cast<unsigned char*>(read_buffer_->StartOfBuffer()); 286 return reinterpret_cast<unsigned char*>(read_buffer_->StartOfBuffer());
278 } 287 }
279 288
280 } // namespace cronet 289 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/android/url_request_peer.h ('k') | net/url_request/url_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698