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

Issue 2639403003: Remove Last 1 pages when the tab holding them is destroyed. (Closed)

Created:
3 years, 11 months ago by dewittj
Modified:
3 years, 10 months ago
Reviewers:
Ted C, Dmitry Titov, fgorski
CC:
chromium-reviews, dewittj+watch_chromium.org, fgorski+watch_chromium.org, romax+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, agrieve+watch_chromium.org, dimich+watch_chromium.org, Marc Treib
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove Last 1 pages when the tab holding them is destroyed. Today, we remove last 1 pages when we navigate a tab, but if it is closed the page remains until it expires, despite being ineligible for display due to privacy constraints. This patch solves much of this issue by simply deleting the pages for a tab when it is destroyed (aka closed and undo is no longer possible). A future patch will ensure no bugs remain by monitoring the tab list from startup and filtering UI surfaces that show Last 1 pages. BUG=675661

Patch Set 1 #

Patch Set 2 : Update comments. #

Total comments: 7

Patch Set 3 : Comments addressed #

Total comments: 1

Patch Set 4 : Adds a test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+84 lines, -1 line) Patch
M chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java View 1 2 3 chunks +29 lines, -0 lines 0 comments Download
M chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridgeTest.java View 1 2 3 3 chunks +51 lines, -1 line 0 comments Download

Messages

Total messages: 28 (19 generated)
dewittj
tedchoc: ChromeActivity dimich: all treib: FYI
3 years, 11 months ago (2017-01-19 01:31:24 UTC) #6
Dmitry Titov
https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java (right): https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java#newcode484 chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java:484: if (mTabModelSelectorTabModelObserver != null) mTabModelSelectorTabModelObserver.destroy(); do you plan to ...
3 years, 11 months ago (2017-01-19 02:19:42 UTC) #7
fgorski
drive by https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java (right): https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java#newcode490 chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java:490: OfflinePageBridge.onTabAdded(tab); Why do we need to track ...
3 years, 11 months ago (2017-01-19 17:13:31 UTC) #9
Ted C
https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java (right): https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java#newcode490 chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java:490: OfflinePageBridge.onTabAdded(tab); On 2017/01/19 17:13:31, fgorski wrote: > Why do ...
3 years, 11 months ago (2017-01-19 17:49:35 UTC) #10
dewittj
PTAL, thanks. https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java (right): https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java#newcode484 chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java:484: if (mTabModelSelectorTabModelObserver != null) mTabModelSelectorTabModelObserver.destroy(); On 2017/01/19 ...
3 years, 11 months ago (2017-01-19 21:30:27 UTC) #19
Ted C
On 2017/01/19 21:30:27, dewittj wrote: > PTAL, thanks. > > https://codereview.chromium.org/2639403003/diff/20001/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java > File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java > ...
3 years, 11 months ago (2017-01-20 01:19:08 UTC) #25
dewittj
On 2017/01/20 01:19:08, Ted C wrote: > Swipe away is a process kill. "Don't keep ...
3 years, 11 months ago (2017-01-20 16:31:32 UTC) #26
fgorski
lgtm
3 years, 11 months ago (2017-01-20 17:11:15 UTC) #27
Ted C
3 years, 11 months ago (2017-01-20 19:27:11 UTC) #28
https://codereview.chromium.org/2639403003/diff/100001/chrome/android/java/sr...
File chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
(right):

https://codereview.chromium.org/2639403003/diff/100001/chrome/android/java/sr...
chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java:522:
public void onDestroyed(Tab tab) {
By the way, this only works because of the organization of ChromeActivity. 
onDestroy on Tab is called when the activity is shutdown regardless of whether
the tab is closed.  It works purely because we unregister this observer before
that happens in ChromeActivity#onDestroy.

onTabClosed is the correct thing to listen to

Just warning you that this might break if anyone adjust this class or moves it
around slightly.

And there is no way the offline page stuff could get access to the model without
ChromeActivity poking it?  We want to avoid adding more stuff to this class to
make it live closer to the end feature.

Powered by Google App Engine
This is Rietveld 408576698