Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: android_webview/native/state_serializer.h

Issue 1687853002: Make AW state_serializer handle restoring also legacy format (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix signed/unsigned int mismatch Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | android_webview/native/state_serializer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 #ifndef ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ 5 #ifndef ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
6 #define ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ 6 #define ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
7 7
8 #include <cstdint>
9
8 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
9 11
10 namespace base { 12 namespace base {
11 13
12 class Pickle; 14 class Pickle;
13 class PickleIterator; 15 class PickleIterator;
14 16
15 } // namespace base 17 } // namespace base
16 18
17 namespace content { 19 namespace content {
(...skipping 12 matching lines...) Expand all
30 bool WriteToPickle(const content::WebContents& web_contents, 32 bool WriteToPickle(const content::WebContents& web_contents,
31 base::Pickle* pickle) WARN_UNUSED_RESULT; 33 base::Pickle* pickle) WARN_UNUSED_RESULT;
32 34
33 // |web_contents| will not be modified if function returns false. 35 // |web_contents| will not be modified if function returns false.
34 bool RestoreFromPickle(base::PickleIterator* iterator, 36 bool RestoreFromPickle(base::PickleIterator* iterator,
35 content::WebContents* web_contents) WARN_UNUSED_RESULT; 37 content::WebContents* web_contents) WARN_UNUSED_RESULT;
36 38
37 39
38 namespace internal { 40 namespace internal {
39 41
40 // Functions below are individual helper functiosn called by functions above. 42 const uint32_t AW_STATE_VERSION_INITIAL = 20130814;
43 const uint32_t AW_STATE_VERSION_DATA_URL = 20151204;
44
45 // Functions below are individual helper functions called by functions above.
41 // They are broken up for unit testing, and should not be called out side of 46 // They are broken up for unit testing, and should not be called out side of
42 // tests. 47 // tests.
43 bool WriteHeaderToPickle(base::Pickle* pickle) WARN_UNUSED_RESULT; 48 bool WriteHeaderToPickle(base::Pickle* pickle) WARN_UNUSED_RESULT;
44 bool RestoreHeaderFromPickle(base::PickleIterator* iterator) WARN_UNUSED_RESULT; 49 bool WriteHeaderToPickle(uint32_t state_version,
50 base::Pickle* pickle) WARN_UNUSED_RESULT;
51 uint32_t RestoreHeaderFromPickle(base::PickleIterator* iterator)
52 WARN_UNUSED_RESULT;
53 bool IsSupportedVersion(uint32_t state_version) WARN_UNUSED_RESULT;
45 bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry, 54 bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry,
46 base::Pickle* pickle) WARN_UNUSED_RESULT; 55 base::Pickle* pickle) WARN_UNUSED_RESULT;
47 bool RestoreNavigationEntryFromPickle( 56 bool WriteNavigationEntryToPickle(uint32_t state_version,
48 base::PickleIterator* iterator, 57 const content::NavigationEntry& entry,
49 content::NavigationEntry* entry) WARN_UNUSED_RESULT; 58 base::Pickle* pickle) WARN_UNUSED_RESULT;
59 bool RestoreNavigationEntryFromPickle(base::PickleIterator* iterator,
60 content::NavigationEntry* entry)
61 WARN_UNUSED_RESULT;
62 bool RestoreNavigationEntryFromPickle(uint32_t state_version,
63 base::PickleIterator* iterator,
64 content::NavigationEntry* entry)
65 WARN_UNUSED_RESULT;
50 66
51 } // namespace interanl 67 } // namespace interanl
52 68
53 } // namespace android_webview 69 } // namespace android_webview
54 70
55 #endif // ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ 71 #endif // ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_
OLDNEW
« no previous file with comments | « no previous file | android_webview/native/state_serializer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698