Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
http_value_writer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2012 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http:///www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
17 
18 #ifndef NET_INSTAWEB_HTTP_PUBLIC_HTTP_VALUE_WRITER_H_
19 #define NET_INSTAWEB_HTTP_PUBLIC_HTTP_VALUE_WRITER_H_
20 
23 
24 namespace net_instaweb {
25 
26 class HTTPCache;
27 class HTTPValue;
28 class MessageHandler;
29 class ResponseHeaders;
30 
34  public:
35  HTTPValueWriter(HTTPValue* value, HTTPCache* cache)
36  : value_(value),
37  cache_(cache),
38  has_buffered_(true) {}
39 
40  void SetHeaders(ResponseHeaders* headers);
41 
42  bool Write(const StringPiece& str, MessageHandler* handler);
43 
44  bool has_buffered() const { return has_buffered_; }
45 
51 
54  bool CanCacheContent(const StringPiece& str) const;
55 
56  private:
57  HTTPValue* value_;
58  HTTPCache* cache_;
59  bool has_buffered_;
60 
61 };
62 
63 }
64 #endif
Definition: http_value.h:38
bool CheckCanCacheElseClear(ResponseHeaders *headers)
Read/write API for HTTP response headers.
Definition: response_headers.h:37
bool CanCacheContent(const StringPiece &str) const
Definition: message_handler.h:39
Definition: http_value_writer.h:33
Definition: http_cache.h:67