Page Speed Optimization Libraries
1.13.35.1
|
Creates an Apache RewriteDriver. More...
#include "apache_rewrite_driver_factory.h"
Public Member Functions | |
ApacheRewriteDriverFactory (const ProcessContext &process_context, server_rec *server, const StringPiece &version) | |
ApacheMessageHandler * | apache_message_handler () |
virtual void | NonStaticInitStats (Statistics *statistics) |
ApacheServerContext * | MakeApacheServerContext (server_rec *server) |
bool | PoolDestroyed (ApacheServerContext *rm) |
virtual ApacheConfig * | NewRewriteOptions () |
virtual ApacheConfig * | NewRewriteOptionsForQuery () |
void | SetNeedSchedulerThread () |
virtual void | set_message_buffer_size (int x) |
Needed by mod_instaweb.cc:ParseDirective(). | |
virtual bool | IsServerThreaded () |
virtual int | LookupThreadLimit () |
Public Member Functions inherited from net_instaweb::SystemRewriteDriverFactory | |
SystemRewriteDriverFactory (const ProcessContext &process_context, SystemThreadSystem *thread_system, AbstractSharedMem *shared_mem_runtime, StringPiece hostname, int port) | |
void | Init () |
AbstractSharedMem * | shared_mem_runtime () const |
SharedMemStatistics * | AllocateAndInitSharedMemStatistics (bool local, const StringPiece &name, const SystemRewriteOptions &options) |
Creates and ::Initializes a shared memory statistics object. | |
NonceGenerator * | DefaultNonceGenerator () |
Creates a HashedNonceGenerator initialized with data from /dev/random. | |
bool | is_root_process () const |
virtual void | RootInit () |
virtual void | ChildInit () |
void | PostConfig (const std::vector< SystemServerContext * > &server_contexts, GoogleString *error_message, int *error_index, Statistics **global_statistics) |
void | SharedCircularBufferInit (bool is_root) |
virtual RewriteOptions::OptionSettingResult | ParseAndSetOption1 (StringPiece option, StringPiece arg, bool process_scope, GoogleString *msg, MessageHandler *handler) |
virtual RewriteOptions::OptionSettingResult | ParseAndSetOption2 (StringPiece option, StringPiece arg1, StringPiece arg2, bool process_scope, GoogleString *msg, MessageHandler *handler) |
virtual Hasher * | NewHasher () |
virtual ServerContext * | NewServerContext () |
virtual bool | enable_property_cache () const |
Hook so implementations may disable the property cache. | |
GoogleString | hostname_identifier () |
virtual void | ShutDown () |
virtual void | StopCacheActivity () |
SystemCaches * | caches () |
UrlAsyncFetcher * | GetFetcher (SystemRewriteOptions *config) |
void | set_track_original_content_length (bool x) |
bool | track_original_content_length () const |
void | list_outstanding_urls_on_error (bool x) |
virtual int | max_queue_size () |
virtual int | queued_per_host () |
virtual int | requests_per_host () |
Normally 4, or #threads if that's more. | |
void | set_static_asset_prefix (StringPiece s) |
const GoogleString & | static_asset_prefix () |
int | num_rewrite_threads () const |
void | set_num_rewrite_threads (int x) |
int | num_expensive_rewrite_threads () const |
void | set_num_expensive_rewrite_threads (int x) |
bool | use_per_vhost_statistics () const |
void | set_use_per_vhost_statistics (bool x) |
bool | install_crash_handler () const |
void | set_install_crash_handler (bool x) |
virtual bool | UseBeaconResultsInFilters () const |
virtual void | StartController (const SystemRewriteOptions &options) |
virtual void | NameProcess (const char *name) |
Set the name of this process, for debugging visibility. | |
virtual void | PrepareForkedProcess (const char *name) |
virtual void | PrepareControllerProcess () |
Public Member Functions inherited from net_instaweb::RewriteDriverFactory | |
RewriteDriverFactory (const ProcessContext &process_context, ThreadSystem *thread_system) | |
Takes ownership of thread_system. | |
void | InitializeDefaultOptions () |
void | set_html_parse_message_handler (MessageHandler *message_handler) |
void | set_message_handler (MessageHandler *message_handler) |
void | set_file_system (FileSystem *file_system) |
void | set_hasher (Hasher *hasher) |
void | set_nonce_generator (NonceGenerator *nonce_generator) |
void | set_url_namer (UrlNamer *url_namer) |
void | set_signature (SHA1Signature *signature) |
void | set_timer (Timer *timer) |
void | set_usage_data_reporter (UsageDataReporter *reporter) |
void | set_slurp_directory (const StringPiece &directory) |
void | set_slurp_read_only (bool read_only) |
void | set_slurp_print_urls (bool read_only) |
void | set_force_caching (bool u) |
void | set_base_url_async_fetcher (UrlAsyncFetcher *url_fetcher) |
bool | set_filename_prefix (StringPiece p) |
bool | slurping_enabled () const |
Determines whether Slurping is enabled. | |
MessageHandler * | html_parse_message_handler () |
MessageHandler * | message_handler () |
FileSystem * | file_system () |
NonceGenerator * | nonce_generator () |
Hasher * | hasher () |
UrlNamer * | url_namer () |
UserAgentMatcher * | user_agent_matcher () |
StaticAssetManager * | static_asset_manager () |
SHA1Signature * | signature () |
RewriteOptions * | default_options () |
virtual RewriteOptionsManager * | NewRewriteOptionsManager () |
Timer * | timer () |
NamedLockManager * | lock_manager () |
QueuedWorkerPool * | WorkerPool (WorkerPoolCategory pool) |
Scheduler * | scheduler () |
UsageDataReporter * | usage_data_reporter () |
const pagespeed::js::JsTokenizerPatterns * | js_tokenizer_patterns () const |
const std::vector< const UserAgentNormalizer * > & | user_agent_normalizers () |
virtual UrlAsyncFetcher * | ComputeUrlAsyncFetcher () |
ServerContext * | CreateServerContext () |
void | InitServerContext (ServerContext *server_context) |
virtual void | AddPlatformSpecificRewritePasses (RewriteDriver *driver) |
virtual void | AddPlatformSpecificDecodingPasses (RewriteDriver *driver) |
virtual void | ApplyPlatformSpecificConfiguration (RewriteDriver *driver) |
ThreadSystem * | thread_system () |
const StringSet & | created_directories () const |
bool | async_rewrites () |
RewriteStats * | rewrite_stats () |
virtual bool | HasWaveforms () const |
Returns true if the server supports waveforms in its status page. | |
Statistics * | statistics () |
void | SetStatistics (Statistics *stats) |
Does not take ownership of Statistics. | |
void | AddCreatedDirectory (const GoogleString &dir) |
Registers the directory as having been created by us. | |
const GoogleString & | version_string () const |
get/set the version placed into the X-[Mod-]Page(s|-S)peed header. | |
void | set_version_string (const StringPiece &version_string) |
void | defer_cleanup (Function *f) |
template<class T > | |
void | TakeOwnership (T *obj) |
virtual bool | IsDebugClient (const GoogleString &ip) const |
Base method that returns true if the given ip is a debug ip. | |
virtual ExperimentMatcher * | NewExperimentMatcher () |
Static Public Member Functions | |
static void | InitStats (Statistics *statistics) |
static void | Initialize () |
static void | Terminate () |
Static Public Member Functions inherited from net_instaweb::SystemRewriteDriverFactory | |
static void | InitApr () |
Static Public Member Functions inherited from net_instaweb::RewriteDriverFactory | |
static void | InitializeDefaultOptions (RewriteOptions *options) |
static void | InitStats (Statistics *statistics) |
static void | Initialize () |
Initializes static variables. Initialize/Terminate calls must be paired. | |
static void | Terminate () |
Protected Member Functions | |
virtual MessageHandler * | DefaultHtmlParseMessageHandler () |
Provide defaults. | |
virtual MessageHandler * | DefaultMessageHandler () |
virtual Timer * | DefaultTimer () |
virtual void | SetupCaches (ServerContext *server_context) |
virtual bool | ShouldWriteResourcesToFileSystem () |
virtual void | ParentOrChildInit () |
virtual void | SetupMessageHandlers () |
virtual void | ShutDownMessageHandlers () |
virtual void | SetCircularBuffer (SharedCircularBuffer *buffer) |
virtual ServerContext * | NewDecodingServerContext () |
Protected Member Functions inherited from net_instaweb::SystemRewriteDriverFactory | |
virtual void | InitStaticAssetManager (StaticAssetManager *static_asset_manager) |
Initializes the StaticAssetManager. | |
virtual QueuedWorkerPool * | CreateWorkerPool (WorkerPoolCategory pool, StringPiece name) |
virtual void | ShutDownFetchers () |
virtual UrlAsyncFetcher * | AllocateFetcher (SystemRewriteOptions *config) |
virtual FileSystem * | DefaultFileSystem () |
virtual NamedLockManager * | DefaultLockManager () |
virtual void | AutoDetectThreadCounts () |
bool | thread_counts_finalized () |
std::shared_ptr < CentralController > | GetCentralController (NamedLockManager *lock_manager) override |
Delegate from RewriteDriverFactory to construct CentralController. | |
Protected Member Functions inherited from net_instaweb::RewriteDriverFactory | |
bool | FetchersComputed () const |
StringPiece | filename_prefix () |
bool | TerminateServerContext (ServerContext *server_context) |
virtual SHA1Signature * | DefaultSignature () |
virtual CriticalImagesFinder * | DefaultCriticalImagesFinder (ServerContext *server_context) |
virtual CriticalSelectorFinder * | DefaultCriticalSelectorFinder (ServerContext *server_context) |
virtual UrlNamer * | DefaultUrlNamer () |
virtual UserAgentMatcher * | DefaultUserAgentMatcher () |
virtual UsageDataReporter * | DefaultUsageDataReporter () |
virtual void | AddPlatformSpecificUserAgentNormalizers (std::vector< const UserAgentNormalizer * > *out) |
virtual int | LowPriorityLoadSheddingThreshold () const |
virtual Scheduler * | CreateScheduler () |
virtual void | FetcherSetupHooks () |
Called before creating the url fetchers. | |
virtual StringPiece | LockFilePrefix () |
void | InitStubDecodingServerContext (ServerContext *context) |
void | RebuildDecodingDriverForTests (ServerContext *server_context) |
For use in tests. | |
void | reset_default_options (RewriteOptions *new_defaults) |
Additional Inherited Members | |
Public Types inherited from net_instaweb::RewriteDriverFactory | |
enum | WorkerPoolCategory { kHtmlWorkers, kRewriteWorkers, kLowPriorityRewriteWorkers, kNumWorkerPools } |
Protected Types inherited from net_instaweb::SystemRewriteDriverFactory | |
typedef std::set < SystemServerContext * > | SystemServerContextSet |
Static Protected Member Functions inherited from net_instaweb::SystemRewriteDriverFactory | |
static void | InitStats (Statistics *statistics) |
Protected Attributes inherited from net_instaweb::SystemRewriteDriverFactory | |
SystemServerContextSet | uninitialized_server_contexts_ |
Creates an Apache RewriteDriver.
|
inline |
Give access to apache_message_handler_ for the cases we need to use ApacheMessageHandler rather than MessageHandler. e.g. Use ApacheMessageHandler::Dump() This is a better choice than cast from MessageHandler.
|
static |
Initializes all the statistics objects created transitively by ApacheRewriteDriverFactory, including apache-specific and platform-independent statistics.
|
virtual |
Check whether the server is threaded. For example, Nginx uses an event loop and can keep with the default of false, while Apache with a threaded multiprocessing module (MPM) overrides this method to return true.
< Most new servers are non-threaded nowadays.
Reimplemented from net_instaweb::SystemRewriteDriverFactory.
|
virtual |
Threaded implementing servers should return the maximum number of threads that might be used for handling user requests.
Reimplemented from net_instaweb::SystemRewriteDriverFactory.
|
protectedvirtual |
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.
|
virtual |
Creates a new empty RewriteOptions object, with no default settings. Generally configurations go factory's default_options() -> ServerContext::global_options() -> RewriteDriverFactory, but this method just provides a blank set of options.
Reimplemented from net_instaweb::RewriteDriverFactory.
|
virtual |
As above, but set a name on the ApacheConfig noting that it came from a query.
Reimplemented from net_instaweb::RewriteDriverFactory.
|
inlinevirtual |
Hook for subclasses to init their stats and call SystemRewriteDriverFactory::InitStats().
Implements net_instaweb::SystemRewriteDriverFactory.
|
protectedvirtual |
This helper method contains init procedures invoked by both RootInit() and ChildInit()
Reimplemented from net_instaweb::SystemRewriteDriverFactory.
bool net_instaweb::ApacheRewriteDriverFactory::PoolDestroyed | ( | ApacheServerContext * | rm | ) |
Notification of apache tearing down a context (vhost or top-level) corresponding to given ApacheServerContext. Returns true if it was the last context.
void net_instaweb::ApacheRewriteDriverFactory::SetNeedSchedulerThread | ( | ) |
Called by any ApacheServerContext whose configuration requires use of a scheduler thread. This will actually start one, so should only be called from child processes.
|
protectedvirtual |
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.
Reimplemented from net_instaweb::SystemRewriteDriverFactory.
|
protectedvirtual |
Reimplemented from net_instaweb::SystemRewriteDriverFactory.
|
inlineprotectedvirtual |
Disable the Resource Manager's filesystem since we have a write-through http_cache.