OfflinePageCache caches pages from CCT but not using them later |
||||||||
Issue description- In GSA, search for something and open a landing page. It opens in CCT. - Observe that chrome://offline-internals confirms that page was snapshotted. - Go "back" in GSA so it lands on search results page - enable airplane mode - click on the same search result for the landing page you visited before Expected: see the offline snapshot of the page Observerd: dino page with "Internet is disconnected"
,
Sep 23 2016
tab-ID is invalid for CCTs.
,
Oct 12 2016
,
Oct 13 2016
Hi CCT folks, Is there a way to determine if a tab is a CCT? Bonus points if it's reachable from a TabHelper, but I can plumb what I need through if necessary.
,
Oct 13 2016
,
Oct 14 2016
Hacky way: Tab#getActivity() gives you the activity. From there you can check the type of the returned activity. Note however that this is a package private method, so it might not work for you.
,
Jan 25 2017
,
Jan 26 2017
,
Mar 25 2017
I started working on this because we should not in fact generate OPC/last_n snapshots for custom tabs. Those tabs are generally short lived and even when the same URL is opened twice with CCT, the tab itself is not the same. Saving a snapshot in this situation is a waste of resources as it will immediately be interrupted or deleted upon tab closure. My proposed solution will dynamically detect if a tab is a custom tab and avoid saving snapshots if that's the case. As tabs can be moved between different activities so that a custom tab can suddenly become a "normal" tab, if this happens saving a snapshot is then allowed. User requested snapshots (download offline page) will not be affected.
,
Mar 28 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56 commit 6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56 Author: carlosk <carlosk@chromium.org> Date: Tue Mar 28 23:50:50 2017 Last_n: do not save snapshot of custom tabs. Custom tabs are run almost exactly as regular tabs and last_n was saving snapshots of them when they were being hidden. This is not the right thing to do because these tabs are tabs are generally short lived unless they are transferred into Chrome by the user. This change adds the ability for native code to check if an Android tab is a custom tab and uses this new functionality to avoid saving last_n snapshots if that's the case. BUG= 636048 Review-Url: https://codereview.chromium.org/2773273002 Cr-Commit-Position: refs/heads/master@{#460242} [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTest.java [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/android/javatests/src/org/chromium/chrome/browser/customtabs/CustomTabActivityTestBase.java [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/offline_pages/offline_page_utils.cc [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/offline_pages/offline_page_utils.h [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/offline_pages/recent_tab_helper.cc [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/offline_pages/recent_tab_helper.h [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/offline_pages/recent_tab_helper_unittest.cc [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/tab_android.cc [modify] https://crrev.com/6619bb4ebd6d8a47b7a0a0185d86bc90d7f80f56/chrome/browser/android/tab_android.h
,
Mar 29 2017
I misinterpreted this issue when I took over it. Now I'm re-reading it and it seems to me the original reported issue is deprecated. It seems it assumed that a) We would be snapshotting more than only the last/current page on each tab (N > 1) but right now we settled for only the last/current page (N = 1). And/or that: b) When we come back from a custom tab it is not closed. I confirmed that once we come back to the app from the CCT the tab is indeed closed (observers do get the close event). So I'm marking this as fixed. Please reopen if you think otherwise. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by dewittj@chromium.org
, Sep 23 2016Owner: dewittj@chromium.org