1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47

content / browser / notifications / notification_database_conversions.h [blame]

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_CONVERSIONS_H_
#define CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_CONVERSIONS_H_

#include <string>

#include "content/common/content_export.h"

namespace blink {
struct NotificationResources;
}  // namespace blink

namespace content {

struct NotificationDatabaseData;

// Parses the serialized notification data |input| into a new object, |output|.
// Returns whether the serialized |input| could be deserialized successfully.
CONTENT_EXPORT bool DeserializeNotificationDatabaseData(
    const std::string& input,
    NotificationDatabaseData* output);

// Serializes the contents of |input| into the string |output|. Returns whether
// the notification data could be serialized successfully.
CONTENT_EXPORT bool SerializeNotificationDatabaseData(
    const NotificationDatabaseData& input,
    std::string* output);

// Parses the serialized notification resources |input| into a new object,
// |output|. Returns whether the serialized |input| could be deserialized
// successfully.
CONTENT_EXPORT bool DeserializeNotificationDatabaseResources(
    const std::string& input,
    blink::NotificationResources* output);

// Serializes the contents of |input| into the string |output|. Returns whether
// the notification resources could be serialized successfully.
CONTENT_EXPORT bool SerializeNotificationDatabaseResources(
    const blink::NotificationResources& input,
    std::string* output);

}  // namespace content

#endif  // CONTENT_BROWSER_NOTIFICATIONS_NOTIFICATION_DATABASE_CONVERSIONS_H_