Page Speed Optimization Libraries  1.13.35.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
url_async_fetcher.h
Go to the documentation of this file.
1 /*
2  * Copyright 2010 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_HTTP_PUBLIC_URL_ASYNC_FETCHER_H_
20 #define NET_INSTAWEB_HTTP_PUBLIC_URL_ASYNC_FETCHER_H_
21 
24 
25 namespace net_instaweb {
26 
27 class AsyncFetch;
28 class MessageHandler;
29 
34  public:
35  static const int64 kUnspecifiedTimeout;
36 
37  virtual ~UrlAsyncFetcher();
38 
48  virtual void Fetch(const GoogleString& url,
49  MessageHandler* message_handler,
50  AsyncFetch* fetch) = 0;
51 
54  virtual bool SupportsHttps() const { return true; }
55 
58  virtual int64 timeout_ms() { return kUnspecifiedTimeout; }
59 
64  virtual void ShutDown();
65 
68  void set_fetch_with_gzip(bool x) { fetch_with_gzip_ = x; }
69  bool fetch_with_gzip() const { return fetch_with_gzip_; }
70 
73  AsyncFetch* EnableInflation(AsyncFetch* fetch) const;
74 
75  protected:
78  UrlAsyncFetcher() : fetch_with_gzip_(false) {}
79 
80  private:
81  bool fetch_with_gzip_;
82 
83 
84 };
85 
86 }
87 
88 #endif
virtual int64 timeout_ms()
Definition: url_async_fetcher.h:58
void set_fetch_with_gzip(bool x)
Definition: url_async_fetcher.h:68
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: async_fetch.h:53
virtual void Fetch(const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)=0
Definition: message_handler.h:39
UrlAsyncFetcher()
Definition: url_async_fetcher.h:78
AsyncFetch * EnableInflation(AsyncFetch *fetch) const
virtual bool SupportsHttps() const
Definition: url_async_fetcher.h:54
Definition: url_async_fetcher.h:33