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

Unified Diff: components/update_client/url_request_post_interceptor.cc

Issue 2827233005: Remove URLRequestJob::GetResponseCode implementations outside of net/. (Closed)
Patch Set: Oops 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | extensions/browser/extension_protocols.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/update_client/url_request_post_interceptor.cc
diff --git a/components/update_client/url_request_post_interceptor.cc b/components/update_client/url_request_post_interceptor.cc
index 3850160612036dd51a96f82183d98c70af866b63..f3419b44f68d19224918ff88ccec75af750499ba 100644
--- a/components/update_client/url_request_post_interceptor.cc
+++ b/components/update_client/url_request_post_interceptor.cc
@@ -12,6 +12,8 @@
#include "components/update_client/test_configurator.h"
#include "net/base/upload_bytes_element_reader.h"
#include "net/base/upload_data_stream.h"
+#include "net/http/http_response_headers.h"
+#include "net/http/http_util.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_interceptor.h"
@@ -32,7 +34,12 @@ class URLRequestMockJob : public net::URLRequestSimpleJob {
response_body_(response_body) {}
protected:
- int GetResponseCode() const override { return response_code_; }
+ void GetResponseInfo(net::HttpResponseInfo* info) override {
+ std::string headers =
Sorin Jianu 2017/04/21 19:56:27 can be declared const.
mmenke 2017/04/21 20:03:03 Done.
+ base::StringPrintf("HTTP/1.1 %i OK\r\n\r\n", response_code_);
+ info->headers = new net::HttpResponseHeaders(
Sorin Jianu 2017/04/21 19:56:27 Most likely, we could use base::MakeShared to avoi
mmenke 2017/04/21 20:03:03 Done.
+ net::HttpUtil::AssembleRawHeaders(headers.c_str(), headers.length()));
+ }
int GetData(std::string* mime_type,
std::string* charset,
« no previous file with comments | « no previous file | extensions/browser/extension_protocols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698