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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 1928393003: Using separate directories based on LifetimeType. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: components/offline_pages/offline_page_model.h
diff --git a/components/offline_pages/offline_page_model.h b/components/offline_pages/offline_page_model.h
index 35084369844be9396d41cad400524cf3211a8bb8..4c1a75b30adce9bb57fc709f0c1c642744151de9 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -23,6 +23,7 @@
#include "base/supports_user_data.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/offline_pages/offline_page_archiver.h"
+#include "components/offline_pages/offline_page_client_policy.h"
#include "components/offline_pages/offline_page_metadata_store.h"
class GURL;
@@ -132,6 +133,8 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData {
typedef base::Callback<void(const CheckPagesExistOfflineResult&)>
CheckPagesExistOfflineCallback;
typedef base::Callback<void(bool)> HasPagesCallback;
+ typedef std::map<LifetimePolicy::LifetimeType,
+ const base::FilePath&> ArchiveDirs;
// Generates a new offline id
static int64_t GenerateOfflineId();
@@ -143,7 +146,7 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData {
// All blocking calls/disk access will happen on the provided |task_runner|.
OfflinePageModel(std::unique_ptr<OfflinePageMetadataStore> store,
- const base::FilePath& archives_dir,
+ const ArchiveDirs& archive_dirs,
const scoped_refptr<base::SequencedTaskRunner>& task_runner);
~OfflinePageModel() override;
@@ -319,13 +322,16 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData {
const base::Callback<bool(const GURL&)>& predicate,
const DeletePageCallback& callback);
+ // Get the archive directory for the client id.
+ const base::FilePath& GetArchivePath(const ClientId& client_id);
+
void RunWhenLoaded(const base::Closure& job);
// Persistent store for offline page metadata.
std::unique_ptr<OfflinePageMetadataStore> store_;
- // Location where all of the archive files will be stored.
- base::FilePath archives_dir_;
+ // Location where all of the archive files will be stored based on namespace.
+ ArchiveDirs archive_dirs_;
// The observers.
base::ObserverList<Observer> observers_;
« no previous file with comments | « components/offline_pages/offline_page_client_policy.h ('k') | components/offline_pages/offline_page_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698