Page Speed Optimization Libraries
1.3.25.1
|
#include "in_place_resource_recorder.h"
Public Member Functions | |
InPlaceResourceRecorder (StringPiece url, RequestHeaders *request_headers, bool respect_vary, HTTPCache *cache, Statistics *statistics, MessageHandler *handler) | |
virtual bool | Write (const StringPiece &contents, MessageHandler *handler) |
virtual bool | Flush (MessageHandler *handler) |
void | Fail () |
Call if something went wrong. The results will not be added to cache. | |
void | DoneAndSetHeaders (ResponseHeaders *response_headers) |
const GoogleString & | url () const |
MessageHandler * | handler () |
Static Public Member Functions | |
static void | InitStats (Statistics *statistics) |
Records a copy of a resource streamed through it and saves the result to the cache if it's cacheable. Used in the In-Place Resource Optimization (IPRO) flow to get resources into the cache.
net_instaweb::InPlaceResourceRecorder::InPlaceResourceRecorder | ( | StringPiece | url, |
RequestHeaders * | request_headers, | ||
bool | respect_vary, | ||
HTTPCache * | cache, | ||
Statistics * | statistics, | ||
MessageHandler * | handler | ||
) |
Takes ownership of request_headers, but not cache nor handler. Like other callbacks, InPlaceResourceRecorder is self-owned and will delete itself when DoneAndSetHeaders(). is called.
void net_instaweb::InPlaceResourceRecorder::DoneAndSetHeaders | ( | ResponseHeaders * | response_headers | ) |
Call when finished and the final response headers are known. Because of Apache's quirky filter order, we cannot get both the uncompressed final contents and the complete headers at the same time. Does not take ownership of response_headers.
Deletes itself. Do not use object after calling DoneAndSetHeaders().