net_instaweb::InstawebContext Class Reference

#include "instaweb_context.h"

List of all members.

Public Types

enum  ContentEncoding { kNone, kGzip, kDeflate, kOther }
enum  ContentDetectionState { kStart, kHtml, kNotHtml }

Public Member Functions

 InstawebContext (request_rec *request, RequestHeaders *request_headers, const ContentType &content_type, ApacheResourceManager *manager, const GoogleString &base_url, bool use_custom_options, const RewriteOptions &options)
 Takes ownership of request_headers.
void Rewrite (const char *input, int size)
void Flush ()
void Finish ()
apr_bucket_brigade * bucket_brigade () const
ContentEncoding content_encoding () const
ApacheResourceManagermanager ()
const GoogleStringoutput ()
bool empty () const
void clear ()
ResponseHeadersresponse_headers ()
bool sent_headers ()
void set_sent_headers (bool sent)
void PopulateHeaders (request_rec *request)
 Populated response_headers_ with the request's headers_out table.

Static Public Member Functions

static ApacheResourceManagerManagerFromServerRec (server_rec *server)
static const char * MakeRequestUrl (request_rec *request)
 Returns a fetchable URI from a request, using the request pool.

Detailed Description

Context for an HTML rewrite.

One is created for responses that appear to be HTML (although there is a basic sanity check that the first non-space char is '<').

The rewriter will put the rewritten content into the output string when flushed or finished. We call Flush when we see the FLUSH bucket, and call Finish when we see the EOS bucket.

Todo:
TODO(sligocki): Factor out similarities between this and ProxyFetch.

Member Function Documentation

static ApacheResourceManager* net_instaweb::InstawebContext::ManagerFromServerRec ( server_rec *  server  )  [static]

Looks up the manager from the server rec.

Todo:
TODO(jmarantz): Is there a better place to put this? It needs to be used by both mod_instaweb.cc and instaweb_handler.cc.
ResponseHeaders* net_instaweb::InstawebContext::response_headers (  )  [inline]
Todo:
TODO(jmarantz): needed?

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Tue May 29 16:33:46 2012 for Page Speed Optimization Libraries by  doxygen 1.6.3