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

Unified Diff: http_fetcher.h

Issue 3106038: AU: Expose the server's HTTP response code in HttpFetcher. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git
Patch Set: rebase and add redirect response code checks Created 10 years, 4 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 | http_fetcher_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: http_fetcher.h
diff --git a/http_fetcher.h b/http_fetcher.h
index 5cd6f08559fc33976cd70be8d81953f45a869f8c..f8e510a61d4c7fd241a8b3f28e0317eb9deea145 100644
--- a/http_fetcher.h
+++ b/http_fetcher.h
@@ -23,14 +23,15 @@ class HttpFetcherDelegate;
class HttpFetcher {
public:
- HttpFetcher() : post_data_set_(false), delegate_(NULL) {}
+ HttpFetcher()
+ : post_data_set_(false),
+ http_response_code_(0),
+ delegate_(NULL) {}
virtual ~HttpFetcher() {}
- void set_delegate(HttpFetcherDelegate* delegate) {
- delegate_ = delegate;
- }
- HttpFetcherDelegate* delegate() const {
- return delegate_;
- }
+
+ void set_delegate(HttpFetcherDelegate* delegate) { delegate_ = delegate; }
+ HttpFetcherDelegate* delegate() const { return delegate_; }
+ int http_response_code() const { return http_response_code_; }
// Optional: Post data to the server. The HttpFetcher should make a copy
// of this data and upload it via HTTP POST during the transfer.
@@ -66,6 +67,11 @@ class HttpFetcher {
bool post_data_set_;
std::vector<char> post_data_;
+ // The server's HTTP response code from the last transfer. This
+ // field should be set to 0 when a new transfer is initiated, and
+ // set to the response code when the transfer is complete.
+ int http_response_code_;
+
// The delegate; may be NULL.
HttpFetcherDelegate* delegate_;
private:
« no previous file with comments | « no previous file | http_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698