Page Speed Optimization Libraries
1.2.24.1
|
00001 // Copyright 2010 Google Inc. 00014 00016 00017 #ifndef NET_INSTAWEB_HTTP_PUBLIC_SYNC_FETCHER_ADAPTER_H_ 00018 #define NET_INSTAWEB_HTTP_PUBLIC_SYNC_FETCHER_ADAPTER_H_ 00019 00020 #include "net/instaweb/http/public/url_fetcher.h" 00021 #include "net/instaweb/util/public/basictypes.h" 00022 #include "net/instaweb/util/public/string.h" 00023 00024 namespace net_instaweb { 00025 00026 class MessageHandler; 00027 class RequestHeaders; 00028 class ResponseHeaders; 00029 class ThreadSystem; 00030 class Timer; 00031 class UrlPollableAsyncFetcher; 00032 class Writer; 00033 00034 class SyncFetcherAdapter : public UrlFetcher { 00035 public: 00038 SyncFetcherAdapter(Timer* timer, 00039 int64 fetcher_timeout_ms, 00040 UrlPollableAsyncFetcher* async_fetcher, 00041 ThreadSystem* thread_system); 00042 virtual ~SyncFetcherAdapter(); 00043 virtual bool StreamingFetchUrl(const GoogleString& url, 00044 const RequestHeaders& request_headers, 00045 ResponseHeaders* response_headers, 00046 Writer* fetched_content_writer, 00047 MessageHandler* message_handler); 00048 00049 private: 00050 Timer* timer_; 00051 int64 fetcher_timeout_ms_; 00052 UrlPollableAsyncFetcher* async_fetcher_; 00053 ThreadSystem* thread_system_; 00054 00055 DISALLOW_COPY_AND_ASSIGN(SyncFetcherAdapter); 00056 }; 00057 00058 } 00059 00060 #endif ///< NET_INSTAWEB_HTTP_PUBLIC_SYNC_FETCHER_ADAPTER_H_