Page Speed Optimization Libraries  1.4.26.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions
net_instaweb::InPlaceResourceRecorder Class Reference

#include "in_place_resource_recorder.h"

Inheritance diagram for net_instaweb::InPlaceResourceRecorder:
net_instaweb::Writer

List of all members.

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 GoogleStringurl () const
MessageHandlerhandler ()

Static Public Member Functions

static void InitStats (Statistics *statistics)

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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().


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