AU: MultiHttpFetcher, an HttpFetcher for specific byte ranges
MultiHttpFetcher takes an HttpFetcher class via template parameter,
and a collection of byte ranges. It hits up the URL multiple times,
once per range specified. For each time, it uses a new HttpFetcher of
the type specified and fast-forwards to the offset requested, and
aborting after enough bytes have been downloaded. Any range many
specify a length of -1, which means until the end of the file (as
dictated by the server). Thus, a single range of [0, -1] makes
MultiHttpFetcher a pass-through.
HttpFetcher change: ability to supply an offset.
LibcurlHttpFetcher changes: offset support (from HttpFetcher API),
ability to be terminted in a write-callback.
test_http_fetcher: support for failures in write() on the socket (at
least in the /big url case).
BUG=7391
TEST=unittests
Review URL: http://codereview.chromium.org/3591018
diff --git a/mock_http_fetcher.h b/mock_http_fetcher.h
index 87cbe99..91d50dd 100644
--- a/mock_http_fetcher.h
+++ b/mock_http_fetcher.h
@@ -34,6 +34,9 @@
// Cleans up all internal state. Does not notify delegate
~MockHttpFetcher();
+ // Ignores this.
+ virtual void SetOffset(off_t offset) {}
+
// Begins the transfer if it hasn't already begun.
virtual void BeginTransfer(const std::string& url);