OLD | NEW |
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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 | 9 |
| 10 namespace base { |
| 11 |
10 class Pickle; | 12 class Pickle; |
11 class PickleIterator; | 13 class PickleIterator; |
12 | 14 |
| 15 } // namespace base |
| 16 |
13 namespace content { | 17 namespace content { |
14 | 18 |
15 class NavigationEntry; | 19 class NavigationEntry; |
16 class WebContents; | 20 class WebContents; |
17 | 21 |
18 } // namespace content | 22 } // namespace content |
19 | 23 |
20 namespace android_webview { | 24 namespace android_webview { |
21 | 25 |
22 // Write and restore a WebContents to and from a pickle. Return true on | 26 // Write and restore a WebContents to and from a pickle. Return true on |
23 // success. | 27 // success. |
24 | 28 |
25 // Note that |pickle| may be changed even if function returns false. | 29 // Note that |pickle| may be changed even if function returns false. |
26 bool WriteToPickle(const content::WebContents& web_contents, | 30 bool WriteToPickle(const content::WebContents& web_contents, |
27 Pickle* pickle) WARN_UNUSED_RESULT; | 31 base::Pickle* pickle) WARN_UNUSED_RESULT; |
28 | 32 |
29 // |web_contents| will not be modified if function returns false. | 33 // |web_contents| will not be modified if function returns false. |
30 bool RestoreFromPickle(PickleIterator* iterator, | 34 bool RestoreFromPickle(base::PickleIterator* iterator, |
31 content::WebContents* web_contents) WARN_UNUSED_RESULT; | 35 content::WebContents* web_contents) WARN_UNUSED_RESULT; |
32 | 36 |
33 | 37 |
34 namespace internal { | 38 namespace internal { |
| 39 |
35 // Functions below are individual helper functiosn called by functions above. | 40 // Functions below are individual helper functiosn called by functions above. |
36 // They are broken up for unit testing, and should not be called out side of | 41 // They are broken up for unit testing, and should not be called out side of |
37 // tests. | 42 // tests. |
38 bool WriteHeaderToPickle(Pickle* pickle) WARN_UNUSED_RESULT; | 43 bool WriteHeaderToPickle(base::Pickle* pickle) WARN_UNUSED_RESULT; |
39 bool RestoreHeaderFromPickle(PickleIterator* iterator) WARN_UNUSED_RESULT; | 44 bool RestoreHeaderFromPickle(base::PickleIterator* iterator) WARN_UNUSED_RESULT; |
40 bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry, | 45 bool WriteNavigationEntryToPickle(const content::NavigationEntry& entry, |
41 Pickle* pickle) WARN_UNUSED_RESULT; | 46 base::Pickle* pickle) WARN_UNUSED_RESULT; |
42 bool RestoreNavigationEntryFromPickle( | 47 bool RestoreNavigationEntryFromPickle( |
43 PickleIterator* iterator, | 48 base::PickleIterator* iterator, |
44 content::NavigationEntry* entry) WARN_UNUSED_RESULT; | 49 content::NavigationEntry* entry) WARN_UNUSED_RESULT; |
45 | 50 |
46 } // namespace interanl | 51 } // namespace interanl |
47 | 52 |
48 } // namespace android_webview | 53 } // namespace android_webview |
49 | 54 |
50 #endif // ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ | 55 #endif // ANDROID_WEBVIEW_NATIVE_STATE_SERIALIZER_H_ |
OLD | NEW |