Page Speed Optimization Libraries
1.3.25.1
|
#include "test_rewrite_driver_factory.h"
Classes | |
class | CreateFilterCallback |
class | CreateRewriterCallback |
class | PlatformSpecificConfigurationCallback |
Public Member Functions | |
TestRewriteDriverFactory (const StringPiece &temp_dir, MockUrlFetcher *mock_fetcher) | |
DelayCache * | delay_cache () |
LRUCache * | lru_cache () |
MockTimer * | mock_timer () |
MockHasher * | mock_hasher () |
MemFileSystem * | mem_file_system () |
FakeUrlAsyncFetcher * | mock_url_async_fetcher () |
WaitUrlAsyncFetcher * | wait_url_async_fetcher () |
CountingUrlAsyncFetcher * | counting_url_async_fetcher () |
MockTimeCache * | mock_time_cache () |
void | SetupWaitFetcher () |
void | CallFetcherCallbacksForDriver (RewriteDriver *driver) |
MockMessageHandler * | mock_message_handler () |
MockScheduler * | mock_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 () |
void | AddPlatformSpecificConfigurationCallback (PlatformSpecificConfigurationCallback *callback) |
Does NOT take ownership of the callback. | |
void | ClearPlatformSpecificConfigurationCallback () |
virtual RewriteOptions * | NewRewriteOptions () |
Note that this disables ajax rewriting by default. | |
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 Hasher * | NewHasher () |
virtual MessageHandler * | DefaultHtmlParseMessageHandler () |
virtual MessageHandler * | DefaultMessageHandler () |
virtual UrlFetcher * | DefaultUrlFetcher () |
virtual UrlAsyncFetcher * | DefaultAsyncUrlFetcher () |
virtual FileSystem * | DefaultFileSystem () |
virtual Timer * | DefaultTimer () |
virtual void | SetupCaches (ServerContext *resource_manager) |
virtual UrlNamer * | DefaultUrlNamer () |
virtual Scheduler * | CreateScheduler () |
virtual void | AddPlatformSpecificDecodingPasses (RewriteDriver *driver) |
virtual void | AddPlatformSpecificRewritePasses (RewriteDriver *driver) |
virtual void | ApplyPlatformSpecificConfiguration (RewriteDriver *driver) |
RewriteDriverFactory implementation for use in tests, using mock time, mock fetchers, and a memory-based file system.
virtual void net_instaweb::TestRewriteDriverFactory::AddPlatformSpecificDecodingPasses | ( | RewriteDriver * | driver | ) | [protected, virtual] |
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.
virtual void net_instaweb::TestRewriteDriverFactory::AddPlatformSpecificRewritePasses | ( | RewriteDriver * | driver | ) | [protected, virtual] |
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.
virtual void net_instaweb::TestRewriteDriverFactory::ApplyPlatformSpecificConfiguration | ( | RewriteDriver * | driver | ) | [protected, virtual] |
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.
virtual Scheduler* net_instaweb::TestRewriteDriverFactory::CreateScheduler | ( | ) | [protected, virtual] |
Subclasses can override this to create an appropriate Scheduler subclass if the default isn't acceptable.
Reimplemented from net_instaweb::RewriteDriverFactory.
virtual UrlFetcher* net_instaweb::TestRewriteDriverFactory::DefaultUrlFetcher | ( | ) | [protected, virtual] |
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.
virtual UrlNamer* net_instaweb::TestRewriteDriverFactory::DefaultUrlNamer | ( | ) | [protected, virtual] |
They may also supply a custom Url namer. The default implementation performs sharding and appends '.pagespeed.<filter>.<hash>.<extension>'.
Reimplemented from net_instaweb::RewriteDriverFactory.
void net_instaweb::TestRewriteDriverFactory::set_add_platform_specific_decoding_passes | ( | bool | value | ) | [inline] |
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.