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

Unified Diff: components/offline_pages/core/prefetch/prefetch_store.h

Issue 2879013002: Create skeleton for the Prefetching store and initial pipeline step. (Closed)
Patch Set: A couple of minor changes. Created 3 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/core/prefetch/prefetch_store.h
diff --git a/components/offline_pages/core/prefetch/prefetch_store.h b/components/offline_pages/core/prefetch/prefetch_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..714be45a9c3ea21726460c83a0a8cac109c4fc69
--- /dev/null
+++ b/components/offline_pages/core/prefetch/prefetch_store.h
@@ -0,0 +1,37 @@
+// Copyright 2017 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_CORE_PREFETCH_PREFETCH_STORE_H_
+#define COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_STORE_H_
+
+#include <vector>
+
+#include "base/callback.h"
+#include "components/offline_pages/core/prefetch/prefetch_item.h"
+#include "components/offline_pages/core/prefetch/prefetch_types.h"
+
+namespace offline_pages {
+
+// Persistent storage access class for prefetching offline pages data.
+class PrefetchStore {
+ public:
+ typedef base::Callback<void()> CreateItemsForUniqueUrlsCallback;
+ typedef base::Callback<void(bool /* success */)> ResetCallback;
+
+ virtual ~PrefetchStore(){};
+
+ // Asynchronously adds URLs as new items that are not yet in the prefetch
+ // store.
+ virtual void CreateItemsForUniqueUrls(
+ const std::string& name_space,
+ const std::vector<PrefetchURL>& prefetch_urls,
+ const CreateItemsForUniqueUrlsCallback& callback) = 0;
+
+ // Resets the store.
Dmitry Titov 2017/05/18 21:24:02 What exactly "Resets" mean? Could you add more to
carlosk 2017/05/24 20:57:26 Even better: I'll fully remove it for now as it's
+ virtual void Reset(const ResetCallback& callback) = 0;
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_CORE_PREFETCH_PREFETCH_STORE_H_

Powered by Google App Engine
This is Rietveld 408576698