Page Speed Optimization Libraries
1.7.30.4
|
00001 // Copyright 2010 Google Inc. 00016 00017 #ifndef NET_INSTAWEB_APACHE_APACHE_CONFIG_H_ 00018 #define NET_INSTAWEB_APACHE_APACHE_CONFIG_H_ 00019 00020 #include "net/instaweb/rewriter/public/rewrite_options.h" 00021 #include "net/instaweb/system/public/system_rewrite_options.h" 00022 #include "net/instaweb/util/public/basictypes.h" 00023 #include "net/instaweb/util/public/string_util.h" 00024 00025 namespace net_instaweb { 00026 00027 class ThreadSystem; 00028 00031 class ApacheConfig : public SystemRewriteOptions { 00032 public: 00033 static void Initialize(); 00034 static void Terminate(); 00035 00036 ApacheConfig(const StringPiece& description, ThreadSystem* thread_system); 00037 explicit ApacheConfig(ThreadSystem* thread_system); 00038 virtual ~ApacheConfig(); 00039 00040 bool fetch_from_mod_spdy() const { 00041 return fetch_from_mod_spdy_.value(); 00042 } 00043 00045 virtual ApacheConfig* Clone() const; 00046 00048 virtual ApacheConfig* NewOptions() const; 00049 00052 static const ApacheConfig* DynamicCast(const RewriteOptions* instance); 00053 static ApacheConfig* DynamicCast(RewriteOptions* instance); 00054 00055 private: 00058 static Properties* apache_properties_; 00059 00061 template<class OptionClass> 00062 static void AddApacheProperty(typename OptionClass::ValueType default_value, 00063 OptionClass ApacheConfig::*offset, 00064 const char* id, 00065 StringPiece option_name, 00066 const char* help) { 00067 AddProperty(default_value, offset, id, option_name, 00068 RewriteOptions::kServerScope, help, 00069 apache_properties_); 00070 } 00071 00072 static void AddProperties(); 00073 void Init(); 00074 00075 Option<bool> fetch_from_mod_spdy_; 00076 00077 DISALLOW_COPY_AND_ASSIGN(ApacheConfig); 00078 }; 00079 00080 } 00081 00082 #endif ///< NET_INSTAWEB_APACHE_APACHE_CONFIG_H_