Page Speed Optimization Libraries
1.9.32.1
|
#include "test_distributed_fetcher.h"
Public Member Functions | |
TestDistributedFetcher (RewriteTestBase *test_base) | |
virtual void | Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch) |
void | set_fail_after_headers (bool x) |
void | set_error_before_headers_complete (bool x) |
If true, simulates an error before headers complete. | |
void | set_blocking_fetch (bool x) |
![]() | |
virtual bool | SupportsHttps () const |
virtual int64 | timeout_ms () |
virtual void | ShutDown () |
void | set_fetch_with_gzip (bool x) |
bool | fetch_with_gzip () const |
AsyncFetch * | EnableInflation (AsyncFetch *fetch) const |
Additional Inherited Members | |
![]() | |
static const int64 | kUnspecifiedTimeout |
static const char | kStatisticsGroup [] |
Default statistics group name. | |
![]() | |
UrlAsyncFetcher () | |
The Fetch implementation that talks directly to the rewrite task via RewriteDriver::FetchResource as opposed to talking to it over the network. The rewrite task in the test environment is RewriteTestBase::other_rewrite_driver_.
|
virtual |
Asynchronously fetch a URL, set the response headers and stream the contents to fetch and call fetch->Done() when the fetch finishes.
There is an unchecked contract that response_headers are set before the response_writer or callback are used. Caution, several implementations do not satisfy this contract (but should).
TODO(sligocki): GoogleString -> GoogleUrl or at least StringPiece.
TODO(sligocki): Include the URL in the fetch, like the request headers.
Implements net_instaweb::UrlAsyncFetcher.
|
inline |
Should the fetch block on the distributed rewrite? We usually want this to be true because that way we can predict the behavior of the shared cache in our tests but some tests require it to be false.
|
inline |
If true, stops writing to the fetch after the headers and HandleDone's success parameter will be false.