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

Unified Diff: components/offline_pages/background/request_queue_in_memory_store.h

Issue 1951483002: [Offline pages] Adding in memory request queue store with tests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Udpating name of variable to make code more readable 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/background/request_queue_in_memory_store.h
diff --git a/components/offline_pages/background/request_queue_in_memory_store.h b/components/offline_pages/background/request_queue_in_memory_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..0a9b8bdb323337a9ddcfce877689717d01db4587
--- /dev/null
+++ b/components/offline_pages/background/request_queue_in_memory_store.h
@@ -0,0 +1,42 @@
+// Copyright 2016 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_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_
+#define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_
+
+#include <stdint.h>
+
+#include <map>
+
+#include "base/macros.h"
+#include "components/offline_pages/background/request_queue_store.h"
+
+namespace offline_pages {
+
+class SavePageRequest;
+
+// Interface for classes storing save page requests.
+class RequestQueueInMemoryStore : public RequestQueueStore {
+ public:
+ RequestQueueInMemoryStore();
+ ~RequestQueueInMemoryStore() override;
+
+ // RequestQueueStore implementaiton.
+ void GetRequests(const GetRequestsCallback& callback) override;
+ void AddOrUpdateRequest(const SavePageRequest& request,
+ const UpdateCallback& callback) override;
+ void RemoveRequests(const std::vector<int64_t>& request_ids,
+ const RemoveCallback& callback) override;
+ void Reset(const ResetCallback& callback) override;
+
+ private:
+ typedef std::map<int64_t, SavePageRequest> RequestsMap;
+ RequestsMap requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(RequestQueueInMemoryStore);
+};
+
+} // namespace offline_pages
+
+#endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_QUEUE_IN_MEMORY_STORE_H_
« no previous file with comments | « components/offline_pages/background/BUILD.gn ('k') | components/offline_pages/background/request_queue_in_memory_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698