OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 RegistrationData* deleted_version, | 191 RegistrationData* deleted_version, |
192 std::vector<int64_t>* newly_purgeable_resources); | 192 std::vector<int64_t>* newly_purgeable_resources); |
193 | 193 |
194 // Reads user data for |registration_id| and |user_data_names| from the | 194 // Reads user data for |registration_id| and |user_data_names| from the |
195 // database. Returns OK only if all keys are found; otherwise NOT_FOUND, and | 195 // database. Returns OK only if all keys are found; otherwise NOT_FOUND, and |
196 // |user_data_values| will be empty. | 196 // |user_data_values| will be empty. |
197 Status ReadUserData(int64_t registration_id, | 197 Status ReadUserData(int64_t registration_id, |
198 const std::vector<std::string>& user_data_names, | 198 const std::vector<std::string>& user_data_names, |
199 std::vector<std::string>* user_data_values); | 199 std::vector<std::string>* user_data_values); |
200 | 200 |
201 // Reads user data for |registration_id| and |key_prefix| from the database. | |
202 // Returns OK only if all keys are found; otherwise NOT_FOUND, and | |
nhiroki
2017/05/02 01:21:12
"all keys are found" sounds strange. Maybe "if key
zino
2017/05/02 15:03:58
Done.
| |
203 // |user_data_values| will be empty. | |
204 Status ReadUserDataByKeyPrefix(int64_t registration_id, | |
205 const std::string key_prefix, | |
206 std::vector<std::string>* user_data_values); | |
207 | |
201 // Writes |name_value_pairs| into the database. Returns NOT_FOUND if the | 208 // Writes |name_value_pairs| into the database. Returns NOT_FOUND if the |
202 // registration specified by |registration_id| does not exist in the database. | 209 // registration specified by |registration_id| does not exist in the database. |
203 Status WriteUserData( | 210 Status WriteUserData( |
204 int64_t registration_id, | 211 int64_t registration_id, |
205 const GURL& origin, | 212 const GURL& origin, |
206 const std::vector<std::pair<std::string, std::string>>& name_value_pairs); | 213 const std::vector<std::pair<std::string, std::string>>& name_value_pairs); |
207 | 214 |
208 // Deletes user data for |registration_id| and |user_data_names| from the | 215 // Deletes user data for |registration_id| and |user_data_names| from the |
209 // database. Returns OK if all are successfully deleted or not found in the | 216 // database. Returns OK if all are successfully deleted or not found in the |
210 // database. | 217 // database. |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
401 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, | 408 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, |
402 UserData_UninitializedDatabase); | 409 UserData_UninitializedDatabase); |
403 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); | 410 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerDatabaseTest, DestroyDatabase); |
404 | 411 |
405 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); | 412 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDatabase); |
406 }; | 413 }; |
407 | 414 |
408 } // namespace content | 415 } // namespace content |
409 | 416 |
410 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ | 417 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DATABASE_H_ |
OLD | NEW |