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

#include "instaweb_context.h"

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, ApacheServerContext *server_context, const GoogleString &base_url, const RequestContextPtr &request_context, const QueryParams &pagespeed_query_params, const QueryParams &pagespeed_option_cookies, 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
 
ApacheServerContextapache_server_context ()
 
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 ApacheServerContextServerContextFromServerRec (server_rec *server)
 
static const char * MakeRequestUrl (const RewriteOptions &global_options, 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

ResponseHeaders* net_instaweb::InstawebContext::response_headers ( )
inline
Todo:
TODO(jmarantz): needed?
static ApacheServerContext* net_instaweb::InstawebContext::ServerContextFromServerRec ( server_rec *  server)
static

Looks up the apache server context 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.

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