Page Speed Optimization Libraries  1.5.27.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::TestDistributedFetcher Class Reference

#include "test_distributed_fetcher.h"

Inheritance diagram for net_instaweb::TestDistributedFetcher:
net_instaweb::UrlAsyncFetcher

List of all members.

Public Member Functions

virtual void Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
 TestDistributedFetcher (RewriteTestBase *test_base)
void set_fail_after_headers (bool x)

Detailed Description

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_.


Member Function Documentation

virtual void net_instaweb::TestDistributedFetcher::Fetch ( const GoogleString &  url,
MessageHandler message_handler,
AsyncFetch fetch 
) [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:

TODO(sligocki): GoogleString -> GoogleUrl or at least StringPiece.

TODO(sligocki): Include the URL in the fetch, like the request headers.

Implements net_instaweb::UrlAsyncFetcher.

If true, stops writing to the fetch after the headers and HandleDone's success parameter will be false.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines