21 #ifndef NET_INSTAWEB_HTTP_PUBLIC_COUNTING_URL_ASYNC_FETCHER_H_
22 #define NET_INSTAWEB_HTTP_PUBLIC_COUNTING_URL_ASYNC_FETCHER_H_
26 #include "net/instaweb/util/public/platform.h"
31 namespace net_instaweb {
42 thread_system_(Platform::CreateThreadSystem()),
43 mutex_(thread_system_->NewMutex()) {
52 virtual void Fetch(
const GoogleString& url,
53 MessageHandler* message_handler,
58 ScopedMutex lock(mutex_.get());
64 ScopedMutex lock(mutex_.get());
65 return fetch_start_count_;
67 int byte_count()
const {
68 ScopedMutex lock(mutex_.get());
71 int failure_count()
const {
72 ScopedMutex lock(mutex_.get());
73 return failure_count_;
75 GoogleString most_recent_fetched_url()
const {
76 ScopedMutex lock(mutex_.get());
77 return most_recent_fetched_url_;
83 friend class CountingFetch;
88 int fetch_start_count_;
91 GoogleString most_recent_fetched_url_;
92 scoped_ptr<ThreadSystem> thread_system_;
93 scoped_ptr<AbstractMutex> mutex_;
Definition: counting_url_async_fetcher.h:36
int fetch_count() const
number of completed fetches.
Definition: counting_url_async_fetcher.h:57
Definition: async_fetch.h:53
int fetch_start_count() const
number of started fetches
Definition: counting_url_async_fetcher.h:63
virtual void Fetch(const GoogleString &url, MessageHandler *message_handler, AsyncFetch *fetch)
UrlAsyncFetcher()
Definition: url_async_fetcher.h:81
virtual bool SupportsHttps() const
Definition: url_async_fetcher.h:57
virtual bool SupportsHttps() const
Definition: counting_url_async_fetcher.h:50
CountingUrlAsyncFetcher(UrlAsyncFetcher *fetcher)
Definition: counting_url_async_fetcher.h:40
Definition: url_async_fetcher.h:33