18 #ifndef PAGESPEED_SIMPLE_BUFFERED_APACHE_FETCH_H_
19 #define PAGESPEED_SIMPLE_BUFFERED_APACHE_FETCH_H_
26 #include "net/instaweb/http/public/request_context.h"
33 #include "pagespeed/kernel/base/thread_annotations.h"
40 namespace net_instaweb {
59 void Wait() LOCKS_EXCLUDED(mutex_);
62 LOCKS_EXCLUDED(mutex_);
65 void HandleHeadersComplete()
override LOCKS_EXCLUDED(mutex_);
66 void HandleDone(
bool success)
override LOCKS_EXCLUDED(mutex_);
67 bool HandleFlush(
MessageHandler* handler)
override LOCKS_EXCLUDED(mutex_);
68 bool HandleWrite(
const StringPiece& sp,
MessageHandler* handler)
override
69 LOCKS_EXCLUDED(mutex_);
79 typedef std::pair<Op, GoogleString> OpInfo;
82 void WaitForOp(OpInfo* out) LOCKS_EXCLUDED(mutex_);
84 void SendOutHeaders();
86 std::unique_ptr<ApacheWriter> apache_writer_;
89 std::unique_ptr<ThreadSystem::CondvarCapableMutex> mutex_;
90 std::unique_ptr<ThreadSystem::Condvar> notify_;
91 std::queue<OpInfo> queue_;
93 bool wait_called_ GUARDED_BY(mutex_);
void Wait() LOCKS_EXCLUDED(mutex_)
Blocks waiting for the fetch to complete.
bool IsCachedResultValid(const ResponseHeaders &headers) override LOCKS_EXCLUDED(mutex_)
virtual const RequestContextPtr & request_context()
Definition: async_fetch.h:151
RequestHeaders * request_headers()
Definition: async_fetch.h:53
SimpleBufferedApacheFetch(const RequestContextPtr &request_context, RequestHeaders *request_headers, ThreadSystem *thread_system, request_rec *req, MessageHandler *handler)
Definition: thread_system.h:40
Definition: message_handler.h:39
Definition: simple_buffered_apache_fetch.h:46