Last_n: do not save snapshots for tabs that are about to be closed |
||||
Issue descriptionLess than 0.5% of tab closures are undone so in these cases we are wasting resources upon listening only to WebContentsObserver::WasHidden. To avoidthat, RecentTabHelper should be notified of Android-specific tab-model notifications of tab closure.
,
Feb 9 2017
,
Feb 11 2017
,
Feb 24 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/d5f450e8a4185ba2e78f76770acc63586f80ad2a commit d5f450e8a4185ba2e78f76770acc63586f80ad2a Author: carlosk <carlosk@chromium.org> Date: Fri Feb 24 18:24:22 2017 RecentTabHelper: adds DVLOG and reload unit test. This change adds many DVLOG entries to RecentTabHelper to help debugging it when needed. This is a debug-build-only change so the added strings should not affect release binary size. The new reload test checks that this kind of navigation is properly handled as a full reload of the page (as opposed to same-page navigations which are "ignored" as loads). BUG= 685791 Review-Url: https://codereview.chromium.org/2713993002 Cr-Commit-Position: refs/heads/master@{#452877} [modify] https://crrev.com/d5f450e8a4185ba2e78f76770acc63586f80ad2a/chrome/browser/android/offline_pages/recent_tab_helper.cc [modify] https://crrev.com/d5f450e8a4185ba2e78f76770acc63586f80ad2a/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc
,
Feb 25 2017
A note on tests: My in-flight CL to resolve this issue already includes a unit test. I'd also like to add an integration/instrumentation test but I'll wait for another CL by dewittj@ [2] to land first as it creates the harness I'd need. [1] https://codereview.chromium.org/2705323006 [2] https://codereview.chromium.org/2655273003
,
Feb 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5 commit f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5 Author: carlosk <carlosk@chromium.org> Date: Tue Feb 28 21:53:06 2017 Last_n: Do not save a snapshot of a closing tab. Listening to the tab being hidden as a signal to save last_n offline snapshots of pages also caused them to be saved for Android tabs that are being closed. For this platform, when a tab is closed it is initially hidden for a few seconds as a grace period for the user to undo the closure. This change monitors tab-will-close signals in Java and dispatches them to the last_n native code so that we can register what's going on and properly ignore the tab hidden event. A test was also added to test this functionality. BUG= 685791 Review-Url: https://codereview.chromium.org/2705323006 Cr-Commit-Position: refs/heads/master@{#453712} [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageBridge.java [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/android/java/src/org/chromium/chrome/browser/offlinepages/OfflinePageUtils.java [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/browser/android/offline_pages/offline_page_bridge.cc [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/browser/android/offline_pages/offline_page_bridge.h [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/browser/android/offline_pages/recent_tab_helper.cc [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/browser/android/offline_pages/recent_tab_helper.h [modify] https://crrev.com/f1d756b8310d09fcd4a3e7ab751c4e184c84d5b5/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc
,
Feb 28 2017
Main change landed with the unit test so I'll mark this as fixed. I am currently working on an instrumentation test too but I don't think it's a blocker for this to be maker as such.
,
Mar 1 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c8f0e4eb516b29f1e871f7fb80f5ffc7a541e81c commit c8f0e4eb516b29f1e871f7fb80f5ffc7a541e81c Author: carlosk <carlosk@chromium.org> Date: Wed Mar 01 20:30:49 2017 Last_n: Add instrumentation test for the tab closure case. The existing unit test for making sure that tabs being closed do not generate last_n snapshots is somewhat artificial because the test itself guarantees proper ordering. Having this instrumentation (integration) level test is a more complete way of testing this code is actually doing what's supposed and that its expectations of observer method calling order are correct. BUG= 685791 Review-Url: https://codereview.chromium.org/2721253002 Cr-Commit-Position: refs/heads/master@{#454021} [modify] https://crrev.com/c8f0e4eb516b29f1e871f7fb80f5ffc7a541e81c/chrome/android/javatests/src/org/chromium/chrome/browser/offlinepages/RecentTabsTest.java [modify] https://crrev.com/c8f0e4eb516b29f1e871f7fb80f5ffc7a541e81c/chrome/browser/android/offline_pages/recent_tab_helper.cc |
||||
►
Sign in to add a comment |
||||
Comment 1 by chili@chromium.org
, Feb 7 2017