1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
6 #define ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
8 #include "base/compiler_specific.h"
19 class NavigationEntry
;
22 } // namespace content
24 namespace android_webview
{
26 // Write and restore a WebContents to and from a pickle. Return true on
29 // Note that |pickle| may be changed even if function returns false.
30 bool WriteToPickle(const content::WebContents
& web_contents
,
31 base::Pickle
* pickle
) WARN_UNUSED_RESULT
;
33 // |web_contents| will not be modified if function returns false.
34 bool RestoreFromPickle(base::PickleIterator
* iterator
,
35 content::WebContents
* web_contents
) WARN_UNUSED_RESULT
;
40 // Functions below are individual helper functiosn called by functions above.
41 // They are broken up for unit testing, and should not be called out side of
43 bool WriteHeaderToPickle(base::Pickle
* pickle
) WARN_UNUSED_RESULT
;
44 bool RestoreHeaderFromPickle(base::PickleIterator
* iterator
) WARN_UNUSED_RESULT
;
45 bool WriteNavigationEntryToPickle(const content::NavigationEntry
& entry
,
46 base::Pickle
* pickle
) WARN_UNUSED_RESULT
;
47 bool RestoreNavigationEntryFromPickle(
48 base::PickleIterator
* iterator
,
49 content::NavigationEntry
* entry
) WARN_UNUSED_RESULT
;
51 } // namespace interanl
53 } // namespace android_webview
55 #endif // ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_