blob: 211f995646eaa27b236fb7ce1d8fba6c7ce1e2cf [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2015 The Chromium Authors
Richard Knoll2e136ef2019-03-07 09:45:112// 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
12namespace blink {
13struct NotificationResources;
14} // namespace blink
15
16namespace content {
17
18struct NotificationDatabaseData;
19
20// Parses the serialized notification data |input| into a new object, |output|.
21// Returns whether the serialized |input| could be deserialized successfully.
22CONTENT_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.
28CONTENT_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.
35CONTENT_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.
41CONTENT_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_