AU: Restrict to HTTPS for official builds.
Also, fix multi http fetcher unit tests to predictably force non-expensive
connections.
BUG=7945
TEST=unit tests; tested on device with dev server as well as with
no /root/.dev_mode, dev server, omaha update
Change-Id: Iacc0188b464ec018fc0dbbc8d7d447386113ceb7
Review URL: http://codereview.chromium.org/4004004
diff --git a/multi_http_fetcher.h b/multi_http_fetcher.h
index 1972347..4328199 100644
--- a/multi_http_fetcher.h
+++ b/multi_http_fetcher.h
@@ -73,8 +73,7 @@
fetchers_[current_index_]->Unpause();
}
- // These two function are overloaded in LibcurlHttp fetcher to speed
- // testing.
+ // These functions are overloaded in LibcurlHttp fetcher for testing purposes.
void set_idle_seconds(int seconds) {
for (typename std::vector<std::tr1::shared_ptr<BaseHttpFetcher> >::iterator
it = fetchers_.begin(),
@@ -89,6 +88,20 @@
(*it)->set_retry_seconds(seconds);
}
}
+ void SetConnectionAsExpensive(bool is_expensive) {
+ for (typename std::vector<std::tr1::shared_ptr<BaseHttpFetcher> >::iterator
+ it = fetchers_.begin(),
+ e = fetchers_.end(); it != e; ++it) {
+ (*it)->SetConnectionAsExpensive(is_expensive);
+ }
+ }
+ void SetBuildType(bool is_official) {
+ for (typename std::vector<std::tr1::shared_ptr<BaseHttpFetcher> >::iterator
+ it = fetchers_.begin(),
+ e = fetchers_.end(); it != e; ++it) {
+ (*it)->SetBuildType(is_official);
+ }
+ }
private:
void SendTransferComplete(HttpFetcher* fetcher, bool successful) {
@@ -173,7 +186,7 @@
}
// If true, do not send any more data or TransferComplete to the delegate.
- bool sent_transfer_complete_;
+ bool sent_transfer_complete_;
RangesVect ranges_;
std::vector<std::tr1::shared_ptr<BaseHttpFetcher> > fetchers_;