Chromium Code Reviews| Index: android_webview/native/state_serializer.h |
| diff --git a/android_webview/native/state_serializer.h b/android_webview/native/state_serializer.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..50473205e80a3aaecc42c17a3c5225ce4050624a |
| --- /dev/null |
| +++ b/android_webview/native/state_serializer.h |
| @@ -0,0 +1,47 @@ |
| +// Copyright (c) 2012 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. |
| +// |
| +#ifndef ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ |
| +#define ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ |
| + |
| +#include "base/compiler_specific.h" |
| + |
| +class Pickle; |
| +class PickleIterator; |
| + |
| +namespace content { |
| + |
| +class NavigationEntry; |
| +class WebContents; |
| + |
| +} // namespace content |
| + |
| +namespace android_webview { |
| + |
| +// Write and restore a WebContents to and from a pickle. Return true on |
| +// success. Note that no promise is made that the output variable is not |
| +// changed if false is returned. |
| + |
| +// Note that |pickle| may be changed even if function returns false. |
| +bool WriteToPickle(const content::WebContents& web_contents, |
| + Pickle* pickle) WARN_UNUSED_RESULT; |
| + |
| +// |web_contents| will not be modified if function returns false. |
| +bool RestoreFromPickle(PickleIterator* iterator, |
| + content::WebContents* web_contents) WARN_UNUSED_RESULT; |
| + |
| + |
| +// Functions below are individual helper functiosn called by functions above. |
| +// They are broken up for unit testing, and probalby should not be called out |
| +// side of tests. |
|
mkosiba (inactive)
2012/11/20 17:40:57
normally you would stick'em in an internals namesp
boliu
2012/11/20 22:18:16
Done.
|
| +bool WriteHeaderToPickle(Pickle* pickle) WARN_UNUSED_RESULT; |
| +bool RestoreHeaderFromPickle(PickleIterator* iterator) WARN_UNUSED_RESULT; |
| +bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry, |
| + Pickle* pickle) WARN_UNUSED_RESULT; |
| +bool RestoreNavigationEntryFromPickle( |
| + PickleIterator* iterator, |
| + content::NavigationEntry* entry) WARN_UNUSED_RESULT; |
| +} // namespace android_webview |
| + |
| +#endif // ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ |