17 #ifndef NET_INSTAWEB_APACHE_APACHE_SERVER_CONTEXT_H_
18 #define NET_INSTAWEB_APACHE_APACHE_SERVER_CONTEXT_H_
21 #include "net/instaweb/http/public/request_context.h"
24 #include "pagespeed/kernel/base/basictypes.h"
25 #include "pagespeed/kernel/base/message_handler.h"
26 #include "pagespeed/kernel/base/scoped_ptr.h"
27 #include "pagespeed/kernel/base/string.h"
28 #include "pagespeed/kernel/base/string_util.h"
33 namespace net_instaweb {
35 class ApacheRewriteDriverFactory;
36 class ApacheRequestContext;
37 class ProxyFetchFactory;
38 class RewriteDriverPool;
53 const StringPiece& version);
57 static void InitStats(Statistics* statistics);
61 bool InitPath(
const GoogleString& path);
76 return spdy_config_overlay_.get() != NULL;
79 bool has_non_spdy_config_overlay()
const {
80 return non_spdy_config_overlay_.get() != NULL;
85 spdy_config_overlay_.reset(x);
89 non_spdy_config_overlay_.reset(x);
96 return spdy_specific_config_.get();
113 const server_rec* server()
const {
return server_rec_; }
119 RewriteDriver* driver);
121 ProxyFetchFactory* proxy_fetch_factory() {
122 return proxy_fetch_factory_.get();
125 void InitProxyFetchFactory();
147 ReportNotFoundHelper(kWarning, message, request,
148 rewrite_stats()->resource_404_count());
155 ReportNotFoundHelper(kWarning, message, request, statistics_404_count());
162 ReportNotFoundHelper(kInfo, message, request,
163 rewrite_stats()->slurp_404_count());
166 virtual GoogleString
FormatOption(StringPiece option_name, StringPiece args);
169 virtual bool UpdateCacheFlushTimestampMs(int64 timestamp_ms);
171 void ReportNotFoundHelper(MessageType message_type,
173 request_rec* request,
174 Variable* error_count);
177 server_rec* server_rec_;
178 GoogleString version_;
182 scoped_ptr<ApacheConfig> spdy_config_overlay_;
183 scoped_ptr<ApacheConfig> non_spdy_config_overlay_;
186 scoped_ptr<ApacheConfig> spdy_specific_config_;
192 scoped_ptr<ProxyFetchFactory> proxy_fetch_factory_;
bool has_spdy_config_overlay() const
Definition: apache_server_context.h:75
ApacheRequestContext * NewApacheRequestContext(request_rec *request)
Definition: apache_config.h:31
RewriteDriverPool * spdy_driver_pool()
Definition: apache_server_context.h:102
void set_spdy_config_overlay(ApacheConfig *x)
These two take ownership of their parameters.
Definition: apache_server_context.h:84
virtual GoogleString FormatOption(StringPiece option_name, StringPiece args)
virtual const ApacheConfig * SpdyGlobalConfig() const
Definition: apache_server_context.h:95
virtual void MaybeApplySpdySessionFetcher(const RequestContextPtr &request, RewriteDriver *driver)
Hook for implementations to support fetching directly from the spdy module.
Definition: rewrite_driver_pool.h:34
Definition: apache_server_context.h:49
void ReportSlurpNotFound(StringPiece message, request_rec *request)
Definition: apache_server_context.h:161
static void InitStats(Statistics *statistics)
This must be called for every statistics object in use before using this.
A server context with features specific to a PSOL port on a unix system.
Definition: system_server_context.h:54
void ReportStatisticsNotFound(StringPiece message, request_rec *request)
Definition: apache_server_context.h:154
virtual RewriteDriverPool * SelectDriverPool(bool using_spdy)
Chooses a driver pool based on the request protocol.
ApacheConfig * SpdyConfigOverlay()
Creates an Apache RewriteDriver.
Definition: apache_rewrite_driver_factory.h:47
Definition: apache_request_context.h:39
void ReportResourceNotFound(StringPiece message, request_rec *request)
Definition: apache_server_context.h:146
virtual void CollapseConfigOverlaysAndComputeSignatures()
virtual bool ProxiesHtml() const
Definition: apache_server_context.h:130