See if we can avoid using WebApkInfo#create() in both WebappLauncherActivity and WebApkActivity |
||
Issue descriptionSee if we can avoid using WebApkInfo#create() in both WebappLauncherActivity and WebApkActivity
,
Jul 19 2017
AsyncTabParamsManager is effectively a static singleton that stores a map of tabId -> params. If you really wanted to avoid the second create() call you could make WebappInfo work the same way - make WebappInfoManager store a static map of webappid -> WebappInfo. What is the motivation for trying to reduce the calls to create()? Efficiency? Having a static singleton may use more memory.
,
Jul 20 2017
When I filed the bug, I was concerned about efficiency. I took some measurements and the second WebappInfo#create() / WebApkInfo#create() takes about 10ms on an Android One device so the reason for doing this now is fixing Issue 739927
,
Aug 11 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a3a25ad9a49976a552f5ed9221446c1c58f2e2a3 commit a3a25ad9a49976a552f5ed9221446c1c58f2e2a3 Author: Ran Ji <ranj@chromium.org> Date: Fri Aug 11 15:37:38 2017 Make a static map to store webappInfo by id A WebappActivity is in a special state when it is present in recents but has been killed by the Android OS. The WebappActivity can be brought back to life via: A) The user tapping recents. In this case: - WebappActivity is created with intent with which it was previously created - Bundle is passed to WebappActivity#onCreate() with data from WebappActivity#onSaveInstanceState() B) The activity getting launched via an intent from WebappLauncherActivity. In this case: - WebappActivity is created with intent with which it was previously created. The intent sent from WebappLauncherActivity is ignored. - Bundle is passed to WebappActivity#onCreate() with data from WebappActivity#onSaveInstanceState(). This CL fixes the "intent from WebappLauncherActivity being ignored." in scenario (B). The CL introduces a static map which stores the desired WebappInfo for a WebappActivity. The map is populated by WebappLauncherActivity. WebappActivity prefers using WebappInfo from the static map over creating WebappInfo from the (potentially incorrect) WebappActivity intent. Bug: 696720 Change-Id: I06a2eecdbd769e771aac82ba1a4006aa3f9031ec Reviewed-on: https://chromium-review.googlesource.com/579572 Commit-Queue: Ran Ji <ranj@chromium.org> Reviewed-by: Dominick Ng <dominickn@chromium.org> Reviewed-by: Xi Han <hanxi@chromium.org> Reviewed-by: Peter Kotwicz <pkotwicz@chromium.org> Cr-Commit-Position: refs/heads/master@{#493752} [modify] https://crrev.com/a3a25ad9a49976a552f5ed9221446c1c58f2e2a3/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebApkInfo.java [modify] https://crrev.com/a3a25ad9a49976a552f5ed9221446c1c58f2e2a3/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java [modify] https://crrev.com/a3a25ad9a49976a552f5ed9221446c1c58f2e2a3/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappInfo.java [modify] https://crrev.com/a3a25ad9a49976a552f5ed9221446c1c58f2e2a3/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappLauncherActivity.java [modify] https://crrev.com/a3a25ad9a49976a552f5ed9221446c1c58f2e2a3/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappModeTest.java
,
Aug 11 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by yfried...@chromium.org
, Jul 14 2017Status: Assigned (was: Untriaged)
I suggest we store it in memory while we bounce b/w chromelauncheractivity and Web{app,Apk}Activity. This is similar (but different) to how AsyncTabParamsManager is used in tab reparenting