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

Unified Diff: components/offline_pages/offline_page_model.h

Issue 1965633002: [Offline Pages] Introducing StorageManagerClient interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing after extracting callbacks. Created 4 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: 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 50231330a2e04d3b7f3d832a9249503d3b0f666d..be7c047dc3cb8316184987ed2500924533bfd998 100644
--- a/components/offline_pages/offline_page_model.h
+++ b/components/offline_pages/offline_page_model.h
@@ -26,6 +26,7 @@
#include "components/offline_pages/offline_page_archiver.h"
#include "components/offline_pages/offline_page_metadata_store.h"
#include "components/offline_pages/offline_page_types.h"
+#include "components/offline_pages/storage_manager_client.h"
class GURL;
namespace base {
@@ -64,7 +65,9 @@ class OfflinePageStorageManager;
//
// TODO(fgorski): Things to describe:
// * how to cancel requests and what to expect
-class OfflinePageModel : public KeyedService, public base::SupportsUserData {
+class OfflinePageModel : public KeyedService,
+ public base::SupportsUserData,
+ public StorageManagerClient {
public:
// Observer of the OfflinePageModel.
class Observer {
@@ -129,9 +132,8 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData {
const DeletePageCallback& callback);
// Deletes offline pages related to the passed |offline_ids|.
- // Making virtual for test purposes.
- virtual void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
- const DeletePageCallback& callback);
+ void DeletePagesByOfflineId(const std::vector<int64_t>& offline_ids,
+ const DeletePageCallback& callback) override;
// Wipes out all the data by deleting all saved files and clearing the store.
void ClearAll(const base::Closure& callback);
@@ -151,8 +153,7 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData {
const CheckPagesExistOfflineCallback& callback);
// Gets all available offline pages.
- // Making virtual for test purposes.
- virtual void GetAllPages(const MultipleOfflinePageItemCallback& callback);
+ void GetAllPages(const MultipleOfflinePageItemCallback& callback) override;
// Gets all offline ids where the offline page has the matching client id.
void GetOfflineIdsForClientId(const ClientId& client_id,
@@ -223,16 +224,17 @@ class OfflinePageModel : public KeyedService, public base::SupportsUserData {
bool reporting_after_delete);
// Returns the policy controller.
- // Making virtual for test purposes.
- virtual ClientPolicyController* GetPolicyController();
+ ClientPolicyController* GetPolicyController() override;
// Methods for testing only:
OfflinePageMetadataStore* GetStoreForTesting();
OfflinePageStorageManager* GetStorageManager();
- // Making virtual for test purposes.
- virtual bool is_loaded() const;
+ bool is_loaded() const;
+
+ // Implement StorageManagerClient.
+ bool IsLoaded() const override;
fgorski 2016/05/11 22:39:00 Did you consider using the is_loaded() defined abo
romax 2016/05/11 23:54:57 Per discussion, I'm going to remove it from the in
protected:
// Adding a protected constructor for testing-only purposes in

Powered by Google App Engine
This is Rietveld 408576698