Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2015 The Chromium Authors |
Richard Knoll | 2e136ef | 2019-03-07 09:45:11 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_CONVERSIONS_H_ |
| 6 | #define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_CONVERSIONS_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
| 10 | #include "content/common/content_export.h" |
| 11 | |
| 12 | namespace blink { |
| 13 | struct NotificationResources; |
| 14 | } // namespace blink |
| 15 | |
| 16 | namespace content { |
| 17 | |
| 18 | struct NotificationDatabaseData; |
| 19 | |
| 20 | // Parses the serialized notification data |input| into a new object, |output|. |
| 21 | // Returns whether the serialized |input| could be deserialized successfully. |
| 22 | CONTENT_EXPORT bool DeserializeNotificationDatabaseData( |
| 23 | const std::string& input, |
| 24 | NotificationDatabaseData* output); |
| 25 | |
| 26 | // Serializes the contents of |input| into the string |output|. Returns whether |
| 27 | // the notification data could be serialized successfully. |
| 28 | CONTENT_EXPORT bool SerializeNotificationDatabaseData( |
| 29 | const NotificationDatabaseData& input, |
| 30 | std::string* output); |
| 31 | |
| 32 | // Parses the serialized notification resources |input| into a new object, |
| 33 | // |output|. Returns whether the serialized |input| could be deserialized |
| 34 | // successfully. |
| 35 | CONTENT_EXPORT bool DeserializeNotificationDatabaseResources( |
| 36 | const std::string& input, |
| 37 | blink::NotificationResources* output); |
| 38 | |
| 39 | // Serializes the contents of |input| into the string |output|. Returns whether |
| 40 | // the notification resources could be serialized successfully. |
| 41 | CONTENT_EXPORT bool SerializeNotificationDatabaseResources( |
| 42 | const blink::NotificationResources& input, |
| 43 | std::string* output); |
| 44 | |
| 45 | } // namespace content |
| 46 | |
| 47 | #endif // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_CONVERSIONS_H_ |