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

Unified Diff: multi_http_fetcher.h

Issue 5205002: AU: Manual proxy support (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: missed one fix for review Created 10 years, 1 month 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 | « mock_http_fetcher.h ('k') | omaha_request_action_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: multi_http_fetcher.h
diff --git a/multi_http_fetcher.h b/multi_http_fetcher.h
index 533998b033b74d287943f959d9d30b787f13fb08..3d5ee113f2b7d99447313444b13bcd6b493bab4f 100644
--- a/multi_http_fetcher.h
+++ b/multi_http_fetcher.h
@@ -5,6 +5,7 @@
#ifndef CHROMEOS_PLATFORM_UPDATE_ENGINE_MULTI_HTTP_FETCHER_H__
#define CHROMEOS_PLATFORM_UPDATE_ENGINE_MULTI_HTTP_FETCHER_H__
+#include <deque>
#include <tr1/memory>
#include <utility>
#include <vector>
@@ -24,9 +25,11 @@ template<typename BaseHttpFetcher>
class MultiHttpFetcher : public HttpFetcher, public HttpFetcherDelegate {
public:
typedef std::vector<std::pair<off_t, off_t> > RangesVect;
+ typedef std::vector<std::tr1::shared_ptr<BaseHttpFetcher> > FetchersVect;
- MultiHttpFetcher()
- : sent_transfer_complete_(false),
+ MultiHttpFetcher(ProxyResolver* proxy_resolver)
+ : HttpFetcher(proxy_resolver),
+ sent_transfer_complete_(false),
pending_next_fetcher_(false),
current_index_(0),
bytes_received_this_fetcher_(0) {}
@@ -38,9 +41,11 @@ class MultiHttpFetcher : public HttpFetcher, public HttpFetcherDelegate {
for (typename std::vector<std::tr1::shared_ptr<BaseHttpFetcher>
>::iterator it = fetchers_.begin(), e = fetchers_.end();
it != e; ++it) {
- (*it) = std::tr1::shared_ptr<BaseHttpFetcher>(new BaseHttpFetcher);
+ (*it) = std::tr1::shared_ptr<BaseHttpFetcher>(
+ new BaseHttpFetcher(proxy_resolver_));
(*it)->set_delegate(this);
}
+ LOG(INFO) << "done w/ list";
}
void SetOffset(off_t offset) {} // for now, doesn't support this
@@ -134,6 +139,13 @@ class MultiHttpFetcher : public HttpFetcher, public HttpFetcherDelegate {
(*it)->SetBuildType(is_official);
}
}
+
+ virtual void SetProxies(const std::deque<std::string>& proxies) {
+ for (typename FetchersVect::iterator it = fetchers_.begin(),
+ e = fetchers_.end(); it != e; ++it) {
+ (*it)->SetProxies(proxies);
+ }
+ }
private:
void SendTransferComplete(HttpFetcher* fetcher, bool successful) {
@@ -220,7 +232,7 @@ class MultiHttpFetcher : public HttpFetcher, public HttpFetcherDelegate {
bool pending_next_fetcher_;
RangesVect ranges_;
- std::vector<std::tr1::shared_ptr<BaseHttpFetcher> > fetchers_;
+ FetchersVect fetchers_;
RangesVect::size_type current_index_; // index into ranges_, fetchers_
off_t bytes_received_this_fetcher_;
« no previous file with comments | « mock_http_fetcher.h ('k') | omaha_request_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698