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

#include "test_rewrite_driver_factory.h"

Inheritance diagram for net_instaweb::TestRewriteDriverFactory:
net_instaweb::RewriteDriverFactory net_instaweb::CustomRewriteTestBase< OptionsClass >::CustomTestRewriteDriverFactory

List of all members.

Classes

class  CreateFilterCallback
class  CreateRewriterCallback
class  PlatformSpecificConfigurationCallback

Public Member Functions

 TestRewriteDriverFactory (const StringPiece &temp_dir, MockUrlFetcher *mock_fetcher, MockUrlFetcher *mock_distributed_fetcher)
DelayCachedelay_cache ()
LRUCachelru_cache ()
MockTimermock_timer ()
MockHashermock_hasher ()
MemFileSystemmem_file_system ()
FakeUrlAsyncFetchermock_url_async_fetcher ()
WaitUrlAsyncFetcherwait_url_async_fetcher ()
CountingUrlAsyncFetchercounting_url_async_fetcher ()
CountingUrlAsyncFetchercounting_distributed_async_fetcher ()
MockTimeCachemock_time_cache ()
void SetupWaitFetcher ()
void CallFetcherCallbacksForDriver (RewriteDriver *driver)
MockMessageHandlermock_message_handler ()
MockSchedulermock_scheduler ()
bool use_test_url_namer () const
void SetUseTestUrlNamer (bool x)
void AddCreateFilterCallback (CreateFilterCallback *callback)
 Does NOT take ownership of the callback.
void ClearFilterCallbackVector ()
void AddCreateRewriterCallback (CreateRewriterCallback *callback)
 Does NOT take ownership of the callback.
void ClearRewriterCallbackVector ()
virtual bool UseBeaconResultsInFilters () const
 By default this is false, but can be reset.
void set_use_beacon_results_in_filters (bool b)
void AddPlatformSpecificConfigurationCallback (PlatformSpecificConfigurationCallback *callback)
 Does NOT take ownership of the callback.
void ClearPlatformSpecificConfigurationCallback ()
virtual RewriteOptionsNewRewriteOptions ()
 Note that this disables ajax rewriting by default.
virtual ServerContextNewServerContext ()
 Note that this enables html proxying.
virtual bool IsDebugClient (const GoogleString &ip) const
 Base method that returns true if the given ip is a debug ip.
void set_add_platform_specific_decoding_passes (bool value)
bool add_platform_specific_decoding_passes () const
void AdvanceTimeMs (int64 delta_ms)
 Advances the mock scheduler by delta_ms.
void SetupCohort (PropertyCache *cache, const GoogleString &cohort_name)
 Sets up the cohort in the PropertyCache provided.

Static Public Attributes

static const int64 kStartTimeMs
 Arbitrary time to start MockTimer.
static const char kUrlNamerScheme []
 Env.var URL_NAMER_SCHEME.

Protected Member Functions

virtual HasherNewHasher ()
virtual MessageHandlerDefaultHtmlParseMessageHandler ()
virtual MessageHandlerDefaultMessageHandler ()
virtual UrlFetcherDefaultUrlFetcher ()
virtual UrlAsyncFetcherDefaultAsyncUrlFetcher ()
virtual UrlAsyncFetcherDefaultDistributedUrlFetcher ()
virtual FileSystemDefaultFileSystem ()
virtual TimerDefaultTimer ()
virtual void SetupCaches (ServerContext *resource_manager)
virtual UrlNamerDefaultUrlNamer ()
virtual SchedulerCreateScheduler ()
virtual void AddPlatformSpecificDecodingPasses (RewriteDriver *driver)
virtual void AddPlatformSpecificRewritePasses (RewriteDriver *driver)
virtual void ApplyPlatformSpecificConfiguration (RewriteDriver *driver)

Detailed Description

RewriteDriverFactory implementation for use in tests, using mock time, mock fetchers, and a memory-based file system.


Member Function Documentation

Provides an optional hook for adding rewriters to the .pagespeed. resource decoding chain. This should be used for rewriters that are specific to a particular RewriteDriverFactory implementation. The caller should only use the resulting driver for reconstructing a .pagespeed. resource, not for transforming HTML. Therefore, implementations should add any platform-specific rewriter whose id might appear in a .pagespeed. URL.

Reimplemented from net_instaweb::RewriteDriverFactory.

Provides an optional hook for adding rewrite passes to the HTML filter chain. This should be used for filters that are specific to a particular RewriteDriverFactory implementation.

Reimplemented from net_instaweb::RewriteDriverFactory.

Provides an optional hook for customizing the RewriteDriver object using the options set on it. This is called before RewriteDriver::AddFilters() and AddPlatformSpecificRewritePasses().

Reimplemented from net_instaweb::RewriteDriverFactory.

Subclasses can override this to create an appropriate Scheduler subclass if the default isn't acceptable.

Reimplemented from net_instaweb::RewriteDriverFactory.

Implementors of RewriteDriverFactory must supply default definitions for each of these methods, although they may be overridden via set_ methods above.

Implements net_instaweb::RewriteDriverFactory.

They may also supply a custom Url namer. The default implementation performs sharding and appends '.pagespeed.<filter>.<hash>.<extension>'.

Reimplemented from net_instaweb::RewriteDriverFactory.

Enable or disable adding the contents of rewriter_callback_vector_ within AddPlatformSpecificRewritePasses.

virtual void net_instaweb::TestRewriteDriverFactory::SetupCaches ( ServerContext server_context) [protected, 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.


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