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

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: fixes 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
Index: multi_http_fetcher.h
diff --git a/multi_http_fetcher.h b/multi_http_fetcher.h
index 533998b033b74d287943f959d9d30b787f13fb08..0db7ea28564ad74e45959fe825cbd69d45434f26 100644
--- a/multi_http_fetcher.h
+++ b/multi_http_fetcher.h
@@ -24,9 +24,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 +40,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 +138,13 @@ class MultiHttpFetcher : public HttpFetcher, public HttpFetcherDelegate {
(*it)->SetBuildType(is_official);
}
}
+
+ virtual void SetProxies(const std::vector<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 +231,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_;

Powered by Google App Engine
This is Rietveld 408576698