Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Unified Diff: net/cert_net/cert_net_fetcher_impl.h

Issue 2595723002: Allow CertNetFetcher to be shutdown from the network thread (Closed)
Patch Set: tweak comments Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert_net/cert_net_fetcher_impl.h
diff --git a/net/cert_net/cert_net_fetcher_impl.h b/net/cert_net/cert_net_fetcher_impl.h
index d4add24c2ffd96d2dfe8541efe9d6d19d6ce831a..30b564b7c7966707a9d7cb2ccac5d865fddd3dc6 100644
--- a/net/cert_net/cert_net_fetcher_impl.h
+++ b/net/cert_net/cert_net_fetcher_impl.h
@@ -7,20 +7,34 @@
#include <memory>
+#include "base/memory/ref_counted.h"
#include "net/base/net_export.h"
+namespace base {
+class SingleThreadTaskRunner;
+} // namespace base
+
namespace net {
class CertNetFetcher;
+class URLRequestContext;
class URLRequestContextGetter;
// Creates a CertNetFetcher that issues requests through the provided
-// URLRequestContext.
-//
-// The returned CertNetFetcher is to be operated on a thread *other* than the
-// thread used for the URLRequestContext (since it gives a blocking interface
-// to URL fetching).
-NET_EXPORT std::unique_ptr<CertNetFetcher> CreateCertNetFetcher(
+// URLRequestContext (which must outlived the CertNetFetcher) on the
eroman 2017/01/03 20:42:37 typo outlived. Also as far as word-smithing, it n
estark 2017/01/05 19:08:40 Done.
+// given TaskRunner. The CertNetFetcher is to be created and shutdown on
+// the network thread corresponding to |task_runner| and |context|. Its
+// Fetch methods are to be used on a *different* thread, since it gives
+// a blocking interface to URL fetching.
+NET_EXPORT scoped_refptr<CertNetFetcher> CreateCertNetFetcher(
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner,
eroman 2017/01/03 20:42:38 I don't think we should have this variant (that ta
estark 2017/01/05 19:08:40 Done.
+ URLRequestContext* context);
+
+// Creates a CertNetFetcher that issues requests through the provider
+// |context_getter|'s URLRequestContext. This function is to be called
+// on a thread *other* than the thread used for the URLRequestContext
+// (since it gives a blocking interface to URL fetching).
+NET_EXPORT scoped_refptr<CertNetFetcher> CreateCertNetFetcherOnCallerThread(
eroman 2017/01/03 20:42:37 I don't think we want to expose this function. Th
estark 2017/01/05 19:08:40 Done; however, I'm not sure if I did this properly
URLRequestContextGetter* context_getter);
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698