New issue
Advanced search Search tips

Issue 688444 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

AddToHomescreenManager is never destroyed for WebAPKs

Project Member Reported by pkotw...@chromium.org, Feb 3 2017

Issue description

AddToHomescreenManager is never destroyed for WebAPKs

 
Owner: hanxi@chromium.org
Status: Assigned (was: Untriaged)
Xi, you seem to be working in the Beijing office during your vacation. This is a nice to have but not urgent bug. It would be great if you can fix it!

I have a feeling that the fix involves 1 or 2 lines of code

Comment 2 by hanxi@chromium.org, Feb 28 2017

I would like to help, but I can't ssh or chrome desktop to my workstation which is located outside of China. So I mainly work on emails and updating bugs. Are you catching the branch of M58 on Mar 2? Can you assign to others?
This bug doesn't have to be fixed for M58
Status: Available (was: Assigned)
Moving this bug back to available

Comment 5 by hanxi@chromium.org, Feb 28 2017

I think we also leak AddToHomescreenManager when adding shortcuts. Please correct me if I am wrong. So we may want to call AddToHomescreenManager#destroy() in the following places:
1. In the "if (is_webapk_compatible_)" block of AddToHomescreenManager#onDataAvailable(), add a Jni call to Java to call the Java destroy() before "return". (https://cs.chromium.org/chromium/src/chrome/browser/android/webapps/add_to_homescreen_manager.cc?rcl=1aebff2782292aed9da6a88bf3e98dc8a280c605&l=179)
2. In the two override methods onClick() in AddToHomescreenDialog#show():
  a) after the call of dialog.cancel();
  b) after the call of mManager.addShortcut().
I don't think that there are any issues with non-WebAPKs

AddToHomescreenManager#onDismissed() is called by the DialogInterface.OnDismissListener in AddToHomescreenDialog

Comment 7 by hanxi@chromium.org, Mar 10 2017

Oops, I put the wrong bug number in my CL, so it is committed to crbug.com/692249 (comment#4).

Comment 8 by hanxi@chromium.org, Mar 10 2017

Labels: Merge-Request-58
Project Member

Comment 9 by sheriffbot@chromium.org, Mar 11 2017

Labels: -Merge-Request-58 Hotlist-Merge-Approved Merge-Approved-58
Your change meets the bar and is auto-approved for M58. Please go ahead and merge the CL to branch 3029 manually. Please contact milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), bhthompson@(cros), govind@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 13 2017

Labels: -merge-approved-58 merge-merged-3029
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/200438fbc2dde571fc36dce8cf6bf9baa8b1bcf2

commit 200438fbc2dde571fc36dce8cf6bf9baa8b1bcf2
Author: Xi Han <hanxi@google.com>
Date: Mon Mar 13 13:53:57 2017

Fix leaking of AddToHomescreenManager for WebAPKs.

Currently, AddToHomescreenManager is never destroyed when installing a WebAPK.
In this CL, we add a JNI call in the native side to destroy
AddToHomescreenManager after creating an install infobar for WebAPKs.

BUG= 688444 

Review-Url: https://codereview.chromium.org/2738823008
Cr-Commit-Position: refs/heads/master@{#455594}
(cherry picked from commit aefa25eb71bb437576f9b0f1b093b9909a211f62)

Review-Url: https://codereview.chromium.org/2744273002 .
Cr-Commit-Position: refs/branch-heads/3029@{#145}
Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471}

[modify] https://crrev.com/200438fbc2dde571fc36dce8cf6bf9baa8b1bcf2/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenDialog.java
[modify] https://crrev.com/200438fbc2dde571fc36dce8cf6bf9baa8b1bcf2/chrome/android/java/src/org/chromium/chrome/browser/webapps/AddToHomescreenManager.java
[modify] https://crrev.com/200438fbc2dde571fc36dce8cf6bf9baa8b1bcf2/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/AddToHomescreenDialogTest.java
[modify] https://crrev.com/200438fbc2dde571fc36dce8cf6bf9baa8b1bcf2/chrome/browser/android/webapps/add_to_homescreen_manager.cc

Comment 11 by hanxi@chromium.org, Mar 13 2017

Status: Fixed (was: Available)

Sign in to add a comment