summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/url_fetcher.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 03:59:31 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-27 03:59:31 +0000
commitd85cf074f2186dbe1cf8a9db5d89a2b817ffb0e1 (patch)
treee03156e3142955f7cf637fe404a1ce2c6f7aaaf4 /chrome/browser/net/url_fetcher.h
parent76a188be4e3ddc42c42beabfeeeb618b2adae11e (diff)
downloadchromium_src-d85cf074f2186dbe1cf8a9db5d89a2b817ffb0e1.zip
chromium_src-d85cf074f2186dbe1cf8a9db5d89a2b817ffb0e1.tar.gz
chromium_src-d85cf074f2186dbe1cf8a9db5d89a2b817ffb0e1.tar.bz2
Simplify threading in browser thread by making only ChromeThread deal with different thread lifetimes.The rest of the code doesn't get MessageLoop pointers since they're not thread-safe and instead just call PostTask on ChromeThread. If the target thread is not alive, then the task is simply deleted.In a followup change, I'll remove any remaining MessageLoop* caching. With this change, there's little to be gained by caching since no locks are involved if the target MessageLoop is guaranteed to outlive the current thread (inferred automatically by the order of the chrome_threads_ array).BUG=25354
Review URL: http://codereview.chromium.org/306032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30163 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/url_fetcher.h')
-rw-r--r--chrome/browser/net/url_fetcher.h19
1 files changed, 0 insertions, 19 deletions
diff --git a/chrome/browser/net/url_fetcher.h b/chrome/browser/net/url_fetcher.h
index d62536c..f81fd69 100644
--- a/chrome/browser/net/url_fetcher.h
+++ b/chrome/browser/net/url_fetcher.h
@@ -48,10 +48,6 @@ class HttpResponseHeaders;
// You may create the URLFetcher instance on any thread; OnURLFetchComplete()
// will be called back on the same thread you use to create the instance.
//
-// NOTE: Take extra care when using URLFetcher in services that live on the
-// BrowserProcess; all URLFetcher instances need to be destroyed before
-// the IO thread goes away, since the URLFetcher destructor requests an
-// InvokeLater operation on that thread.
//
// NOTE: By default URLFetcher requests are NOT intercepted, except when
// interception is explicitly enabled in tests.
@@ -116,13 +112,6 @@ class URLFetcher {
static URLFetcher* Create(int id, const GURL& url, RequestType request_type,
Delegate* d);
- // This should only be used by unittests, where g_browser_process->io_thread()
- // does not exist and we must specify an alternate loop. Unfortunately, we
- // can't put it under #ifdef UNIT_TEST since some callers (which themselves
- // should only be reached in unit tests) use this. See
- // chrome/browser/feeds/feed_manager.cc.
- void set_io_loop(MessageLoop* io_loop);
-
// Sets data only needed by POSTs. All callers making POST requests should
// call this before the request is started. |upload_content_type| is the MIME
// type of the content, while |upload_content| is the data to be sent (the
@@ -161,14 +150,6 @@ class URLFetcher {
Delegate* delegate() const;
private:
- // This class is the real guts of URLFetcher.
- //
- // When created, delegate_loop_ is set to the message loop of the current
- // thread, while io_loop_ is set to the message loop of the IO thread. These
- // are used to ensure that all handling of URLRequests happens on the IO
- // thread (since that class is not currently threadsafe and relies on
- // underlying Microsoft APIs that we don't know to be threadsafe), while
- // keeping the delegate callback on the delegate's thread.
class Core;
scoped_refptr<Core> core_;