Update V8 to version 4.7.19.
[chromium-blink-merge.git] / android_webview / native / state_serializer.h
blobb220ccfb5f0119c7aa184f9db589f7cdbc0b8fa9
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.
4 //
5 #ifndef ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
6 #define ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
8 #include "base/compiler_specific.h"
10 namespace base {
12 class Pickle;
13 class PickleIterator;
15 } // namespace base
17 namespace content {
19 class NavigationEntry;
20 class WebContents;
22 } // namespace content
24 namespace android_webview {
26 // Write and restore a WebContents to and from a pickle. Return true on
27 // success.
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;
38 namespace internal {
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
42 // tests.
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_