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

Issue 11420056: Android WebView save/restoreState and backForardList Part 1 (Closed)

Created:
8 years, 1 month ago by boliu
Modified:
8 years, 1 month ago
CC:
chromium-reviews, android-webview-reviews_chromium.org
Visibility:
Public.

Description

Android WebView save/restoreState and backForardList Part 1 Design for save/restoreState is do all serialization in native and pass an opaque byte array to java to put into the bundle. This patch contains the native code to (de)serialize a WebContents with some unit test coverage. Reasons for not re-using TabNavigation under chrome/: * Android WebView has different requirements for fields to store since we are the only ones using values like base_url_for_data_url. * TabNavigation does unnecessary copying of data, which in Android WebView case, is undesired since save/restore is called in Android very frequently. * TabNavigation is tightly integrated with the rest of chrome session restore and sync code, and has other purpose in addition to serializing NavigationEntry. Optimization-wise, there will be an unnecessary copy when converting native to java byte array. Only way to avoid it is to know the allocation size before pickling starts. Maybe consider pre-computing the size (brittle), or use chrome's design of capping the size of the data and throwing away old entries and "less important" information. Only consider this if speed becomes a problem. BUG= Android WebView only change. Ran through trybots. NOTRY=true Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=169024

Patch Set 1 #

Patch Set 2 : Use ScopedVector #

Total comments: 14

Patch Set 3 : namespace internal, add comments #

Total comments: 2

Patch Set 4 : Remove outdated comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+385 lines, -1 line) Patch
M android_webview/android_webview_tests.gypi View 1 chunk +1 line, -0 lines 0 comments Download
A android_webview/native/state_serializer.h View 1 2 3 1 chunk +50 lines, -0 lines 0 comments Download
A android_webview/native/state_serializer.cc View 1 2 1 chunk +245 lines, -0 lines 0 comments Download
A android_webview/native/state_serializer_unittests.cc View 1 2 1 chunk +86 lines, -0 lines 0 comments Download
M android_webview/native/webview_native.gyp View 2 chunks +3 lines, -1 line 0 comments Download

Messages

Total messages: 12 (0 generated)
boliu
Decided to break this into parts. What I had on Friday is here: http://codereview.chromium.org/11348113/ Joth: ...
8 years, 1 month ago (2012-11-18 21:22:45 UTC) #1
boliu
Ping! http://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): http://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc#newcode8 android_webview/native/state_serializer.cc:8: #include <vector> Not needed, will remove before cq/submit
8 years, 1 month ago (2012-11-19 19:57:30 UTC) #2
mkosiba (inactive)
https://chromiumcodereview.appspot.com/11420056/diff/5001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://chromiumcodereview.appspot.com/11420056/diff/5001/android_webview/native/state_serializer.cc#newcode24 android_webview/native/state_serializer.cc:24: const uint32 AW_STATE_VERSION = 20121116; 1) I don't think ...
8 years, 1 month ago (2012-11-20 17:40:57 UTC) #3
boliu
https://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc#newcode24 android_webview/native/state_serializer.cc:24: const uint32 AW_STATE_VERSION = 20121116; On 2012/11/20 17:40:57, Martin ...
8 years, 1 month ago (2012-11-20 19:35:38 UTC) #4
joth
(not read in detail yet) https://chromiumcodereview.appspot.com/11420056/diff/5001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://chromiumcodereview.appspot.com/11420056/diff/5001/android_webview/native/state_serializer.cc#newcode24 android_webview/native/state_serializer.cc:24: const uint32 AW_STATE_VERSION = ...
8 years, 1 month ago (2012-11-20 19:51:02 UTC) #5
boliu
https://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc#newcode217 android_webview/native/state_serializer.cc:217: entry->SetTimestamp(base::Time::FromInternalValue(timestamp)); On 2012/11/20 19:51:02, joth wrote: > wild idea: ...
8 years, 1 month ago (2012-11-20 21:29:38 UTC) #6
boliu
PTAL https://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc File android_webview/native/state_serializer.cc (right): https://codereview.chromium.org/11420056/diff/5001/android_webview/native/state_serializer.cc#newcode8 android_webview/native/state_serializer.cc:8: #include <vector> On 2012/11/19 19:57:31, boliu wrote: > ...
8 years, 1 month ago (2012-11-20 22:18:16 UTC) #7
joth
lgtm (assuming martin had no other comments) https://codereview.chromium.org/11420056/diff/6004/android_webview/native/state_serializer.h File android_webview/native/state_serializer.h (right): https://codereview.chromium.org/11420056/diff/6004/android_webview/native/state_serializer.h#newcode23 android_webview/native/state_serializer.h:23: // success. ...
8 years, 1 month ago (2012-11-20 23:06:48 UTC) #8
boliu
Martin: I put NOTRY=true. Assuming you don't have any more problems with this, please cq ...
8 years, 1 month ago (2012-11-20 23:21:12 UTC) #9
mkosiba (inactive)
lgtm
8 years, 1 month ago (2012-11-21 12:17:03 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/boliu@chromium.org/11420056/10002
8 years, 1 month ago (2012-11-21 12:17:16 UTC) #11
commit-bot: I haz the power
8 years, 1 month ago (2012-11-21 12:34:11 UTC) #12
Change committed as 169024

Powered by Google App Engine
This is Rietveld 408576698