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

Unified Diff: content/browser/service_worker/service_worker_database.h

Issue 1945753002: Make Service Worker DB UserData methods accept multiple keys at once (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@iid6encrypt
Patch Set: Rebase 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: content/browser/service_worker/service_worker_database.h
diff --git a/content/browser/service_worker/service_worker_database.h b/content/browser/service_worker/service_worker_database.h
index 0ef955d0d4efdcf57e25c67ac4f076dc1d510acd..2702754c0b1c22dc4f548aba96db3c522b61787e 100644
--- a/content/browser/service_worker/service_worker_database.h
+++ b/content/browser/service_worker/service_worker_database.h
@@ -7,10 +7,10 @@
#include <stdint.h>
-#include <map>
#include <memory>
#include <set>
#include <string>
+#include <utility>
#include <vector>
#include "base/files/file_path.h"
@@ -172,24 +172,25 @@ class CONTENT_EXPORT ServiceWorkerDatabase {
RegistrationData* deleted_version,
std::vector<int64_t>* newly_purgeable_resources);
- // Reads user data for |registration_id| and |user_data_name| from the
- // database.
+ // Reads user data for |registration_id| and |user_data_names| from the
+ // database. Returns OK only if all keys are found; otherwise NOT_FOUND, and
+ // |user_data_values| will be empty.
Status ReadUserData(int64_t registration_id,
- const std::string& user_data_name,
- std::string* user_data);
-
- // Writes |user_data| into the database. Returns NOT_FOUND if the registration
- // specified by |registration_id| does not exist in the database.
- Status WriteUserData(int64_t registration_id,
- const GURL& origin,
- const std::string& user_data_name,
- const std::string& user_data);
-
- // Deletes user data for |registration_id| and |user_data_name| from the
- // database. Returns OK if it's successfully deleted or not found in the
+ const std::vector<std::string>& user_data_names,
+ std::vector<std::string>* user_data_values);
+
+ // Writes |name_value_pairs| into the database. Returns NOT_FOUND if the
+ // registration specified by |registration_id| does not exist in the database.
+ Status WriteUserData(
+ int64_t registration_id,
+ const GURL& origin,
+ const std::vector<std::pair<std::string, std::string>>& name_value_pairs);
+
+ // Deletes user data for |registration_id| and |user_data_names| from the
+ // database. Returns OK if all are successfully deleted or not found in the
// database.
Status DeleteUserData(int64_t registration_id,
- const std::string& user_data_name);
+ const std::vector<std::string>& user_data_names);
// Reads user data for all registrations that have data with |user_data_name|
// from the database. Returns OK if they are successfully read or not found.

Powered by Google App Engine
This is Rietveld 408576698