Page Speed Optimization Libraries
1.7.30.2
|
00001 // Copyright 2013 Google Inc. 00016 00017 #ifndef NET_INSTAWEB_APACHE_APACHE_WRITER_H_ 00018 #define NET_INSTAWEB_APACHE_APACHE_WRITER_H_ 00019 00020 #include "net/instaweb/util/public/basictypes.h" 00021 #include "net/instaweb/util/public/string_util.h" 00022 #include "net/instaweb/util/public/writer.h" 00023 #include "httpd.h" 00024 00025 struct request_rec; 00026 00027 namespace net_instaweb { 00028 00029 class MessageHandler; 00030 class ResponseHeaders; 00031 00033 class ApacheWriter : public Writer { 00034 public: 00035 explicit ApacheWriter(request_rec* r); 00036 virtual ~ApacheWriter(); 00037 00038 virtual bool Write(const StringPiece& str, MessageHandler* handler); 00039 virtual bool Flush(MessageHandler* handler); 00040 00049 void OutputHeaders(ResponseHeaders* response_headers); 00050 void set_content_length(int64 x) { content_length_ = x; } 00051 00054 void set_disable_downstream_header_filters(bool x) { 00055 disable_downstream_header_filters_ = x; 00056 } 00057 00060 void set_strip_cookies(bool x) { 00061 strip_cookies_ = x; 00062 } 00063 00064 private: 00065 request_rec* request_; 00066 bool headers_out_; 00067 bool disable_downstream_header_filters_; 00068 bool strip_cookies_; 00069 int64 content_length_; 00070 00071 DISALLOW_COPY_AND_ASSIGN(ApacheWriter); 00072 }; 00073 00074 } 00075 00076 #endif ///< NET_INSTAWEB_APACHE_APACHE_WRITER_H_