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

Unified Diff: mock_http_fetcher.cc

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 | « libcurl_http_fetcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mock_http_fetcher.cc
diff --git a/mock_http_fetcher.cc b/mock_http_fetcher.cc
index 04ec7f6267c17e533253a521231359f1a1f78074..2e1186529a8c72abc2b67e903ddf75fe01786020 100644
--- a/mock_http_fetcher.cc
+++ b/mock_http_fetcher.cc
@@ -17,6 +17,7 @@ MockHttpFetcher::~MockHttpFetcher() {
}
void MockHttpFetcher::BeginTransfer(const std::string& url) {
+ http_response_code_ = 0;
if (sent_size_ < data_.size())
SendData(true);
}
@@ -34,7 +35,8 @@ bool MockHttpFetcher::SendData(bool skip_delivery) {
sent_size_ += chunk_size;
CHECK_LE(sent_size_, data_.size());
if (sent_size_ == data_.size()) {
- // We've sent all the data. notify of success
+ // We've sent all the data. Notify of success.
+ http_response_code_ = 200;
delegate_->TransferComplete(this, true);
}
}
« no previous file with comments | « libcurl_http_fetcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698