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

Unified Diff: content/browser/download/download_manager_impl.h

Issue 1251243003: Support restricting browsing data removal for downloads by origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Remove unneeded DCHECK; Initialize and clear download URLs along test fixture life cycle. Created 5 years, 4 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 | « content/browser/browser_context.cc ('k') | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_manager_impl.h
diff --git a/content/browser/download/download_manager_impl.h b/content/browser/download/download_manager_impl.h
index 9c9d12deec392ed29fd7bfc6de1bf0d674214022..372fd58b6169c8d383653017eedd0426116b0bf6 100644
--- a/content/browser/download/download_manager_impl.h
+++ b/content/browser/download/download_manager_impl.h
@@ -9,6 +9,7 @@
#include <set>
#include <string>
+#include "base/callback_forward.h"
#include "base/containers/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -66,6 +67,10 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager,
scoped_ptr<DownloadCreateInfo> info,
scoped_ptr<ByteStreamReader> stream,
const DownloadUrlParameters::OnStartedCallback& on_started) override;
+
+ int RemoveDownloadsByOriginAndTime(const url::Origin& origin,
+ base::Time remove_begin,
+ base::Time remove_end) override;
int RemoveDownloadsBetween(base::Time remove_begin,
base::Time remove_end) override;
int RemoveDownloads(base::Time remove_begin) override;
@@ -108,6 +113,7 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager,
typedef std::set<DownloadItem*> DownloadSet;
typedef base::hash_map<uint32, DownloadItemImpl*> DownloadMap;
typedef std::vector<DownloadItemImpl*> DownloadItemImplVector;
+ typedef base::Callback<bool(const DownloadItemImpl*)> DownloadRemover;
// For testing.
friend class DownloadManagerTest;
@@ -142,6 +148,9 @@ class CONTENT_EXPORT DownloadManagerImpl : public DownloadManager,
// observer.
void OnFileExistenceChecked(uint32 download_id, bool result);
+ // Remove all downloads for which |remover| returns true.
+ int RemoveDownloads(const DownloadRemover& remover);
+
// Overridden from DownloadItemImplDelegate
// (Note that |GetBrowserContext| are present in both interfaces.)
void DetermineDownloadTarget(DownloadItemImpl* item,
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698