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

Unified Diff: components/offline_pages/offline_page_metadata_store.h

Issue 1160283003: [Offline] Creates metadata store interface for offline pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@offline-pages-1
Patch Set: Addressing feedback Created 5 years, 6 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_metadata_store.h
diff --git a/components/offline_pages/offline_page_metadata_store.h b/components/offline_pages/offline_page_metadata_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..99de96acb8f5f53a60bc3ebdaf8bf2f382d8d2d0
--- /dev/null
+++ b/components/offline_pages/offline_page_metadata_store.h
@@ -0,0 +1,48 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_
+#define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_
+
+#include <vector>
+
+#include "base/callback.h"
+
+class GURL;
+
+namespace offline_pages {
+
+struct OfflinePageItem;
+
+// OfflinePageMetadataStore keeps metadata for the offline pages.
+// Ability to create multiple instances of the store as well as behavior of
+// asynchronous opertaions when the object is being destroyed, before such
Dmitry Titov 2015/06/09 21:58:05 typo: opertaions
fgorski 2015/06/09 22:11:13 Done.
+// operation finishes will depend on implementation. It should be possbile to
+// issue multiple asynchronous operations in parallel.
+class OfflinePageMetadataStore {
+ public:
+ typedef base::Callback<void(bool, const std::vector<OfflinePageItem>&)>
+ LoadCallback;
+ typedef base::Callback<void(bool)> UpdateCallback;
+
+ OfflinePageMetadataStore();
+ virtual ~OfflinePageMetadataStore();
+
+ // Get all of the offline pages from the store.
+ virtual void Load(const LoadCallback& callback) = 0;
+
+ // Asynchronously adds offline page metadata to the store for a given URL.
+ // Result of the update is passed in callback.
+ virtual void AddOfflinePage(const OfflinePageItem& offline_page,
+ const UpdateCallback& callback) = 0;
+
+ // Asynchronously removes offline page metadata from the store.
+ // Result of the update is passed in callback.
+ virtual void RemoveOfflinePage(const GURL& page_url,
+ const UpdateCallback& callback) = 0;
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698