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

Issue 1378653002: [Android] Enable ApplicationStatus for WebView. (Closed)

Created:
5 years, 2 months ago by timvolodine
Modified:
5 years, 1 month ago
CC:
android-webview-reviews_chromium.org, chromium-reviews, Bernhard Bauer
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android] Enable ApplicationStatus for WebView. Currently ApplicationStatus does not work with WebView. This patch introduces a 'webview' mode to allow for a webview specific usage of the ApplicationStatus class. The 'webview' mode is needed because of the following: - Current ApplicationStatus initialization is assumed to happen inside the OnCreate method of the Application, in webview this can happen anytime relative to the embedding application. - ApplicationStatus.initialize takes a BaseChromiumApplication as a parameter, while this should be Application in case of webview. - In this patch webview mode does not listen to window focus events, but this may be considered in the future. - getApplicationContext should return wrapped application context in case of webview. BUG=470582

Patch Set 1 #

Total comments: 14

Patch Set 2 : address comments #

Total comments: 10

Patch Set 3 : address Bo's comments #

Total comments: 16

Patch Set 4 : add intial sCachedApplicationState #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -30 lines) Patch
M android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java View 1 2 1 chunk +1 line, -1 line 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java View 1 2 3 chunks +15 lines, -1 line 0 comments Download
M base/android/java/src/org/chromium/base/ApplicationStatus.java View 1 2 3 6 chunks +87 lines, -28 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 35 (4 generated)
timvolodine
5 years, 2 months ago (2015-09-29 16:16:29 UTC) #2
timvolodine
+dtrainor@ as the original author of ApplicationStatus
5 years, 2 months ago (2015-09-29 16:17:19 UTC) #4
timvolodine
an attempt to make it work on WebView. wdyt? in particular: - should this be ...
5 years, 2 months ago (2015-09-29 16:20:34 UTC) #5
boliu
On 2015/09/29 16:20:34, timvolodine wrote: > an attempt to make it work on WebView. wdyt? ...
5 years, 2 months ago (2015-09-29 21:34:03 UTC) #6
David Trainor- moved to gerrit
https://codereview.chromium.org/1378653002/diff/1/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/1/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode73 base/android/java/src/org/chromium/base/ApplicationStatus.java:73: new ConcurrentHashMap<Activity, ActivityInfo>(); On 2015/09/29 21:34:02, boliu wrote: > ...
5 years, 2 months ago (2015-09-29 23:02:11 UTC) #7
boliu
https://codereview.chromium.org/1378653002/diff/1/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/1/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode73 base/android/java/src/org/chromium/base/ApplicationStatus.java:73: new ConcurrentHashMap<Activity, ActivityInfo>(); On 2015/09/29 23:02:11, David Trainor wrote: ...
5 years, 2 months ago (2015-09-29 23:21:45 UTC) #8
dgn
Thanks for your work on that. Our CLs can land independently without any issue so ...
5 years, 2 months ago (2015-09-30 11:02:55 UTC) #10
David Trainor- moved to gerrit
https://codereview.chromium.org/1378653002/diff/1/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/1/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode73 base/android/java/src/org/chromium/base/ApplicationStatus.java:73: new ConcurrentHashMap<Activity, ActivityInfo>(); On 2015/09/29 23:21:45, boliu wrote: > ...
5 years, 2 months ago (2015-09-30 14:50:48 UTC) #11
timvolodine
addressed comments, PTAL! https://codereview.chromium.org/1378653002/diff/1/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java (right): https://codereview.chromium.org/1378653002/diff/1/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java#newcode251 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java:251: ApplicationStatus.initializeForWebView(mWebViewDelegate.getApplication()); On 2015/09/29 21:34:02, boliu wrote: ...
5 years, 2 months ago (2015-10-01 15:49:29 UTC) #12
timvolodine
> > - should this be part of ApplicationStatus in base or should be create ...
5 years, 2 months ago (2015-10-01 15:51:59 UTC) #13
timvolodine
+rmcilroy@ as base/android/ owner
5 years, 2 months ago (2015-10-01 15:53:53 UTC) #15
rmcilroy
On 2015/10/01 15:53:53, timvolodine wrote: > +rmcilroy@ as base/android/ owner base/android lgtm.
5 years, 2 months ago (2015-10-01 16:58:25 UTC) #16
boliu
Haven't really addressed the issue that all activities are monitored, not just the ones that ...
5 years, 2 months ago (2015-10-01 16:59:02 UTC) #17
timvolodine
thanks for the comments Bo, please take another look https://codereview.chromium.org/1378653002/diff/20001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java (right): https://codereview.chromium.org/1378653002/diff/20001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java#newcode250 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java:250: ...
5 years, 2 months ago (2015-10-02 14:55:09 UTC) #18
David Trainor- moved to gerrit
lgtm, but wait for boliu.
5 years, 2 months ago (2015-10-02 15:24:10 UTC) #19
boliu
https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java File android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java (right): https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java#newcode78 android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java:78: public static void start(final Context context) { Fix all ...
5 years, 2 months ago (2015-10-02 15:51:32 UTC) #20
timvolodine
https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java File android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java (right): https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java#newcode78 android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java:78: public static void start(final Context context) { On 2015/10/02 ...
5 years, 2 months ago (2015-10-08 16:13:55 UTC) #21
boliu
https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java File android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java (right): https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java#newcode78 android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java:78: public static void start(final Context context) { On 2015/10/08 ...
5 years, 2 months ago (2015-10-08 18:01:30 UTC) #22
timvolodine
https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java File android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java (right): https://codereview.chromium.org/1378653002/diff/40001/android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java#newcode78 android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java:78: public static void start(final Context context) { On 2015/10/08 ...
5 years, 2 months ago (2015-10-09 15:46:36 UTC) #23
boliu
https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode221 base/android/java/src/org/chromium/base/ApplicationStatus.java:221: if (sActivityLifecycleIndependentMode) { On 2015/10/09 15:46:36, timvolodine wrote: > ...
5 years, 2 months ago (2015-10-09 15:58:57 UTC) #24
timvolodine
https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode221 base/android/java/src/org/chromium/base/ApplicationStatus.java:221: if (sActivityLifecycleIndependentMode) { On 2015/10/09 15:58:57, boliu (slow to ...
5 years, 2 months ago (2015-10-09 16:50:36 UTC) #25
timvolodine
https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode221 base/android/java/src/org/chromium/base/ApplicationStatus.java:221: if (sActivityLifecycleIndependentMode) { > > Which means in that ...
5 years, 2 months ago (2015-10-09 16:52:38 UTC) #26
boliu
https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode221 base/android/java/src/org/chromium/base/ApplicationStatus.java:221: if (sActivityLifecycleIndependentMode) { On 2015/10/09 16:52:38, timvolodine wrote: > ...
5 years, 2 months ago (2015-10-09 19:29:11 UTC) #27
timvolodine
https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java File base/android/java/src/org/chromium/base/ApplicationStatus.java (right): https://codereview.chromium.org/1378653002/diff/40001/base/android/java/src/org/chromium/base/ApplicationStatus.java#newcode221 base/android/java/src/org/chromium/base/ApplicationStatus.java:221: if (sActivityLifecycleIndependentMode) { On 2015/10/09 19:29:11, boliu (slow to ...
5 years, 2 months ago (2015-10-12 12:35:43 UTC) #28
timvolodine
Also updated crbug.com/470582 with the findings regarding impact of enabling ApplicationStatus in webview. Looks like ...
5 years, 2 months ago (2015-10-12 16:20:58 UTC) #29
boliu
no new patch set? On 2015/10/12 16:20:58, timvolodine wrote: > Also updated crbug.com/470582 with the ...
5 years, 2 months ago (2015-10-13 15:41:26 UTC) #30
dgn
https://codereview.chromium.org/1378653002/diff/40001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java File android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java (right): https://codereview.chromium.org/1378653002/diff/40001/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java#newcode250 android_webview/glue/java/src/com/android/webview/chromium/WebViewChromiumFactoryProvider.java:250: AwBrowserProcess.start(context, mWebViewDelegate.getApplication()); I think this is needed AwShellActivity too, ...
5 years, 2 months ago (2015-10-14 08:31:48 UTC) #31
dgn
Ping. Is this going to land some day?
5 years, 1 month ago (2015-10-27 21:35:49 UTC) #32
timvolodine
On 2015/10/27 21:35:49, dgn wrote: > Ping. Is this going to land some day? I've ...
5 years, 1 month ago (2015-10-28 19:11:41 UTC) #33
timvolodine
On 2015/10/28 19:11:41, timvolodine wrote: > On 2015/10/27 21:35:49, dgn wrote: > > Ping. Is ...
5 years, 1 month ago (2015-10-28 19:34:26 UTC) #34
dgn
5 years, 1 month ago (2015-11-23 12:10:01 UTC) #35
Message was sent while issue was closed.
On 2015/10/28 19:34:26, timvolodine (OOO 26 Nov) wrote:
> On 2015/10/28 19:11:41, timvolodine wrote:
> > On 2015/10/27 21:35:49, dgn wrote:
> > > Ping. Is this going to land some day?
> > 
> > I've uploaded a patch with initial cached state for the sake of
completeness.
> > 
> > After chatting to torne@ about this patch it still appears that knowing the
> > correct initial state of the app during webview initialization is
problematic.
> > 
> > The current patch implicitly assumes that there cannot be two 'resumed' (aka
> > running) activities at the same time. However going forward android may
allow
> > for this to actually happen by using multiple 'windows' for example.
> 
> also have put some more detailed explanations in crbug.com/470582.

Closed in favor of https://codereview.chromium.org/1407233017/

Powered by Google App Engine
This is Rietveld 408576698