Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
net_instaweb::HttpDumpUrlFetcher Class Reference

#include "http_dump_url_fetcher.h"

Inheritance diagram for net_instaweb::HttpDumpUrlFetcher:
net_instaweb::UrlAsyncFetcher

Public Member Functions

 HttpDumpUrlFetcher (const StringPiece &root_dir, FileSystem *file_system, Timer *timer)
 
bool GetFilename (const GoogleUrl &url, GoogleString *filename, MessageHandler *message_handler)
 Non-static version that uses the fetcher's root dir.
 
virtual void Fetch (const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
 This is a synchronous/blocking implementation.
 
bool ParseFile (FileSystem::InputFile *file, ResponseHeaders *response_headers, Writer *response_writer, MessageHandler *handler)
 
void RespondError (ResponseHeaders *response_headers, Writer *response_writer, MessageHandler *handler)
 Helper function to return a generic error response.
 
void set_print_urls (bool on)
 Print URLs each time they are fetched.
 
- Public Member Functions inherited from net_instaweb::UrlAsyncFetcher
virtual bool SupportsHttps () const
 
virtual int64 timeout_ms ()
 
virtual void ShutDown ()
 
void set_fetch_with_gzip (bool x)
 
bool fetch_with_gzip () const
 
AsyncFetchEnableInflation (AsyncFetch *fetch) const
 

Static Public Member Functions

static bool GetFilenameFromUrl (const StringPiece &root_dir, const GoogleUrl &url, GoogleString *filename, MessageHandler *message_handler)
 

Static Public Attributes

static const char kGzipContentLengthAttribute []
 
- Static Public Attributes inherited from net_instaweb::UrlAsyncFetcher
static const int64 kUnspecifiedTimeout
 

Additional Inherited Members

- Protected Member Functions inherited from net_instaweb::UrlAsyncFetcher
 UrlAsyncFetcher ()
 

Detailed Description

Todo:
TODO(sligocki): Can we forward declare these somehow? class FileSystem; class FileSystem::InputFile;

HttpDumpFetcher fetches raw HTTP dumps from the filesystem. These dumps could be compressed or chunked, the fetcher does not decompress or de-chunk them.

Member Function Documentation

static bool net_instaweb::HttpDumpUrlFetcher::GetFilenameFromUrl ( const StringPiece &  root_dir,
const GoogleUrl url,
GoogleString filename,
MessageHandler message_handler 
)
static

Converts URL into filename the way that Latency Lab does. Note: root_dir_ must be standardized to have a / at end already.

bool net_instaweb::HttpDumpUrlFetcher::ParseFile ( FileSystem::InputFile file,
ResponseHeaders response_headers,
Writer response_writer,
MessageHandler handler 
)

Parse file into response_headers and response_writer as if it were bytes off the wire.

Member Data Documentation

const char net_instaweb::HttpDumpUrlFetcher::kGzipContentLengthAttribute[]
static

When the slurped data is gzipped, but request headers are made that don't include 'gzip' in an Accept-Encodings header, then this fetcher inflates the gzipped output as it streams. It also captures the original gzipped size in this attribute in the response headers.


The documentation for this class was generated from the following file: