Page Speed Optimization Libraries  1.8.31.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
net_instaweb::FileRewriter Class Reference

#include "static_rewriter.h"

Inheritance diagram for net_instaweb::FileRewriter:
net_instaweb::RewriteDriverFactory

List of all members.

Public Member Functions

 FileRewriter (const ProcessContext &process_context, const RewriteGflags *gflags, bool echo_errors_to_stdout)
virtual Hasher * NewHasher ()
virtual UrlAsyncFetcherDefaultAsyncUrlFetcher ()
virtual MessageHandler * DefaultHtmlParseMessageHandler ()
virtual MessageHandler * DefaultMessageHandler ()
virtual FileSystem * DefaultFileSystem ()
virtual void SetupCaches (ServerContext *server_context)
virtual Statistics * statistics ()
virtual ServerContextNewServerContext ()
virtual ServerContextNewDecodingServerContext ()
virtual bool UseBeaconResultsInFilters () const

Detailed Description

Implements a baseline RewriteDriverFactory with the simplest possible options for cache, fetchers, & system interface.

Todo:
TODO(jmarantz): fill out enough functionality so that this will be a functional static rewriter that could optimize an HTML file passed as a command-line parameter or via stdin.

Member Function Documentation

Implementors of RewriteDriverFactory must supply default definitions for each of these methods, although they may be overridden via set_ methods above. These methods all instantiate objects and transfer ownership to the caller.

Implements net_instaweb::RewriteDriverFactory.

Create a new ServerContext used for decoding only. Unlike NewServerContext, the resulting ServerContext should not be fresh, but should have some of its platform dependencies injected --- but just enough for decoding URLs, and not full operation. At the time of writing it needs the timer, url namer, hasher, message handler, and stats; expensive stuff like cache backends is not needed, however.

You may find InitStubDecodingServerContext() useful for doing that, as it will inject all of these from what's available in 'this'.

Implements net_instaweb::RewriteDriverFactory.

Creates a new ServerContext* object. ServerContext itself must be overridden per Factory as it has at least one pure virtual method.

Implements net_instaweb::RewriteDriverFactory.

virtual void net_instaweb::FileRewriter::SetupCaches ( ServerContext server_context) [virtual]

Called from InitServerContext, but virtualized separately as it is platform-specific. This method must call on the server context: set_http_cache, set_metadata_cache, set_filesystem_metadata_cache, and MakePropertyCaches.

Implements net_instaweb::RewriteDriverFactory.

virtual Statistics* net_instaweb::FileRewriter::statistics ( ) [virtual]

statistics (default is NullStatistics). This can be overridden by calling SetStatistics, either from subclasses or externally.

Reimplemented from net_instaweb::RewriteDriverFactory.

virtual bool net_instaweb::FileRewriter::UseBeaconResultsInFilters ( ) const [inline, virtual]

Returns true if this platform uses beacon-based measurements to make run-time decisions. This is used to determine how to configure various beacon-based filters.

Implements net_instaweb::RewriteDriverFactory.


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