Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
notifying_fetch.h
Go to the documentation of this file.
1 /*
2  * Copyright 2011 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  */
16 
18 
19 #ifndef NET_INSTAWEB_REWRITER_PUBLIC_NOTIFYING_FETCH_H_
20 #define NET_INSTAWEB_REWRITER_PUBLIC_NOTIFYING_FETCH_H_
21 
29 
30 namespace net_instaweb {
31 
32 class MessageHandler;
33 class RewriteOptions;
34 
37 class NotifyingFetch : public AsyncFetch {
38  public:
40  RewriteOptions* options,
41  const GoogleString& url,
44  virtual ~NotifyingFetch();
45 
46  StringPiece content() { return content_; }
47  bool done() { return done_; }
48  bool success() { return success_; }
49 
50  protected:
51  void HandleHeadersComplete() override {}
52  bool HandleWrite(const StringPiece& content, MessageHandler* handler)
53  override;
54  bool HandleFlush(MessageHandler* handler) override;
55  void HandleDone(bool success) override;
56  bool IsCachedResultValid(const ResponseHeaders& headers) override;
57 
58  private:
59  GoogleString content_;
60  bool done_;
61  bool success_;
62  const RewriteOptions* options_;
63  GoogleString url_;
65 
66 
67 };
68 
69 }
70 
71 #endif
Definition: notifying_fetch.h:37
virtual const RequestContextPtr & request_context()
Definition: async_fetch.h:151
ResponseHeaders * response_headers()
See doc for request_headers and set_request_headers.
Read/write API for HTTP response headers.
Definition: response_headers.h:37
A way for one thread to wait for another.
Definition: worker_test_base.h:71
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: async_fetch.h:53
Definition: message_handler.h:39
Definition: rewrite_options.h:84
bool IsCachedResultValid(const ResponseHeaders &headers) override