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

Unified Diff: chrome/browser/net/url_request_context_getter.h

Issue 1702016: Changed UrlFetcher to use a MessageLoopProxy instead of directly relying on C... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months 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
« no previous file with comments | « chrome/browser/net/url_fetcher_unittest.cc ('k') | chrome/browser/net/url_request_context_getter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/url_request_context_getter.h
===================================================================
--- chrome/browser/net/url_request_context_getter.h (revision 46098)
+++ chrome/browser/net/url_request_context_getter.h (working copy)
@@ -6,31 +6,47 @@
#define CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_
#include "base/ref_counted.h"
-#include "chrome/browser/chrome_thread.h"
+#include "base/task.h"
namespace net {
class CookieStore;
}
+class MessageLoopProxy;
class URLRequestContext;
+struct URLRequestContextGetterTraits;
// Interface for retrieving an URLRequestContext.
class URLRequestContextGetter
: public base::RefCountedThreadSafe<URLRequestContextGetter,
- ChromeThread::DeleteOnIOThread> {
+ URLRequestContextGetterTraits> {
public:
virtual URLRequestContext* GetURLRequestContext() = 0;
// Defaults to GetURLRequestContext()->cookie_store(), but
// implementations can override it.
virtual net::CookieStore* GetCookieStore();
+ // Returns a MessageLoopProxy corresponding to the thread on which the
+ // request IO happens (the thread on which the returned URLRequestContext
+ // may be used).
+ virtual scoped_refptr<MessageLoopProxy> GetIOMessageLoopProxy() = 0;
protected:
- friend class ChromeThread;
friend class DeleteTask<URLRequestContextGetter>;
+ friend struct URLRequestContextGetterTraits;
virtual ~URLRequestContextGetter() {}
+ private:
+ // OnDestruct is meant to ensure deletion on the thread on which the request
+ // IO happens.
+ void OnDestruct();
};
+struct URLRequestContextGetterTraits {
+ static void Destruct(URLRequestContextGetter* context_getter) {
+ context_getter->OnDestruct();
+ }
+};
+
#endif // CHROME_BROWSER_NET_URL_REQUEST_CONTEXT_GETTER_H_
« no previous file with comments | « chrome/browser/net/url_fetcher_unittest.cc ('k') | chrome/browser/net/url_request_context_getter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698