Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
apache_server_context.h
Go to the documentation of this file.
1 // Copyright 2011 Google Inc.
16 
17 #ifndef PAGESPEED_APACHE_APACHE_SERVER_CONTEXT_H_
18 #define PAGESPEED_APACHE_APACHE_SERVER_CONTEXT_H_
19 
20 #include <memory>
21 
22 #include "net/instaweb/http/public/request_context.h"
31 
32 struct request_rec;
33 struct server_rec;
34 
35 namespace net_instaweb {
36 
37 class ApacheRewriteDriverFactory;
38 class ApacheRequestContext;
39 class MeasurementProxyUrlNamer;
40 class ProxyFetchFactory;
41 class RewriteDriverPool;
42 class RewriteDriver;
43 class Statistics;
44 class Variable;
45 
53  public:
55  static const char kProxyInterfaceStatsPrefix[];
56 
58  server_rec* server,
59  const StringPiece& version);
60  virtual ~ApacheServerContext();
61 
63  static void InitStats(Statistics* statistics);
64 
65  ApacheRewriteDriverFactory* apache_factory() { return apache_factory_; }
66  ApacheConfig* global_config();
67  const ApacheConfig* global_config() const;
68  bool InitPath(const GoogleString& path);
69 
78  ApacheConfig* NonSpdyConfigOverlay();
79 
82  bool has_spdy_config_overlay() const {
83  return spdy_config_overlay_.get() != NULL;
84  }
85 
86  bool has_non_spdy_config_overlay() const {
87  return non_spdy_config_overlay_.get() != NULL;
88  }
89 
92  spdy_config_overlay_.reset(x);
93  }
94 
95  void set_non_spdy_config_overlay(ApacheConfig* x) {
96  non_spdy_config_overlay_.reset(x);
97  }
98 
103 
106  bool PoolDestroyed();
107 
108  const server_rec* server() const { return server_rec_; }
109 
110  ProxyFetchFactory* proxy_fetch_factory() {
111  return proxy_fetch_factory_.get();
112  }
113 
114  void InitProxyFetchFactory();
115 
120  virtual bool ProxiesHtml() const {
121  return global_config()->proxy_all_requests_mode();
122  }
123 
124  ApacheRequestContext* NewApacheRequestContext(request_rec* request);
125 
129  void ReportResourceNotFound(StringPiece message, request_rec* request) {
130  ReportNotFoundHelper(kWarning, message, request,
131  rewrite_stats()->resource_404_count());
132  }
133 
137  void ReportStatisticsNotFound(StringPiece message, request_rec* request) {
138  ReportNotFoundHelper(kWarning, message, request, statistics_404_count());
139  }
140 
144  void ReportSlurpNotFound(StringPiece message, request_rec* request) {
145  ReportNotFoundHelper(kInfo, message, request,
146  rewrite_stats()->slurp_404_count());
147  }
148 
149  virtual GoogleString FormatOption(StringPiece option_name, StringPiece args);
150 
151  private:
152  void ChildInit(SystemRewriteDriverFactory* factory) override;
153 
154  void ReportNotFoundHelper(MessageType message_type,
155  StringPiece url,
156  request_rec* request,
157  Variable* error_count);
158 
159  ApacheRewriteDriverFactory* apache_factory_;
160  server_rec* server_rec_;
161  GoogleString version_;
162 
165  scoped_ptr<ApacheConfig> spdy_config_overlay_;
166  scoped_ptr<ApacheConfig> non_spdy_config_overlay_;
167 
169  std::unique_ptr<MeasurementProxyUrlNamer> measurement_url_namer_;
170 
171  scoped_ptr<ProxyFetchFactory> proxy_fetch_factory_;
172 
173 
174 };
175 
176 }
177 
178 #endif
bool has_spdy_config_overlay() const
Definition: apache_server_context.h:82
Definition: statistics.h:43
Definition: apache_config.h:31
Base class for implementations of monitoring statistics.
Definition: statistics.h:342
A server context with features specific to a psol port on a unix system.
Definition: system_rewrite_driver_factory.h:57
void set_spdy_config_overlay(ApacheConfig *x)
These two take ownership of their parameters.
Definition: apache_server_context.h:91
virtual GoogleString FormatOption(StringPiece option_name, StringPiece args)
Definition: scoped_ptr.h:30
Definition: apache_server_context.h:52
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
static const char kProxyInterfaceStatsPrefix[]
Prefix for ProxyInterface stats (active in proxy_all_requests_mode() only).
Definition: apache_server_context.h:55
void ReportSlurpNotFound(StringPiece message, request_rec *request)
Definition: apache_server_context.h:144
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:53
void ReportStatisticsNotFound(StringPiece message, request_rec *request)
Definition: apache_server_context.h:137
Creates an Apache RewriteDriver.
Definition: apache_rewrite_driver_factory.h:47
Definition: apache_request_context.h:37
void ReportResourceNotFound(StringPiece message, request_rec *request)
Definition: apache_server_context.h:129
virtual void CollapseConfigOverlaysAndComputeSignatures()
virtual bool ProxiesHtml() const
Definition: apache_server_context.h:120