19 #ifndef NET_INSTAWEB_HTTP_PUBLIC_CACHE_URL_ASYNC_FETCHER_H_
20 #define NET_INSTAWEB_HTTP_PUBLIC_CACHE_URL_ASYNC_FETCHER_H_
22 #include "base/logging.h"
27 namespace net_instaweb {
34 class NamedLockManager;
95 HTTPCache* http_cache()
const {
return http_cache_; }
98 void set_backend_first_byte_latency_histogram(Histogram* x) {
99 backend_first_byte_latency_ = x;
102 Histogram* backend_first_byte_latency_histogram()
const {
103 return backend_first_byte_latency_;
106 void set_fallback_responses_served(Variable* x) {
107 fallback_responses_served_ = x;
110 Variable* fallback_responses_served()
const {
111 return fallback_responses_served_;
114 void set_fallback_responses_served_while_revalidate(Variable* x) {
115 fallback_responses_served_while_revalidate_ = x;
118 Variable* fallback_responses_served_while_revalidate()
const {
119 return fallback_responses_served_while_revalidate_;
122 void set_num_conditional_refreshes(Variable* x) {
123 num_conditional_refreshes_ = x;
126 Variable* num_conditional_refreshes()
const {
127 return num_conditional_refreshes_;
130 void set_num_proactively_freshen_user_facing_request(Variable* x) {
131 num_proactively_freshen_user_facing_request_ = x;
134 Variable* num_proactively_freshen_user_facing_request()
const {
135 return num_proactively_freshen_user_facing_request_;
138 void set_respect_vary(
bool x) { respect_vary_ = x; }
139 bool respect_vary()
const {
return respect_vary_; }
141 void set_ignore_recent_fetch_failed(
bool x) {
142 ignore_recent_fetch_failed_ = x;
144 bool ignore_recent_fetch_failed()
const {
145 return ignore_recent_fetch_failed_;
148 void set_serve_stale_if_fetch_error(
bool x) {
149 serve_stale_if_fetch_error_ = x;
152 bool serve_stale_if_fetch_error()
const {
153 return serve_stale_if_fetch_error_;
156 void set_serve_stale_while_revalidate_threshold_sec(int64 x) {
157 serve_stale_while_revalidate_threshold_sec_ = x;
160 int64 serve_stale_while_revalidate_threshold_sec()
const {
161 return serve_stale_while_revalidate_threshold_sec_;
164 void set_default_cache_html(
bool x) { default_cache_html_ = x; }
165 bool default_cache_html()
const {
return default_cache_html_; }
167 void set_proactively_freshen_user_facing_request(
bool x) {
168 proactively_freshen_user_facing_request_ = x;
170 bool proactively_freshen_user_facing_request()
const {
171 return proactively_freshen_user_facing_request_;
174 void set_own_fetcher(
bool x) { own_fetcher_ = x; }
189 CHECK(fetcher_ == NULL);
190 response_sequence_ = x;
195 const Hasher* lock_hasher_;
200 AsyncOpHooks* async_op_hooks_;
203 Variable* fallback_responses_served_;
204 Variable* fallback_responses_served_while_revalidate_;
205 Variable* num_conditional_refreshes_;
206 Variable* num_proactively_freshen_user_facing_request_;
209 bool ignore_recent_fetch_failed_;
210 bool serve_stale_if_fetch_error_;
211 bool default_cache_html_;
212 bool proactively_freshen_user_facing_request_;
214 int64 serve_stale_while_revalidate_threshold_sec_;
Definition: statistics.h:43
virtual void FinishAsyncOp()=0
Called when async operation is ended.
Definition: named_lock_manager.h:82
Definition: sequence.h:33
virtual void StartAsyncOp()=0
Called when CacheUrlAsyncFetcher is about to start async operation.
virtual bool SupportsHttps() const
Definition: cache_url_async_fetcher.h:85
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
CacheUrlAsyncFetcher(const Hasher *lock_hasher, NamedLockManager *lock_manager, HTTPCache *cache, const GoogleString &fragment, AsyncOpHooks *async_op_hooks, UrlAsyncFetcher *fetcher)
None of these are owned by CacheUrlAsyncFetcher.
Definition: async_fetch.h:53
Definition: cache_url_async_fetcher.h:61
Definition: cache_url_async_fetcher.h:65
Definition: statistics.h:138
Definition: message_handler.h:39
void set_response_sequence(Sequence *x)
Definition: cache_url_async_fetcher.h:188
virtual void Fetch(const GoogleString &url, MessageHandler *message_handler, AsyncFetch *base_fetch)
virtual bool SupportsHttps() const
Definition: url_async_fetcher.h:54
Definition: url_async_fetcher.h:33
static const int kNotInCacheStatus
Definition: cache_url_async_fetcher.h:93
Definition: http_cache.h:67