| Index: net/cert/cert_net_fetcher.h
|
| diff --git a/net/cert/cert_net_fetcher.h b/net/cert/cert_net_fetcher.h
|
| index 56a74948117db4f6ae95432dd9a721967a2cc0f3..2a45fe3b6f7407e944ee5b295b2739a7bdf84638 100644
|
| --- a/net/cert/cert_net_fetcher.h
|
| +++ b/net/cert/cert_net_fetcher.h
|
| @@ -20,16 +20,15 @@ class GURL;
|
| namespace net {
|
|
|
| // CertNetFetcher is a synchronous interface for fetching AIA URLs and CRL
|
| -// URLs.
|
| +// URLs. It is shared between a caller thread (which starts and waits for
|
| +// fetches), and a network thread (which does the actual fetches). It can be
|
| +// shutdown from the network thread to cancel outstanding requests.
|
| //
|
| // A Request object is returned when starting a fetch. The consumer can
|
| // use this as a handle for aborting the request (by freeing it), or reading
|
| // the result of the request (WaitForResult)
|
| -//
|
| -// This interface is expected to be operated from a single thread.
|
| -//
|
| -// The CertNetFetcher must outlive all Request objects it creates.
|
| -class NET_EXPORT CertNetFetcher {
|
| +class NET_EXPORT CertNetFetcher
|
| + : public base::RefCountedThreadSafe<CertNetFetcher> {
|
| public:
|
| class Request {
|
| public:
|
| @@ -47,7 +46,12 @@ class NET_EXPORT CertNetFetcher {
|
|
|
| CertNetFetcher() {}
|
|
|
| - virtual ~CertNetFetcher() {}
|
| + // Shuts down the CertNetFetcher and cancels outstanding network requests. It
|
| + // is not guaranteed that any outstanding or subsequent
|
| + // Request::WaitForResult() calls will be completed. Shutdown() must be called
|
| + // from the network thread. It can be called more than once, but must be
|
| + // called before the CertNetFetcher is destroyed.
|
| + virtual void Shutdown() = 0;
|
|
|
| // The Fetch*() methods start a request which can be cancelled by
|
| // deleting the returned Request. Here is the meaning of the common
|
| @@ -76,7 +80,11 @@ class NET_EXPORT CertNetFetcher {
|
| int timeout_milliseconds,
|
| int max_response_bytes) = 0;
|
|
|
| + protected:
|
| + virtual ~CertNetFetcher() {}
|
| +
|
| private:
|
| + friend class base::RefCountedThreadSafe<CertNetFetcher>;
|
| DISALLOW_COPY_AND_ASSIGN(CertNetFetcher);
|
| };
|
|
|
|
|