Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
apache_config.h
Go to the documentation of this file.
1 // Copyright 2010 Google Inc.
16 
17 #ifndef PAGESPEED_APACHE_APACHE_CONFIG_H_
18 #define PAGESPEED_APACHE_APACHE_CONFIG_H_
19 
26 
27 namespace net_instaweb {
28 
32  public:
33  static void Initialize();
34  static void Terminate();
35 
36  ApacheConfig(const StringPiece& description, ThreadSystem* thread_system);
37  explicit ApacheConfig(ThreadSystem* thread_system);
38  virtual ~ApacheConfig();
39 
41  virtual ApacheConfig* Clone() const;
42 
44  virtual ApacheConfig* NewOptions() const;
45 
49  bool GetProxyAuth(StringPiece* name, StringPiece* value,
50  StringPiece* redirect) const;
51 
52  void set_proxy_auth(StringPiece p) {
53  set_option(p.as_string(), &proxy_auth_);
54  }
55  const GoogleString& proxy_auth() const { return proxy_auth_.value(); }
56 
57  bool force_buffering() const { return force_buffering_.value(); }
58  void set_force_buffering(bool x) { set_option(x, &force_buffering_); }
59 
60  bool proxy_all_requests_mode() const {
61  return proxy_all_requests_mode_.value();
62  }
63 
64  bool measurement_proxy_mode() const {
65  return !measurement_proxy_root().empty() &&
66  !measurement_proxy_password().empty();
67  }
68 
69  const GoogleString& measurement_proxy_root() const {
70  return measurement_proxy_root_.value();
71  }
72 
73  const GoogleString& measurement_proxy_password() const {
74  return measurement_proxy_password_.value();
75  }
76 
79  static const ApacheConfig* DynamicCast(const RewriteOptions* instance);
80  static ApacheConfig* DynamicCast(RewriteOptions* instance);
81 
82  void Merge(const RewriteOptions& src) override;
83 
84  OptionSettingResult ParseAndSetOptionFromName2(
85  StringPiece name, StringPiece arg1, StringPiece arg2,
86  GoogleString* msg, MessageHandler* handler) override;
87 
89 
90  private:
93  static Properties* apache_properties_;
94 
96  template<class OptionClass>
97  static void AddApacheProperty(typename OptionClass::ValueType default_value,
98  OptionClass ApacheConfig::*offset,
99  const char* id,
100  StringPiece option_name,
101  const char* help,
102  bool safe_to_print) {
103  AddProperty(default_value, offset, id, option_name,
104  RewriteOptions::kServerScope, help, safe_to_print,
105  apache_properties_);
106  }
107 
108  static void AddProperties();
109  void Init();
110 
111  Option<bool> fetch_from_mod_spdy_;
112  Option<bool> force_buffering_;
113  Option<bool> proxy_all_requests_mode_;
114  Option<GoogleString> proxy_auth_;
115  Option<GoogleString> measurement_proxy_root_;
116  Option<GoogleString> measurement_proxy_password_;
117 
118 
119 };
120 
121 }
122 
123 #endif
static void AddProperty(typename OptionClass::ValueType default_value, OptionClass RewriteOptionsSubclass::*offset, const char *id, StringPiece option_name, OptionScope scope, const char *help_text, bool safe_to_print, Properties *properties)
Adds a new Property to 'properties' (the last argument).
Definition: rewrite_options.h:3167
virtual ApacheConfig * Clone() const
Make an identical copy of these options and return it.
bool GetProxyAuth(StringPiece *name, StringPiece *value, StringPiece *redirect) const
Definition: apache_config.h:31
virtual ApacheConfig * NewOptions() const
Make a new empty set of options.
StringPiece description() const
Definition: system_rewrite_options.h:379
Definition: system_rewrite_options.h:40
void set_option(const T &new_value, OptionTemplateBase< T > *option)
Definition: rewrite_options.h:3219
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
static const ApacheConfig * DynamicCast(const RewriteOptions *instance)
Definition: rewrite_options.h:633
void Merge(const RewriteOptions &src) override
Definition: thread_system.h:40
OptionSettingResult
Used for return value of SetOptionFromName.
Definition: rewrite_options.h:813
Definition: message_handler.h:39
GoogleString SubclassSignatureLockHeld() override
Definition: rewrite_options.h:84