summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_manager.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/download/download_manager.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/download/download_manager.h')
-rw-r--r--chrome/browser/download/download_manager.h16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index b2d6b3c..34a2e42 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -349,11 +349,7 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
void UpdateDownload(int32 download_id, int64 size);
void DownloadFinished(int32 download_id, int64 size);
- // Helper method for cancelling the network request associated with a
- // download.
- static void CancelDownloadRequest(int render_process_id, int request_id);
-
- // Called from a view when a user clicks a UI button or link.
+ // Called from a view when a user clicks a UI button or link.
void DownloadCancelled(int32 download_id);
void PauseDownload(int32 download_id, bool pause);
void RemoveDownload(int64 download_handle);
@@ -461,6 +457,11 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
static bool IsExtensionInstall(const DownloadItem* item);
static bool IsExtensionInstall(const DownloadCreateInfo* info);
+ // Runs the network cancel. Must be called on the IO thread.
+ static void OnCancelDownloadRequest(ResourceDispatcherHost* rdh,
+ int render_process_id,
+ int request_id);
+
private:
// Opens a download via the Windows shell.
void OpenDownloadInShell(const DownloadItem* download,
@@ -510,11 +511,6 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
int render_process_id,
int request_id);
- // Runs the network cancel on the IO thread.
- static void OnCancelDownloadRequest(ResourceDispatcherHost* rdh,
- int render_process_id,
- int request_id);
-
// Runs the pause on the IO thread.
static void OnPauseDownloadRequest(ResourceDispatcherHost* rdh,
int render_process_id,