Page Speed Optimization Libraries  1.9.32.2
 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 
22 #include "pagespeed/kernel/base/basictypes.h"
23 #include "pagespeed/kernel/base/string.h"
24 
25 namespace net_instaweb {
26 
27 class AsyncFetch;
28 class MessageHandler;
29 
34  public:
35  static const int64 kUnspecifiedTimeout;
36 
38  static const char kStatisticsGroup[];
39 
40  virtual ~UrlAsyncFetcher();
41 
51  virtual void Fetch(const GoogleString& url,
52  MessageHandler* message_handler,
53  AsyncFetch* fetch) = 0;
54 
57  virtual bool SupportsHttps() const { return true; }
58 
61  virtual int64 timeout_ms() { return kUnspecifiedTimeout; }
62 
67  virtual void ShutDown();
68 
71  void set_fetch_with_gzip(bool x) { fetch_with_gzip_ = x; }
72  bool fetch_with_gzip() const { return fetch_with_gzip_; }
73 
76  AsyncFetch* EnableInflation(AsyncFetch* fetch) const;
77 
78  protected:
81  UrlAsyncFetcher() : fetch_with_gzip_(false) {}
82 
83  private:
84  bool fetch_with_gzip_;
85 
86  DISALLOW_COPY_AND_ASSIGN(UrlAsyncFetcher);
87 };
88 
89 }
90 
91 #endif
virtual int64 timeout_ms()
Definition: url_async_fetcher.h:61
void set_fetch_with_gzip(bool x)
Definition: url_async_fetcher.h:71
Definition: async_fetch.h:53
static const char kStatisticsGroup[]
Default statistics group name.
Definition: url_async_fetcher.h:38
virtual void Fetch(const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)=0
UrlAsyncFetcher()
Definition: url_async_fetcher.h:81
AsyncFetch * EnableInflation(AsyncFetch *fetch) const
virtual bool SupportsHttps() const
Definition: url_async_fetcher.h:57
Definition: url_async_fetcher.h:33