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

Side by Side Diff: headless/public/util/http_url_fetcher.cc

Issue 2824813002: Remove URLRequestJob::GetResponseCode implementations. (Closed)
Patch Set: Fix more stuff Created 3 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "headless/public/util/http_url_fetcher.h" 5 #include "headless/public/util/http_url_fetcher.h"
6 6
7 #include "net/base/elements_upload_data_stream.h" 7 #include "net/base/elements_upload_data_stream.h"
8 #include "net/base/io_buffer.h" 8 #include "net/base/io_buffer.h"
9 #include "net/base/upload_bytes_element_reader.h" 9 #include "net/base/upload_bytes_element_reader.h"
10 #include "net/cert/cert_status_flags.h" 10 #include "net/cert/cert_status_flags.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 if (net_error != net::OK) { 176 if (net_error != net::OK) {
177 result_listener_->OnFetchStartError(static_cast<net::Error>(net_error)); 177 result_listener_->OnFetchStartError(static_cast<net::Error>(net_error));
178 return; 178 return;
179 } 179 }
180 180
181 // TODO(alexclarke) apart from the headers there's a lot of stuff in 181 // TODO(alexclarke) apart from the headers there's a lot of stuff in
182 // |request->response_info()| that we drop here. Find a way to pipe it 182 // |request->response_info()| that we drop here. Find a way to pipe it
183 // through. 183 // through.
184 result_listener_->OnFetchComplete( 184 result_listener_->OnFetchComplete(
185 request->url(), request->GetResponseCode(), 185 request->url(), request->response_info().headers,
186 request->response_info().headers,
187 bytes_read_so_far_.c_str(), bytes_read_so_far_.size()); 186 bytes_read_so_far_.c_str(), bytes_read_so_far_.size());
188 } 187 }
189 188
190 HttpURLFetcher::HttpURLFetcher( 189 HttpURLFetcher::HttpURLFetcher(
191 const net::URLRequestContext* url_request_context) 190 const net::URLRequestContext* url_request_context)
192 : url_request_context_(url_request_context) {} 191 : url_request_context_(url_request_context) {}
193 192
194 HttpURLFetcher::~HttpURLFetcher() {} 193 HttpURLFetcher::~HttpURLFetcher() {}
195 194
196 void HttpURLFetcher::StartFetch(const GURL& rewritten_url, 195 void HttpURLFetcher::StartFetch(const GURL& rewritten_url,
197 const std::string& method, 196 const std::string& method,
198 const std::string& post_data, 197 const std::string& post_data,
199 const net::HttpRequestHeaders& request_headers, 198 const net::HttpRequestHeaders& request_headers,
200 ResultListener* result_listener) { 199 ResultListener* result_listener) {
201 delegate_.reset(new Delegate(rewritten_url, method, post_data, 200 delegate_.reset(new Delegate(rewritten_url, method, post_data,
202 request_headers, url_request_context_, 201 request_headers, url_request_context_,
203 result_listener)); 202 result_listener));
204 } 203 }
205 204
206 } // namespace headless 205 } // namespace headless
OLDNEW
« no previous file with comments | « headless/public/util/generic_url_request_job_test.cc ('k') | headless/public/util/testing/generic_url_request_mocks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698