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

Issue 2663413002: [WebView shell] Discard very long WebView states (Closed)

Created:
3 years, 10 months ago by Tima Vaisburd
Modified:
3 years, 10 months ago
Reviewers:
Torne, boliu, timvolodine
CC:
chromium-reviews, android-webview-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[WebView shell] Discard very long WebView states WebView serializes its state into Android's Bundle so it can restore it through activity recycle. Since N Android has inforced the limit for the size of the bundle, at the same time the length of the serialized state has grew beyond this limit. This CL puts a temorary fix to this problem into SystemWebViewShell only. The states longer than 300k are now dropped by the shell. BUG=686607 Review-Url: https://codereview.chromium.org/2663413002 Cr-Commit-Position: refs/heads/master@{#447681} Committed: https://chromium.googlesource.com/chromium/src/+/c58f0323797ee837ccc917c8e31886a0fcbf712e

Patch Set 1 #

Total comments: 3

Patch Set 2 : Added Toast #

Total comments: 2

Patch Set 3 : Added the actual legth to the toast message #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -0 lines) Patch
M android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java View 1 2 4 chunks +19 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (6 generated)
Tima Vaisburd
This is my attempt at dealing with the TransactionTooLongException. I know Torne was against this ...
3 years, 10 months ago (2017-02-01 17:19:50 UTC) #2
boliu
https://codereview.chromium.org/2663413002/diff/1/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java File android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java (right): https://codereview.chromium.org/2663413002/diff/1/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java#newcode227 android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java:227: byte[] webViewState = savedInstanceState.getByteArray(SAVE_RESTORE_STATE_KEY); this is a bit hacky ...
3 years, 10 months ago (2017-02-01 17:38:26 UTC) #3
Tima Vaisburd
https://codereview.chromium.org/2663413002/diff/1/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java File android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java (right): https://codereview.chromium.org/2663413002/diff/1/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java#newcode227 android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java:227: byte[] webViewState = savedInstanceState.getByteArray(SAVE_RESTORE_STATE_KEY); On 2017/02/01 17:38:26, boliu wrote: ...
3 years, 10 months ago (2017-02-01 17:48:44 UTC) #4
Torne
Doing this *specifically in the shell* is okay; I was objecting to doing it in ...
3 years, 10 months ago (2017-02-01 17:54:31 UTC) #5
boliu
+1 for toast https://codereview.chromium.org/2663413002/diff/1/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java File android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java (right): https://codereview.chromium.org/2663413002/diff/1/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java#newcode227 android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java:227: byte[] webViewState = savedInstanceState.getByteArray(SAVE_RESTORE_STATE_KEY); On 2017/02/01 ...
3 years, 10 months ago (2017-02-01 17:57:05 UTC) #6
Tima Vaisburd
Added Toast saying "Can't save state: too long".
3 years, 10 months ago (2017-02-01 19:17:25 UTC) #7
boliu
one more suggestion, but lgtm https://codereview.chromium.org/2663413002/diff/20001/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java File android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java (right): https://codereview.chromium.org/2663413002/diff/20001/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java#newcode231 android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java:231: Toast.makeText(this, "Can't save state: ...
3 years, 10 months ago (2017-02-01 20:24:43 UTC) #8
Tima Vaisburd
https://codereview.chromium.org/2663413002/diff/20001/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java File android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java (right): https://codereview.chromium.org/2663413002/diff/20001/android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java#newcode231 android_webview/tools/system_webview_shell/apk/src/org/chromium/webview_shell/WebViewBrowserActivity.java:231: Toast.makeText(this, "Can't save state: too long", Toast.LENGTH_SHORT).show(); On 2017/02/01 ...
3 years, 10 months ago (2017-02-02 01:39:36 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2663413002/40001
3 years, 10 months ago (2017-02-02 01:40:28 UTC) #12
commit-bot: I haz the power
3 years, 10 months ago (2017-02-02 01:55:48 UTC) #16
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/c58f0323797ee837ccc917c8e318...

Powered by Google App Engine
This is Rietveld 408576698