Variations: add an option to avoid SharedPreferences
No change to logic for Chrome, this only affects WebView. This adds an option to VariationsSeedStore to configure it to avoid accessing the "first run" Java SharedPreferences. Any access to SharedPreferences may perform disk IO; since WebView initializes variations on the UI thread, this causes a strictmode violation. WebView doesn't use the first run prefs, so this adds a configuration parameter to completely avoid SharedPreferences. This also adds unit tests to verify SharedPreferences are not modified when this parameter is passed. Fixed: 1131941 Test: out/Default/bin/run_components_unittests -f VariationsSeedStore* Test: android_webview/tools/run_cts.py -m CtsWebViewStartupApp.apk Test: Locally add 'assert false' next to SharedPreferences access, verify WebView doesn't crash Change-Id: I137fcbc49b4619dcde84fa1d0375edf6d421c8eb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2444473 Auto-Submit: Nate Fischer <ntfschr@chromium.org> Commit-Queue: Alexei Svitkine <asvitkine@chromium.org> Reviewed-by:Alexei Svitkine <asvitkine@chromium.org> Reviewed-by:
Robert Kaplow <rkaplow@chromium.org> Reviewed-by:
Richard Coles <torne@chromium.org> Cr-Commit-Position: refs/heads/master@{#813944}
Showing
Please register or sign in to comment