blob: 75422e2a2f0c7be32edcc30e0db0a401d536388d (
plain)
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
|
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// This file contains (de)serialization (or if you like python, pickling)
// methods for various objects that we want to persist.
// In serialization, we write an object's state to a string in some opaque
// format. Deserialization reconstructs the object's state from such a string.
#ifndef WEBKIT_GLUE_GLUE_SERIALIZE_H__
#define WEBKIT_GLUE_GLUE_SERIALIZE_H__
#include "PassRefPtr.h"
#include "RefPtr.h"
namespace WebCore {
class String;
class HistoryItem;
}
namespace webkit_glue {
// HistoryItem serialization. The returned HistoryItem will have a ref count
// of 0, so the first RefPtr it is assigned to will take ownership. The empty
// string corresponds with a NULL HistoryItem.
void HistoryItemToString(
PassRefPtr<WebCore::HistoryItem> item, std::string* serialized_item);
PassRefPtr<WebCore::HistoryItem> HistoryItemFromString(
const std::string& serialized_item);
// For testing purposes only.
void HistoryItemToVersionedString(
PassRefPtr<WebCore::HistoryItem> item, int version,
std::string* serialized_item);
}
#endif // #ifndef WEBKIT_GLUE_GLUE_SERIALIZE_H__
|