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

Unified Diff: components/offline_pages/offline_page_metadata_store_impl.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: Adding BUILD.gn updates Created 5 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_metadata_store_impl.h
diff --git a/components/offline_pages/offline_page_metadata_store_impl.h b/components/offline_pages/offline_page_metadata_store_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..848b25843e5af54764e6cdcf3d82f7d6e8d6bce6
--- /dev/null
+++ b/components/offline_pages/offline_page_metadata_store_impl.h
@@ -0,0 +1,47 @@
+// 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_IMPL_H_
+#define COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_
+
+#include "components/offline_pages/offline_page_metadata_store.h"
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/weak_ptr.h"
+
+namespace base {
+class FilePath;
+class SequencedTaskRunner;
+}
+
+namespace offline_pages {
+
+// Implements OfflinePageMetadataStore using SQLite.
+class OfflinePageMetadataStoreImpl : public OfflinePageMetadataStore {
+ public:
+ OfflinePageMetadataStoreImpl(
+ const base::FilePath& path,
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner);
+ ~OfflinePageMetadataStoreImpl() override;
+
+ void Close();
+
+ // OfflinePageMetadataStore implementation:
+ void Load(const LoadCallback& callback) override;
+ void AddOfflinePage(const OfflinePageItem& offline_page_record,
+ const UpdateCallback& callback) override;
+ void RemoveOfflinePage(const GURL& page_url,
+ const UpdateCallback& callback) override;
+ void Destroy(const UpdateCallback& callback) override;
+
+ private:
+ class Backend;
+
+ scoped_refptr<Backend> backend_;
+ scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_OFFLINE_PAGE_METADATA_STORE_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698