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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.h

Issue 2887933002: Remove usage of SequencedWorkerPool::GetNamedSequenceToken from ChromeDownloadManagerDelegate. (Closed)
Patch Set: Created 3 years, 7 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
Index: chrome/browser/download/chrome_download_manager_delegate.h
diff --git a/chrome/browser/download/chrome_download_manager_delegate.h b/chrome/browser/download/chrome_download_manager_delegate.h
index a03a227c757472cb4748b707f712c5c0c57ea1bc..5d9fd8a83220ade0db22816b6bc158445d7ebd94 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.h
+++ b/chrome/browser/download/chrome_download_manager_delegate.h
@@ -16,6 +16,7 @@
#include "base/gtest_prod_util.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
+#include "base/sequenced_task_runner.h"
#include "chrome/browser/download/download_path_reservation_tracker.h"
#include "chrome/browser/download/download_target_determiner_delegate.h"
#include "chrome/browser/download/download_target_info.h"
@@ -85,7 +86,7 @@ class ChromeDownloadManagerDelegate
void ShowDownloadInShell(content::DownloadItem* download) override;
void CheckForFileExistence(
content::DownloadItem* download,
- const content::CheckForFileExistenceCallback& callback) override;
+ content::CheckForFileExistenceCallback callback) override;
std::string ApplicationClientIdForFileScanning() const override;
// Opens a download using the platform handler. DownloadItem::OpenDownload,
@@ -168,6 +169,12 @@ class ChromeDownloadManagerDelegate
IdCallbackVector id_callbacks_;
std::unique_ptr<DownloadPrefs> download_prefs_;
+ // SequencedTaskRunner to check for file existence. A sequence is used so that
+ // a large download history doesn't cause a large number of concurrent disk
+ // operations.
+ const scoped_refptr<base::SequencedTaskRunner>
+ check_for_file_existence_task_runner_;
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
// Maps from pending extension installations to DownloadItem IDs.
typedef base::hash_map<extensions::CrxInstaller*,
« no previous file with comments | « chrome/browser/chromeos/drive/download_handler.cc ('k') | chrome/browser/download/chrome_download_manager_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698