New issue
Advanced search Search tips

Issue 775644 link

Starred by 14 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 863243



Sign in to add a comment

Proactive tab discarding and TabManager refactor

Project Member Reported by fdoray@chromium.org, Oct 17 2017

Issue description

Design doc: https://docs.google.com/a/google.com/document/d/1EBDGRjrmPVnfZSmXfEJAHn1vil8XoAcS6vRw5g9GZIc/edit?usp=sharing

The goals of this project are:
- bring all tab lifecycle management code in one place
- allow proactive tab discarding (vs. discarding only under memory pressure) (see discussion)
- facilitate the addition of new tab states

 
Showing comments 8 - 107 of 107 Older
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/414d24f7f85dd165674e4ab0c861b7d32971495f

commit 414d24f7f85dd165674e4ab0c861b7d32971495f
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Nov 21 22:03:17 2017

Add resource_coordinator::TabLifecycleUnit.

A TabLifecycleUnit represents a tab.

The implementation will be in a separate class (TabLifecyleUnitImpl)
because we want to expose only part of the it outside of
chrome/browser/resource_coordinator/.

E.g. the extensions system is allowed call:

TabLifecycleUnit::FromWebContents(contents)->Discard(condition);

but we don't want it to change the TabStripModel associated with
a tab (TabLifecycleUnitImpl::set_tab_strip_model()).

Bug: 775644
Change-Id: Idf2ad85bf2969871be1dc09eb1eb3776bc922959
Reviewed-on: https://chromium-review.googlesource.com/774979
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518410}
[modify] https://crrev.com/414d24f7f85dd165674e4ab0c861b7d32971495f/chrome/browser/BUILD.gn
[add] https://crrev.com/414d24f7f85dd165674e4ab0c861b7d32971495f/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[add] https://crrev.com/414d24f7f85dd165674e4ab0c861b7d32971495f/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[add] https://crrev.com/414d24f7f85dd165674e4ab0c861b7d32971495f/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/414d24f7f85dd165674e4ab0c861b7d32971495f/chrome/test/BUILD.gn

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 21 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8c26d7032704a5d05184f3e4f0d16eb4ed595a23

commit 8c26d7032704a5d05184f3e4f0d16eb4ed595a23
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Nov 21 22:58:44 2017

Do not record engagement score when discarding/reloading a tab.

Analysis showed that MRU was as good as engagement score to choose
which tabs to discard. The new plan is to build a machine learning
model to choose which tabs to discard.

Bug: 775644
Change-Id: If85f0911d158201190bcb15f4b865c644c6426b4
Reviewed-on: https://chromium-review.googlesource.com/779081
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518426}
[modify] https://crrev.com/8c26d7032704a5d05184f3e4f0d16eb4ed595a23/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc
[modify] https://crrev.com/8c26d7032704a5d05184f3e4f0d16eb4ed595a23/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h
[modify] https://crrev.com/8c26d7032704a5d05184f3e4f0d16eb4ed595a23/tools/metrics/histograms/histograms.xml

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f74c4ebdabcfb1271337ae5cda7f017072174e95

commit f74c4ebdabcfb1271337ae5cda7f017072174e95
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Nov 22 16:20:53 2017

Record discard histograms from helper functions.

This CL does not change behavior.

The main purpose of this CL is to reduce the size of future refactoring
CLs. It also improves code readbility by moving metrics-related code
to its own file.

Bug: 775644
Change-Id: I2d732836c0a7135ded72b4a124a2c8c4c3dd6776
Reviewed-on: https://chromium-review.googlesource.com/779479
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518649}
[modify] https://crrev.com/f74c4ebdabcfb1271337ae5cda7f017072174e95/chrome/browser/BUILD.gn
[add] https://crrev.com/f74c4ebdabcfb1271337ae5cda7f017072174e95/chrome/browser/resource_coordinator/discard_metrics_util.cc
[add] https://crrev.com/f74c4ebdabcfb1271337ae5cda7f017072174e95/chrome/browser/resource_coordinator/discard_metrics_util.h
[modify] https://crrev.com/f74c4ebdabcfb1271337ae5cda7f017072174e95/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc
[modify] https://crrev.com/f74c4ebdabcfb1271337ae5cda7f017072174e95/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fa889c1d00c0f368c5fc3325f22a39e65ae70be3

commit fa889c1d00c0f368c5fc3325f22a39e65ae70be3
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Nov 22 18:07:13 2017

Remove histogram MultiProfile.DiscardedTabsPerUser.

Analysis confirms that the number of discards increases with the number
of logged in users. No action will be taken based on this information.

Analysis: https://docs.google.com/a/google.com/spreadsheets/d/1WQeoTSDXBQ_89RyNU9g63ha6KcqnLIfyypejUldgBpQ/edit?usp=sharing

Note: Multi-profile on ChromeOS is very similar to multi-profile on
other platforms. The differences are that the "user-switcher" is in
the bottom-right corner of the screen rather than in the top-left
corner of every browser window, and that switching users hides all
windows that belong to other users.

Bug: 775644
Change-Id: Ic342d6b2d6b96dd0d795f90fb73330a626878f8d
Reviewed-on: https://chromium-review.googlesource.com/779561
Reviewed-by: Dan Erat <derat@chromium.org>
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518681}
[modify] https://crrev.com/fa889c1d00c0f368c5fc3325f22a39e65ae70be3/ash/multi_profile_uma.cc
[modify] https://crrev.com/fa889c1d00c0f368c5fc3325f22a39e65ae70be3/ash/multi_profile_uma.h
[modify] https://crrev.com/fa889c1d00c0f368c5fc3325f22a39e65ae70be3/chrome/browser/resource_coordinator/DEPS
[modify] https://crrev.com/fa889c1d00c0f368c5fc3325f22a39e65ae70be3/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/fa889c1d00c0f368c5fc3325f22a39e65ae70be3/tools/metrics/histograms/histograms.xml

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 22 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e

commit e878d9f86ea03b8af7ac92f00b1b553e3f3a392e
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Nov 22 20:02:32 2017

Rename TabLifetimeObserver to TabLifecycleObserver.

We decided to use the term "lifecycle" instead of "lifetime".

TBR=reillyg@chromium.org

Bug: 775644
Change-Id: Ic4401ebd52ab8dadf04248bb21bef143542902a7
Reviewed-on: https://chromium-review.googlesource.com/785830
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#518720}
[modify] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/browser/BUILD.gn
[modify] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/browser/extensions/api/tabs/tabs_event_router.h
[rename] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/browser/resource_coordinator/tab_lifecycle_observer.h
[rename] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc
[delete] https://crrev.com/ca7e23d9582122ab29c3dce72b507ee07dbee7e1/chrome/browser/resource_coordinator/tab_lifetime_observer.cc
[modify] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/e878d9f86ea03b8af7ac92f00b1b553e3f3a392e/chrome/test/BUILD.gn

Project Member

Comment 13 by bugdroid1@chromium.org, Nov 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3f6722ad807320d7ba5652f54471f3ab27b27ff2

commit 3f6722ad807320d7ba5652f54471f3ab27b27ff2
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Nov 24 20:03:51 2017

Add resource_coordinator::LifecycleUnitSourceObserver.

LifecycleUnitSourceObserver is an interface to be notified when LifecycleUnits
are created and destroyed. This interface will be implemented by TabManager (to
be renamed to LifecycleManager).

For LifecycleUnit discarding, TabManager could have polled information about
LifecycleUnits when needed instead of receiving notifications via a
LifecycleUnitSourceObserver interface. However, once background tab loading
starts using LifecycleUnits, TabManager will have to react to some LifecycleUnit
events (e.g. start loading another LifecycleUnit when a LifecycleUnit finishes
to load). We prefer having the push interface right away.

Bug: 775644
Change-Id: I943452b2b903fc012084618805b17d1fd82ab73c
Reviewed-on: https://chromium-review.googlesource.com/779744
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519156}
[modify] https://crrev.com/3f6722ad807320d7ba5652f54471f3ab27b27ff2/chrome/browser/BUILD.gn
[add] https://crrev.com/3f6722ad807320d7ba5652f54471f3ab27b27ff2/chrome/browser/resource_coordinator/lifecycle_unit_source_observer.h

Project Member

Comment 14 by bugdroid1@chromium.org, Nov 27 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/52f61af9e786463520e08bde925dd0b920458c45

commit 52f61af9e786463520e08bde925dd0b920458c45
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Nov 27 17:48:06 2017

Add resource_coordinator::DiscardReason::kExternal.

This CL:
- Renames DiscardCondition -> DiscardReason.
- Adds DiscardCondition::kExternal.

Having DiscardReason::kExternal allows us to have separate
histograms for discards that are proactive/urgent/external.

Bug: 775644
Change-Id: Ifd59903156be25a3731e59c35e39f3fab562dce2
Reviewed-on: https://chromium-review.googlesource.com/785870
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#519332}
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/BUILD.gn
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/memory/chrome_memory_coordinator_delegate.cc
[delete] https://crrev.com/41685df6c4bc45f2170f7ae651198956ea24ee7c/chrome/browser/resource_coordinator/discard_condition.h
[add] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/discard_reason.h
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/52f61af9e786463520e08bde925dd0b920458c45/chrome/browser/ui/webui/discards/discards_ui.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Dec 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74aed422d757a4297a767faed82ca4ec05b678be

commit 74aed422d757a4297a767faed82ca4ec05b678be
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Dec 04 16:09:09 2017

Rename TabLifecycleUnit to TabLifecycleUnitExternal.

With this CL, TabLifecycleUnit is renamed to TabLifecycleUnitExternal
and it no longer inherits from LifecycleUnit. The name
"TabLifecycleUnitExternal" makes it clear that this interface is
exposed outside of chrome/browser/resource_coordinator/, and not
inheriting from LifecycleUnit restricts what's available outside
of chrome/browser/resource_coordinator/.

Also, this CL removes TabLifecycleUnitHolder.
TabLifecycleUnitExternal::FromWebContents will be implemented by
a map lookup in TabLifecycleUnitSource.

Bug: 775644
Change-Id: Ia8fa3b3a8c7f1d4289fc15f3f4d983192dda4db6
Reviewed-on: https://chromium-review.googlesource.com/788271
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521352}
[modify] https://crrev.com/74aed422d757a4297a767faed82ca4ec05b678be/chrome/browser/BUILD.gn
[delete] https://crrev.com/da79010c3d67fe39905152902f045ff5d3788ae5/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[delete] https://crrev.com/da79010c3d67fe39905152902f045ff5d3788ae5/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[add] https://crrev.com/74aed422d757a4297a767faed82ca4ec05b678be/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc
[add] https://crrev.com/74aed422d757a4297a767faed82ca4ec05b678be/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[delete] https://crrev.com/da79010c3d67fe39905152902f045ff5d3788ae5/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/74aed422d757a4297a767faed82ca4ec05b678be/chrome/test/BUILD.gn

Project Member

Comment 16 by bugdroid1@chromium.org, Dec 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4f1a76719f0bb8a2dd7fd14223746bf1ac5d60d3

commit 4f1a76719f0bb8a2dd7fd14223746bf1ac5d60d3
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Dec 04 16:32:43 2017

Add resource_coordinator::LifecycleUnit::GetID().

This method returns a unique id representing the LifecycleUnit. It
is required to support the chrome://discards/ page.

Bug: 775644
Change-Id: I5975e625337708cc57beca0a5d551e6352c51b6a
Reviewed-on: https://chromium-review.googlesource.com/789250
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521363}
[modify] https://crrev.com/4f1a76719f0bb8a2dd7fd14223746bf1ac5d60d3/chrome/browser/resource_coordinator/lifecycle_unit.cc
[modify] https://crrev.com/4f1a76719f0bb8a2dd7fd14223746bf1ac5d60d3/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/4f1a76719f0bb8a2dd7fd14223746bf1ac5d60d3/chrome/browser/resource_coordinator/lifecycle_unit_unittest.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Dec 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/113e9e022f1cdb5fe2499bc8a71bedb5ff16ea40

commit 113e9e022f1cdb5fe2499bc8a71bedb5ff16ea40
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Dec 04 16:49:54 2017

Deprecate the LowMemoryMargin histogram suffix.

LowMemoryMargin is a per-platform constant. There is no need to have
a LowMemoryMargin suffix on histograms. This suffix should have been
deprecated in 2013 https://chromiumcodereview.appspot.com/13993008

Bug: 775644
Change-Id: I2a809be0dadf3351d7a2f37efe981ac304cd8cdf
Reviewed-on: https://chromium-review.googlesource.com/806357
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521366}
[modify] https://crrev.com/113e9e022f1cdb5fe2499bc8a71bedb5ff16ea40/tools/metrics/histograms/histograms.xml

Project Member

Comment 18 by bugdroid1@chromium.org, Dec 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/051451fbdf972202ab33ee339ab2315d84c8f0f3

commit 051451fbdf972202ab33ee339ab2315d84c8f0f3
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Dec 04 18:17:46 2017

Record histograms when an urgent discard request is received.

This CL removes the following histograms which were recorded before
each individual tab discard:
- Tabs.Discard.TabCount
- Tabs.Discard.InitialTime2
- Tabs.Discard.IntervalTime2

And replaces them with histograms recorded when an urgent discard
request is received, before any tab is discarded:
- Discarding.Urgent.NumAliveTabs
- Discarding.Urgent.TimeSinceStartup
- Discarding.Urgent.TimeSinceLastUrgent

Also, metrics::RecordMemoryStats() is called when an urgent discard
request is received rather than before each individual tab discard.

The reason for this change is that we are interested in knowing
how often urgent discard requests occur and what leads to them. We
don't care how often we proactively discard tabs and we don't
need multiple histogram samples when we discard multiple tabs in
response to a single discard request.

Bug: 775644
Change-Id: Ic603a904dc9635b12b3204c1e12bc293c4dcbaf7
Reviewed-on: https://chromium-review.googlesource.com/786295
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521389}
[modify] https://crrev.com/051451fbdf972202ab33ee339ab2315d84c8f0f3/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/051451fbdf972202ab33ee339ab2315d84c8f0f3/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/051451fbdf972202ab33ee339ab2315d84c8f0f3/chrome/browser/resource_coordinator/tab_manager_stats_collector.cc
[modify] https://crrev.com/051451fbdf972202ab33ee339ab2315d84c8f0f3/chrome/browser/resource_coordinator/tab_manager_stats_collector.h
[modify] https://crrev.com/051451fbdf972202ab33ee339ab2315d84c8f0f3/tools/metrics/histograms/histograms.xml

Project Member

Comment 19 by bugdroid1@chromium.org, Dec 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b208d41718d43f5b581454da2ab4e785641cbcd0

commit b208d41718d43f5b581454da2ab4e785641cbcd0
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Dec 07 19:15:45 2017

Add resource_coordinator::LifecycleUnitSource.

This is the interface for any class that creates and destroys
LifecycleUnits.

Bug: 775644
Change-Id: I500480492f80456788a903ed98ac71327b87d02b
Reviewed-on: https://chromium-review.googlesource.com/812167
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522500}
[modify] https://crrev.com/b208d41718d43f5b581454da2ab4e785641cbcd0/chrome/browser/BUILD.gn
[add] https://crrev.com/b208d41718d43f5b581454da2ab4e785641cbcd0/chrome/browser/resource_coordinator/lifecycle_unit_source.h

Project Member

Comment 20 by bugdroid1@chromium.org, Dec 7 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/67a9cc897e522719d5ba0e932cb967baecbc1bb2

commit 67a9cc897e522719d5ba0e932cb967baecbc1bb2
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Dec 07 20:36:48 2017

Add resource_coordinator::LifecycleUnitSourceBase.

This is the base class for any class that creates and destoys
LifecycleUnits.

Bug: 775644
Change-Id: I6dce462832d7043af2df67f5caa4812968b44ce5
Reviewed-on: https://chromium-review.googlesource.com/806684
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#522536}
[modify] https://crrev.com/67a9cc897e522719d5ba0e932cb967baecbc1bb2/chrome/browser/BUILD.gn
[add] https://crrev.com/67a9cc897e522719d5ba0e932cb967baecbc1bb2/chrome/browser/resource_coordinator/lifecycle_unit_source_base.cc
[add] https://crrev.com/67a9cc897e522719d5ba0e932cb967baecbc1bb2/chrome/browser/resource_coordinator/lifecycle_unit_source_base.h

Project Member

Comment 21 by bugdroid1@chromium.org, Dec 7 2017

Project Member

Comment 22 by bugdroid1@chromium.org, Dec 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4d08cfa67aad92e4a07320b5a8009431d2853849

commit 4d08cfa67aad92e4a07320b5a8009431d2853849
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Dec 13 19:22:29 2017

Add resource_coordinator::TabLifecycleUnitSource.

Creates / destroys TabLifecycleUnits and notifies observers as tabs are
created / destroyed.

Bug: 775644
Change-Id: I8042e656c2672dbc71ad0187c151140a098f1356
Reviewed-on: https://chromium-review.googlesource.com/789410
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523844}
[modify] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/BUILD.gn
[modify] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[add] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[add] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[add] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/4d08cfa67aad92e4a07320b5a8009431d2853849/chrome/test/BUILD.gn

Project Member

Comment 23 by bugdroid1@chromium.org, Dec 13 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d131a9e7f1c1cc702cbf52ce5516d5b575436cc6

commit d131a9e7f1c1cc702cbf52ce5516d5b575436cc6
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Dec 13 20:38:48 2017

Add TabLifecyleUnitSource::GetTabLifecycleUnitExternal().

Returns the TabLifecycleUnitExternal instance associated with a
WebContents, or nullptr if the WebContents isn't associated with a tab.

Bug: 775644
Change-Id: I1d6af79be2e7a36de289dd318cc44e6d1ffa9678
Reviewed-on: https://chromium-review.googlesource.com/789433
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523864}
[modify] https://crrev.com/d131a9e7f1c1cc702cbf52ce5516d5b575436cc6/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc
[modify] https://crrev.com/d131a9e7f1c1cc702cbf52ce5516d5b575436cc6/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/d131a9e7f1c1cc702cbf52ce5516d5b575436cc6/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/d131a9e7f1c1cc702cbf52ce5516d5b575436cc6/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc

Project Member

Comment 25 by bugdroid1@chromium.org, Dec 14 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c06b3100ef687c18a92b9961e716189ced4a65a2

commit c06b3100ef687c18a92b9961e716189ced4a65a2
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Dec 14 14:52:42 2017

Add resource_coordinator::TabManagerTest::tab_manager_.

Having a single TabManager initialization path in TabManagerTest
will simplify adding common initialization code in an upcoming CL.

Bug: 775644
Change-Id: Icb648e1591127a1a5f4acf847208cd53e2dfb278
Reviewed-on: https://chromium-review.googlesource.com/820201
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#524065}
[modify] https://crrev.com/c06b3100ef687c18a92b9961e716189ced4a65a2/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 26 by bugdroid1@chromium.org, Jan 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d033ec2779ec5d8a068047f3e2b2057b39d126e0

commit d033ec2779ec5d8a068047f3e2b2057b39d126e0
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Jan 08 16:49:54 2018

Remove is app, is internal, is pinned from chrome://discards.

These values won't be used anymore to decide which tabs to discard
once we start using LifecycleUnits.

Bug: 775644
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ic39531c20f6bb406319b1d7a910326e362544996
Reviewed-on: https://chromium-review.googlesource.com/847972
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Greg Kerr <kerrnel@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527648}
[modify] https://crrev.com/d033ec2779ec5d8a068047f3e2b2057b39d126e0/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/d033ec2779ec5d8a068047f3e2b2057b39d126e0/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/d033ec2779ec5d8a068047f3e2b2057b39d126e0/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/d033ec2779ec5d8a068047f3e2b2057b39d126e0/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/d033ec2779ec5d8a068047f3e2b2057b39d126e0/chrome/test/data/webui/discards/discards_browsertest.js

Project Member

Comment 27 by bugdroid1@chromium.org, Jan 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2468b2a40058a5fb5680c2cb06bde6232c167979

commit 2468b2a40058a5fb5680c2cb06bde6232c167979
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Jan 08 19:06:13 2018

Add TabLifecycleUnitExternal::IsMediaTab/GetDiscardCount.

These methods will be used to feed chrome://discards.

Bug: 775644
Change-Id: I55330e8cba6292e0e2bc36f4bafec2287e0e9db7
Reviewed-on: https://chromium-review.googlesource.com/848072
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#527694}
[modify] https://crrev.com/2468b2a40058a5fb5680c2cb06bde6232c167979/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/2468b2a40058a5fb5680c2cb06bde6232c167979/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/2468b2a40058a5fb5680c2cb06bde6232c167979/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h

Project Member

Comment 28 by bugdroid1@chromium.org, Jan 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b264631c0864edec4a36028b94b11373b44d81b

commit 9b264631c0864edec4a36028b94b11373b44d81b
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jan 09 21:37:51 2018

Remove unused resource_coordinator includes from about_ui.cc.

Should have been done as part of
https://chromium-review.googlesource.com/761996

Bug: 775644
Change-Id: I212c707e337c2f39cb50741afaf69b2bece13a37
Reviewed-on: https://chromium-review.googlesource.com/854952
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528119}
[modify] https://crrev.com/9b264631c0864edec4a36028b94b11373b44d81b/chrome/browser/ui/webui/about_ui.cc

Project Member

Comment 29 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/42442ac4ff453ccf842349ac514ff5162e29e0dd

commit 42442ac4ff453ccf842349ac514ff5162e29e0dd
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jan 10 16:12:06 2018

Use int32_t for LifecycleUnit::id_.

The goal is to match the type of |id| in discards.mojom:TabDiscardsInfo.

Bug: 775644
Change-Id: I04f15f646ab3ee2aeeace198b90fc8a80477b57a
Reviewed-on: https://chromium-review.googlesource.com/854983
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528332}
[modify] https://crrev.com/42442ac4ff453ccf842349ac514ff5162e29e0dd/chrome/browser/resource_coordinator/lifecycle_unit.cc
[modify] https://crrev.com/42442ac4ff453ccf842349ac514ff5162e29e0dd/chrome/browser/resource_coordinator/lifecycle_unit.h

Project Member

Comment 30 by bugdroid1@chromium.org, Jan 10 2018

Project Member

Comment 31 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6fe1de9caab70c43efd4e6f78f887d97f4500c68

commit 6fe1de9caab70c43efd4e6f78f887d97f4500c68
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jan 10 17:38:16 2018

Return a bool from TabLifecycleUnitExternal::DiscardTab.

This will be required to indicate whether the discard was
successful when the tab discard extension API is invoked
https://cs.chromium.org/chromium/src/chrome/browser/extensions/api/tabs/tabs_api.cc?l=2177&rcl=74f642e40765e20497219a27725fb31802f9db9a

Bug: 775644
Change-Id: I885f7a7078e333bf5112a56c2c18ada6c544e7e2
Reviewed-on: https://chromium-review.googlesource.com/854618
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528348}
[modify] https://crrev.com/6fe1de9caab70c43efd4e6f78f887d97f4500c68/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/6fe1de9caab70c43efd4e6f78f887d97f4500c68/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/6fe1de9caab70c43efd4e6f78f887d97f4500c68/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h

Project Member

Comment 32 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f9e4b4748ee1b8d4bb451ec1115e101edca7e017

commit f9e4b4748ee1b8d4bb451ec1115e101edca7e017
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jan 10 18:35:42 2018

Do not protect a tab that was never audible when it becomes non-audible.

Do not protect a tab when TabLifecycleUnit::SetRecentlyAudible(false)
but TabLifecycleUnit::SetRecentlyAudible(true) was never called.

There are spurious calls to TabLifecycleUnit::SetRecentlyAudible(false)
when a tab is created.

Bug: 775644
Change-Id: I06c3567ca28a55ac40e522768c5184d465264160
Reviewed-on: https://chromium-review.googlesource.com/855098
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528365}
[modify] https://crrev.com/f9e4b4748ee1b8d4bb451ec1115e101edca7e017/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/f9e4b4748ee1b8d4bb451ec1115e101edca7e017/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc

Project Member

Comment 33 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4c52579f63f63577695cd447296ceb9de57773a1

commit 4c52579f63f63577695cd447296ceb9de57773a1
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jan 10 20:15:50 2018

Protect recently opened background tabs in TabLifecycleUnit.

Today, TabManager::CanDiscardTab protects recently focused and recently
opened tabs (even if they were never focused) while
TabLifecycleUnit::CanDiscard only protects recently focused tabs.

To avoid changing multiple tests when we start using LifecycleUnits
in TabManager, this CL changes the behavior of
TabLifecycleUnit::CanDiscard to match the behavior of
TabManager::CanDiscardTab.

We'll reevaluate the possibility of not protecting tabs that have
never been focused in a separate CL.

Bug: 775644
Change-Id: I246db8525058331273a3a33cff97f45b31f2688e
Reviewed-on: https://chromium-review.googlesource.com/854782
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528405}
[modify] https://crrev.com/4c52579f63f63577695cd447296ceb9de57773a1/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/4c52579f63f63577695cd447296ceb9de57773a1/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/4c52579f63f63577695cd447296ceb9de57773a1/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/4c52579f63f63577695cd447296ceb9de57773a1/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc

Project Member

Comment 34 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5e2521fc0186ff24baa00c53935239b74213840f

commit 5e2521fc0186ff24baa00c53935239b74213840f
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jan 10 20:36:18 2018

Add LifecycleUnitObserver.

This interface will be used for metrics reporting.

Bug: 775644
Change-Id: I16b68850801e8dab2edaa351a8983705e9b38753
Reviewed-on: https://chromium-review.googlesource.com/857342
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528411}
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/BUILD.gn
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit.cc
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit.h
[add] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[add] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[add] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[add] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit_observer.h
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/lifecycle_unit_unittest.cc
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/5e2521fc0186ff24baa00c53935239b74213840f/chrome/test/BUILD.gn

Project Member

Comment 35 by bugdroid1@chromium.org, Jan 10 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a4b69f72f6f68ee747fc42a99c4a37a9e1a3bff1

commit a4b69f72f6f68ee747fc42a99c4a37a9e1a3bff1
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jan 10 21:01:36 2018

Add TabLifecycleUnitSourceTest.Discard.

The purpose of this test is to verify that
WebContents::GetLastActiveTime() is preserved when a tab is discarded.

Bug: 775644
Change-Id: I6410b05eec08bc3418e35d1fc17c59cc86244330
Reviewed-on: https://chromium-review.googlesource.com/857577
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528420}
[modify] https://crrev.com/a4b69f72f6f68ee747fc42a99c4a37a9e1a3bff1/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc

Project Member

Comment 36 by bugdroid1@chromium.org, Jan 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f4e2a53fc0fa3c8090ae180f9947d42e175448e6

commit f4e2a53fc0fa3c8090ae180f9947d42e175448e6
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Jan 11 20:12:16 2018

Add DiscardMetricsLifecycleUnitObserver.

This observer is attached to every TabLifecycleUnit. It records
discard-related histograms.

Bug: 775644
Change-Id: I90429100783eb5f8a427ef40c6b3f2853630583b
Reviewed-on: https://chromium-review.googlesource.com/857317
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#528727}
[modify] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/browser/BUILD.gn
[add] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[add] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[add] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/f4e2a53fc0fa3c8090ae180f9947d42e175448e6/chrome/test/BUILD.gn

Project Member

Comment 37 by bugdroid1@chromium.org, Mar 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/69feeeb961bfd9ad599d6a4c04433be9c7a8435c

commit 69feeeb961bfd9ad599d6a4c04433be9c7a8435c
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Mar 01 20:15:46 2018

Use LifecycleUnits for tab discarding.

TabManager discards tabs, but also ARC processes.
LifecycleUnit is an abstraction to help us having one
code path for all discards.

Bug: 775644
Change-Id: I4d2e89a710afe097cc2d6222a6c156f57c774144
Reviewed-on: https://chromium-review.googlesource.com/842306
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540266}
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/BUILD.gn
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/browser_process_impl.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/browser_process_impl.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/extensions/api/tabs/tabs_test.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[delete] https://crrev.com/899988fb61f1cf591b933d71d27e938303eeed1e/chrome/browser/resource_coordinator/discard_metrics_util.cc
[delete] https://crrev.com/899988fb61f1cf591b933d71d27e938303eeed1e/chrome/browser/resource_coordinator/discard_metrics_util.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[delete] https://crrev.com/899988fb61f1cf591b933d71d27e938303eeed1e/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/resource_coordinator/tab_manager_web_contents_data_unittest.cc
[delete] https://crrev.com/899988fb61f1cf591b933d71d27e938303eeed1e/chrome/browser/resource_coordinator/tab_stats.cc
[delete] https://crrev.com/899988fb61f1cf591b933d71d27e938303eeed1e/chrome/browser/resource_coordinator/tab_stats.h
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/test/BUILD.gn
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/test/base/chrome_unit_test_suite.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/test/base/testing_browser_process.cc
[modify] https://crrev.com/69feeeb961bfd9ad599d6a4c04433be9c7a8435c/chrome/test/base/testing_browser_process.h

Project Member

Comment 40 by bugdroid1@chromium.org, Mar 30 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fbb0bdb57b55415b343ee6b5c5f6f93964c6a2d7

commit fbb0bdb57b55415b343ee6b5c5f6f93964c6a2d7
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Mar 30 11:21:50 2018

Tie the lifetime of a TabLifecycleUnit to the lifetime of a WebContents.

Previously, TabLifecycleUnits were destroyed from
TabStripModelObserver::TabClosingAt(). If a tab was detached
(TabStripModel::DetachWebContentsAt) and its WebContents destroyed,
the TabLifecycleUnit was never destroyed.

This CL solves that issue by giving ownership of a TabLifecycleUnit
to a WebContentsUserData whose lifetime is tied to the lifetime of
a WebContents.

Bug: 818454, 775644
Change-Id: Ie8f50b29beb4a5f1ca228a354d04ce1be82cb49e
Reviewed-on: https://chromium-review.googlesource.com/980587
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547140}
[modify] https://crrev.com/fbb0bdb57b55415b343ee6b5c5f6f93964c6a2d7/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/fbb0bdb57b55415b343ee6b5c5f6f93964c6a2d7/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/fbb0bdb57b55415b343ee6b5c5f6f93964c6a2d7/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc

Project Member

Comment 42 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f57250877e2eefe4887699bc5e9d8ff9061b8398

commit f57250877e2eefe4887699bc5e9d8ff9061b8398
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Apr 03 15:21:42 2018

Add LifecycleUnit::Freeze().

A frozen LifecycleUnit can't use the CPU.

Note: This feature will  be test by a browser test in
https://chromium-review.googlesource.com/c/chromium/src/+/980742/5/chrome/browser/resource_coordinator/tab_manager_browsertest.cc#814

Bug: 775644
Change-Id: I5b5aac616e7a5d28b61f379d841da2b75420300d
Reviewed-on: https://chromium-review.googlesource.com/981396
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547714}
[modify] https://crrev.com/f57250877e2eefe4887699bc5e9d8ff9061b8398/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/f57250877e2eefe4887699bc5e9d8ff9061b8398/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/f57250877e2eefe4887699bc5e9d8ff9061b8398/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/f57250877e2eefe4887699bc5e9d8ff9061b8398/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/f57250877e2eefe4887699bc5e9d8ff9061b8398/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/f57250877e2eefe4887699bc5e9d8ff9061b8398/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h

Project Member

Comment 43 by bugdroid1@chromium.org, Apr 3 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a271a5c03ac21d19725c214898ff3c4e8f555eec

commit a271a5c03ac21d19725c214898ff3c4e8f555eec
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Apr 03 18:37:11 2018

Use LifecycleUnits for tab discarding (reland).

This CL previously landed as
https://chromium-review.googlesource.com/c/chromium/src/+/842306
It was reverted because TabLifecycleUnits were not always
destroyed when tabs were closed, which caused invalid memory
accesses. This was solved by
https://chromium-review.googlesource.com/c/chromium/src/+/980587

TabManager discards tabs, but also ARC processes.
LifecycleUnit is an abstraction to help us having one
code path for all discards.

TBR=chrisha@chromium.org,thestig@chromium.org

Bug: 775644
Change-Id: Ib7f3dfd8b7e9b43ad75020c65e12d94229ba1a07
Reviewed-on: https://chromium-review.googlesource.com/980742
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547769}
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/BUILD.gn
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/browser_process_impl.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/browser_process_impl.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/extensions/api/tabs/tabs_test.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[delete] https://crrev.com/3d4203128ed1dbcd991528ad05ddd2185a3bbb05/chrome/browser/resource_coordinator/discard_metrics_util.cc
[delete] https://crrev.com/3d4203128ed1dbcd991528ad05ddd2185a3bbb05/chrome/browser/resource_coordinator/discard_metrics_util.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[delete] https://crrev.com/3d4203128ed1dbcd991528ad05ddd2185a3bbb05/chrome/browser/resource_coordinator/tab_lifecycle_observer_browsertest.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_web_contents_data.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_web_contents_data.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/resource_coordinator/tab_manager_web_contents_data_unittest.cc
[delete] https://crrev.com/3d4203128ed1dbcd991528ad05ddd2185a3bbb05/chrome/browser/resource_coordinator/tab_stats.cc
[delete] https://crrev.com/3d4203128ed1dbcd991528ad05ddd2185a3bbb05/chrome/browser/resource_coordinator/tab_stats.h
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/test/BUILD.gn
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/test/base/chrome_unit_test_suite.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/test/base/testing_browser_process.cc
[modify] https://crrev.com/a271a5c03ac21d19725c214898ff3c4e8f555eec/chrome/test/base/testing_browser_process.h

Project Member

Comment 44 by bugdroid1@chromium.org, Apr 5 2018

Project Member

Comment 45 by bugdroid1@chromium.org, Apr 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1

commit 77be021f2e9c765e9dea84b2ff97f9ff421bb0b1
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Apr 05 14:26:26 2018

Remove TabManager::IsTabDiscarded/IsTabAutoDiscardable.

These properties are available on TabLifecycleUnitExternal, which
is intended for use outside of
chrome/browser/resource_coordinator/.

Bug: 775644
Change-Id: I5708c3be32806c0109ad04ece1fffaa5f1f0709f
Reviewed-on: https://chromium-review.googlesource.com/858046
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548414}
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/extensions/api/tabs/tabs_api.cc
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/extensions/api/tabs/tabs_test.cc
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/extensions/extension_tab_util.cc
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/77be021f2e9c765e9dea84b2ff97f9ff421bb0b1/chrome/browser/resource_coordinator/tab_metrics_logger.cc

Project Member

Comment 46 by bugdroid1@chromium.org, Apr 6 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/82b06e01667e7a0136ae23091e49c5da2bca37f8

commit 82b06e01667e7a0136ae23091e49c5da2bca37f8
Author: Varun Mohan <varunmohan@google.com>
Date: Fri Apr 06 19:09:53 2018

Adding num_loaded_lifecycle_units_ to TabManager

This will be used in the aggressive tab discarding experiment to determine what threshold the TabManager is currently in.

Bug: 775644
Change-Id: I05700fce6cf7a7b0379ec84f43e91bb67373becb
Reviewed-on: https://chromium-review.googlesource.com/993978
Commit-Queue: Varun Mohan <varunmohan@google.com>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548884}
[modify] https://crrev.com/82b06e01667e7a0136ae23091e49c5da2bca37f8/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/82b06e01667e7a0136ae23091e49c5da2bca37f8/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/82b06e01667e7a0136ae23091e49c5da2bca37f8/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/82b06e01667e7a0136ae23091e49c5da2bca37f8/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 47 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b6279a73c91fbe5427936a9a992902be280f94aa

commit b6279a73c91fbe5427936a9a992902be280f94aa
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Apr 12 19:42:59 2018

Expose LifecycleUnit visibility in chrome://discards.

This is useful to debug occlusion tracking issues and to get a
better understanding of which tabs might be discarded.

Bug: 775644
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I1ad43559a96eb758d3a7796186930d6a7ffa4b39
Reviewed-on: https://chromium-review.googlesource.com/993702
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550316}
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/test/data/webui/discards/discards_browsertest.js

Project Member

Comment 48 by bugdroid1@chromium.org, Apr 12 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/69126442dc1453c7723fe8a7dfc0cd04da1df0e0

commit 69126442dc1453c7723fe8a7dfc0cd04da1df0e0
Author: Varun Mohan <varunmohan@google.com>
Date: Thu Apr 12 21:31:54 2018

Remove discard protection for tabs that were recently in focus

In the past, there was a 10 minute protection from discarding for tabs that went out of focus. With the move to add proactive discarding, this logic is no longer necessary. This is because the proactive discarding logic will handle the timing. A user visible effect of this CL is that when they are under memory pressure, their tabs can be discarded as soon as they become non-visible.

Bug: 775644
Change-Id: I9a2fd8159093fbd0ceb7018246d9d6c002383e0d
Reviewed-on: https://chromium-review.googlesource.com/1008243
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Varun Mohan <varunmohan@google.com>
Cr-Commit-Position: refs/heads/master@{#550367}
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/extensions/api/tabs/tabs_test.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 49 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1aef3d916dc081b4945c0670d09d9e7eb7d9f76f

commit 1aef3d916dc081b4945c0670d09d9e7eb7d9f76f
Author: Varun Mohan <varunmohan@google.com>
Date: Tue Apr 17 03:06:18 2018

Adjusting ProactiveTabDiscardParams struct so tabs / gb memory logic is not exposed to caller

We do not want callers (TabManager) to have to implement any of the logic related to determining the thresholds, but simply consume them. These thresholds will be used to determine timeouts until discard for proactive tab discarding.

Bug: 775644
Change-Id: I09b3f54cf3acb44ac3724ef4a08ae57d4ce42255
Reviewed-on: https://chromium-review.googlesource.com/1012797
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551221}
[modify] https://crrev.com/1aef3d916dc081b4945c0670d09d9e7eb7d9f76f/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/1aef3d916dc081b4945c0670d09d9e7eb7d9f76f/chrome/browser/resource_coordinator/tab_manager_features.h
[modify] https://crrev.com/1aef3d916dc081b4945c0670d09d9e7eb7d9f76f/chrome/browser/resource_coordinator/tab_manager_features_unittest.cc

Project Member

Comment 50 by bugdroid1@chromium.org, Apr 17 2018

Labels: merge-merged-testbranch
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b6279a73c91fbe5427936a9a992902be280f94aa

commit b6279a73c91fbe5427936a9a992902be280f94aa
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Apr 12 19:42:59 2018

Expose LifecycleUnit visibility in chrome://discards.

This is useful to debug occlusion tracking issues and to get a
better understanding of which tabs might be discarded.

Bug: 775644
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I1ad43559a96eb758d3a7796186930d6a7ffa4b39
Reviewed-on: https://chromium-review.googlesource.com/993702
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Emily Stark <estark@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550316}
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/b6279a73c91fbe5427936a9a992902be280f94aa/chrome/test/data/webui/discards/discards_browsertest.js

Project Member

Comment 51 by bugdroid1@chromium.org, Apr 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/69126442dc1453c7723fe8a7dfc0cd04da1df0e0

commit 69126442dc1453c7723fe8a7dfc0cd04da1df0e0
Author: Varun Mohan <varunmohan@google.com>
Date: Thu Apr 12 21:31:54 2018

Remove discard protection for tabs that were recently in focus

In the past, there was a 10 minute protection from discarding for tabs that went out of focus. With the move to add proactive discarding, this logic is no longer necessary. This is because the proactive discarding logic will handle the timing. A user visible effect of this CL is that when they are under memory pressure, their tabs can be discarded as soon as they become non-visible.

Bug: 775644
Change-Id: I9a2fd8159093fbd0ceb7018246d9d6c002383e0d
Reviewed-on: https://chromium-review.googlesource.com/1008243
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Varun Mohan <varunmohan@google.com>
Cr-Commit-Position: refs/heads/master@{#550367}
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/extensions/api/tabs/tabs_test.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/69126442dc1453c7723fe8a7dfc0cd04da1df0e0/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 52 by bugdroid1@chromium.org, Apr 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fc9d9f7b20287e404692ac4d2a942cf5c8f63d51

commit fc9d9f7b20287e404692ac4d2a942cf5c8f63d51
Author: Varun Mohan <varunmohan@google.com>
Date: Wed Apr 25 15:18:12 2018

Adding proactive tab discarding to TabManager

This is the initial simple implementation of proactive tab discarding. This will be ran on a Finch trial with various parameters in order to find balance between maximal resource savings and minimal impact to user experience.

Bug: 775644
Change-Id: If5048f622bd24d540804842c7e5448c48fabad36
Reviewed-on: https://chromium-review.googlesource.com/1014646
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553558}
[modify] https://crrev.com/fc9d9f7b20287e404692ac4d2a942cf5c8f63d51/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/fc9d9f7b20287e404692ac4d2a942cf5c8f63d51/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/fc9d9f7b20287e404692ac4d2a942cf5c8f63d51/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 53 by bugdroid1@chromium.org, May 9 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46c1bd55c8b845db737c1603f3798b2af8f85239

commit 46c1bd55c8b845db737c1603f3798b2af8f85239
Author: Francois Doray <fdoray@chromium.org>
Date: Wed May 09 16:11:11 2018

Enforcing freezing a tab prior to proactive discard.

This CL enforces that a tab is frozen prior to being proactively discarded. This will allow the website to have enough time to persist any state prior to being proactively discarded. Urgent discard behavior is unchanged.

Bug: 775644
Change-Id: Ia3ec9e8f53f80d2c940edd065090415cbcdd1f6c
Reviewed-on: https://chromium-review.googlesource.com/1041138
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557209}
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/lifecycle_state.h
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/46c1bd55c8b845db737c1603f3798b2af8f85239/chrome/browser/sync/sessions/browser_list_router_helper_unittest.cc

Project Member

Comment 54 by bugdroid1@chromium.org, May 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988

commit c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988
Author: Max Morin <maxmorin@chromium.org>
Date: Fri May 11 08:11:10 2018

Revert "Enforcing freezing a tab prior to proactive discard."

This reverts commit 46c1bd55c8b845db737c1603f3798b2af8f85239.

Reason for revert: crbug.com/841871

Original change's description:
> Enforcing freezing a tab prior to proactive discard.
> 
> This CL enforces that a tab is frozen prior to being proactively discarded. This will allow the website to have enough time to persist any state prior to being proactively discarded. Urgent discard behavior is unchanged.
> 
> Bug: 775644
> Change-Id: Ia3ec9e8f53f80d2c940edd065090415cbcdd1f6c
> Reviewed-on: https://chromium-review.googlesource.com/1041138
> Commit-Queue: François Doray <fdoray@chromium.org>
> Reviewed-by: François Doray <fdoray@chromium.org>
> Reviewed-by: Pavel Yatsuk <pavely@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#557209}

TBR=fdoray@chromium.org,fmeawad@chromium.org,pavely@chromium.org,varunmohan@google.com

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 775644, 841871
Change-Id: Ia784d8aada40321e14f14133a7a6bb9403d7dda0
Reviewed-on: https://chromium-review.googlesource.com/1054668
Reviewed-by: Max Morin <maxmorin@chromium.org>
Commit-Queue: Max Morin <maxmorin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557812}
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/lifecycle_state.h
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/c0426bc1f3e91a2078cdb7fcb7c1adfb25d65988/chrome/browser/sync/sessions/browser_list_router_helper_unittest.cc

Project Member

Comment 55 by bugdroid1@chromium.org, May 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5fb25d254f9765b42b345a3292e14f8951e4342e

commit 5fb25d254f9765b42b345a3292e14f8951e4342e
Author: Francois Doray <fdoray@chromium.org>
Date: Tue May 15 17:12:22 2018

Remove TabManager::(Discard|Freeze)TabById().

These methods were only used by the chrome://discards UI, which can
instead access the LifecycleUnits directly.

Bug: 775644
Change-Id: Iae97a1d6bcf5af1fcd555608ad05e4921ff8e437
Reviewed-on: https://chromium-review.googlesource.com/1057692
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558759}
[modify] https://crrev.com/5fb25d254f9765b42b345a3292e14f8951e4342e/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/5fb25d254f9765b42b345a3292e14f8951e4342e/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/5fb25d254f9765b42b345a3292e14f8951e4342e/chrome/browser/ui/webui/discards/discards_ui.cc

Project Member

Comment 56 by bugdroid1@chromium.org, May 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6959fecc9375f3ebf85ac21625567010c5654981

commit 6959fecc9375f3ebf85ac21625567010c5654981
Author: Francois Doray <fdoray@chromium.org>
Date: Wed May 16 01:40:19 2018

Remove TabManager::SetTabAutoDiscardableState.

TabLifecycleUnitExternal::SetAutoDiscardable should be used instead.
Removing TabManager::SetTabAutoDiscardableState reduces bloating of
TabManager.

TBR=rdevlin.cronin@chromium.org

Bug: 775644
Change-Id: Ic3923f7d076ba0d7338b433c5d6c9dd197402f1a
Reviewed-on: https://chromium-review.googlesource.com/1057694
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558916}
[modify] https://crrev.com/6959fecc9375f3ebf85ac21625567010c5654981/chrome/browser/extensions/api/tabs/tabs_api.cc
[modify] https://crrev.com/6959fecc9375f3ebf85ac21625567010c5654981/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/6959fecc9375f3ebf85ac21625567010c5654981/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/6959fecc9375f3ebf85ac21625567010c5654981/chrome/browser/resource_coordinator/tab_manager_browsertest.cc

Project Member

Comment 57 by bugdroid1@chromium.org, May 17 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402

commit b4b9f2f45a87b4b5f12f64ff4da37a53202b0402
Author: Francois Doray <fdoray@chromium.org>
Date: Thu May 17 21:04:32 2018

Enforcing freezing a tab prior to proactive discard (reland).

This CL enforces that a tab is frozen prior to being proactively
discarded. This will allow the website to have enough time to persist
any state prior to being proactively discarded. Urgent and external
discard behavior is unchanged.

This CL previously landed as
https://chromium-review.googlesource.com/1041138. It was reverted
because it caused asynchronous change of tab id after a discard from
an extension, which some tests didn't expect. For now, the CL was
edited (patch 1->2) to only send a freeze signal and discard
asynchronously for proactive tab discarding. The behavior of
extension discarding is unchanged. We will be able to update the
behavior of extension discarding once we have stable tab ids on tab
replacement https://crbug.com/632839 .

Bug: 775644
Change-Id: Ief503eabeb817d11eccdd6df668c0cf672edd78c
Reviewed-on: https://chromium-review.googlesource.com/1060290
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#559674}
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/lifecycle_state.h
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/b4b9f2f45a87b4b5f12f64ff4da37a53202b0402/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 58 by bugdroid1@chromium.org, May 25 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/814050de864c8f769badadbb29b8946d6fadcf36

commit 814050de864c8f769badadbb29b8946d6fadcf36
Author: Francois Doray <fdoray@chromium.org>
Date: Fri May 25 17:56:56 2018

Remove ResourceCoordinatorTabHelper::IsEnabled().

Instantiating a ResourceCoordinatorTabHelper is useful to support
TabLoadTracker, even when the service manager and GRC are not enabled.

Bug: 775644
Change-Id: I5a47aa711f4759172a73a5bc8c75685513995e27
Reviewed-on: https://chromium-review.googlesource.com/1071718
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Elly Fong-Jones <ellyjones@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561939}
[modify] https://crrev.com/814050de864c8f769badadbb29b8946d6fadcf36/chrome/browser/resource_coordinator/tab_helper.cc
[modify] https://crrev.com/814050de864c8f769badadbb29b8946d6fadcf36/chrome/browser/resource_coordinator/tab_helper.h
[modify] https://crrev.com/814050de864c8f769badadbb29b8946d6fadcf36/chrome/browser/ui/tab_helpers.cc

Project Member

Comment 59 by bugdroid1@chromium.org, May 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3e44f08e40581a5910be9ff40ed4762195404995

commit 3e44f08e40581a5910be9ff40ed4762195404995
Author: Francois Doray <fdoray@chromium.org>
Date: Mon May 28 20:14:01 2018

Implement proactive tab freezing.

With this CL, loaded tabs that have been non-visible for more than
10 minutes are frozen when the proactive tab discard experiment is
enabled.

This is implemented so we can start assessing performance and memory
usage of proactive freezing and discarding.

Bug: 775644
Change-Id: If2b107746db9b5041e17c851dea1a2b38c3319dc
Reviewed-on: https://chromium-review.googlesource.com/1070517
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562305}
[modify] https://crrev.com/3e44f08e40581a5910be9ff40ed4762195404995/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/3e44f08e40581a5910be9ff40ed4762195404995/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/3e44f08e40581a5910be9ff40ed4762195404995/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/3e44f08e40581a5910be9ff40ed4762195404995/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 60 by bugdroid1@chromium.org, May 28 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/af4384482ba26333581ef6e45677083532fa7511

commit af4384482ba26333581ef6e45677083532fa7511
Author: Francois Doray <fdoray@chromium.org>
Date: Mon May 28 20:29:08 2018

Remove the ArcMemoryManagement feature.

This feature is enabled by default and there are no plans to disable
it via a field trial.

Bug: 775644
Change-Id: I7efb05520b7176c1b7625fe29e0516f64891bc44
Reviewed-on: https://chromium-review.googlesource.com/1075714
Commit-Queue: François Doray <fdoray@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562307}
[modify] https://crrev.com/af4384482ba26333581ef6e45677083532fa7511/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/af4384482ba26333581ef6e45677083532fa7511/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos.cc
[modify] https://crrev.com/af4384482ba26333581ef6e45677083532fa7511/chrome/common/chrome_features.cc
[modify] https://crrev.com/af4384482ba26333581ef6e45677083532fa7511/chrome/common/chrome_features.h

Project Member

Comment 61 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/70ddf623d4c22863c4e5ef5fb41d656b8273428b

commit 70ddf623d4c22863c4e5ef5fb41d656b8273428b
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jun 01 14:09:07 2018

Add base::Feature to control the Blink PageLifecycle runtime-enabled feature.

The ProactiveTabDiscarding base::Feature (kProactiveTabDiscarding)
depends on the Blink PageLifecycle feature. This CL adds a base::Feature
that will let us force the Blink PageLifecycle feature to be enabled
when the ProactiveTabDiscarding base::Feature is enabled.

Note: The Blink PageLifecycle is currently marked as stable in
runtime_enabled_features.json5, but there are plans to bring it back
to experimental. We don't want that to disturb the proactive tab
discarding experiment.

Bug: 775644
Change-Id: I9c59be91425422db48ccd13e1174804d74311ac8
Reviewed-on: https://chromium-review.googlesource.com/1079691
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Reviewed-by: Shubhie Panicker <panicker@chromium.org>
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563613}
[modify] https://crrev.com/70ddf623d4c22863c4e5ef5fb41d656b8273428b/content/child/runtime_features.cc
[modify] https://crrev.com/70ddf623d4c22863c4e5ef5fb41d656b8273428b/content/public/common/content_features.cc
[modify] https://crrev.com/70ddf623d4c22863c4e5ef5fb41d656b8273428b/content/public/common/content_features.h
[modify] https://crrev.com/70ddf623d4c22863c4e5ef5fb41d656b8273428b/third_party/blink/public/platform/web_runtime_features.h
[modify] https://crrev.com/70ddf623d4c22863c4e5ef5fb41d656b8273428b/third_party/blink/renderer/platform/exported/web_runtime_features.cc

Project Member

Comment 62 by bugdroid1@chromium.org, Jun 1 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3a0333ff4e78e631fd1c83c492ba2236d9106a50

commit 3a0333ff4e78e631fd1c83c492ba2236d9106a50
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jun 01 14:40:21 2018

Add variation param to control proactive tab discarding.

This CL:
1. Renames the ProactiveTabDiscarding feature to
   ProactiveTabFreezeAndDiscard, since it also controls proactive
   freezing.
2. Adds a variation param to control whether proactive discarding
   happens when the ProactiveTabFreezeAndDiscard feature is enabled.
   Possible states are:
    1. ProactiveTabFreezeAndDiscard feature disabled.
         No proactive freezing or discarding.
    2. ProactiveTabFreezeAndDiscard feature enabled,
       ShouldProactivelyDiscard param false.
         Proactive freezing but not proactive discarding.
    3. ProactiveTabFreezeAndDiscard feature eanbled,
       ShouldProactivelyDiscard param true.
         Proactive freezing and discarding.

Bug: 775644
Change-Id: Iae39a73273cd1f42e35cfa68ffe325f4dec17a1a
Reviewed-on: https://chromium-review.googlesource.com/1079798
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563625}
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_data_impl.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_data_impl_unittest.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_data_store.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_data_store_factory.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_data_store_factory_browsertest.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_data_store_unittest.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/local_site_characteristics_non_recording_data_store_unittest.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/tab_manager_features.h
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/tab_manager_features_unittest.cc
[modify] https://crrev.com/3a0333ff4e78e631fd1c83c492ba2236d9106a50/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 63 by bugdroid1@chromium.org, Jun 5 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/93fd9e3c3b695e5d85c92354f58da1e8fee74354

commit 93fd9e3c3b695e5d85c92354f58da1e8fee74354
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jun 05 20:11:23 2018

RC: Do not allow freezing a tab that is already frozen.

With this CL, TabLifecycleUnit::CanFreeze() returns false if the tab
is already frozen. This is important because calling Freeze() on
a TabLifeycleUnit that is already FROZEN causes a transition to
PENDING_FREEZE, and because the page is already frozen from the
renderer point of view, there is no transition back to FROZEN.

Bug: 775644
Change-Id: I216310e83605374f6708ef182dd2b9bf4f531494
Reviewed-on: https://chromium-review.googlesource.com/1085995
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564634}
[modify] https://crrev.com/93fd9e3c3b695e5d85c92354f58da1e8fee74354/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/93fd9e3c3b695e5d85c92354f58da1e8fee74354/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/93fd9e3c3b695e5d85c92354f58da1e8fee74354/chrome/browser/resource_coordinator/tab_load_tracker.h

Project Member

Comment 64 by bugdroid1@chromium.org, Jun 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/955535cb43841d03ae0236f12f0521b5484bfd47

commit 955535cb43841d03ae0236f12f0521b5484bfd47
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jun 08 23:31:17 2018

RC: Do not allow freezing a tab that is discarded.

In the current state, TabManager::PerformStateTransitions() needlessly
tries to freeze discarded tabs.

Bug: 775644
Change-Id: Ieb26cd4a1251b8575308122311bdeabcff831acd
Reviewed-on: https://chromium-review.googlesource.com/1093310
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565777}
[modify] https://crrev.com/955535cb43841d03ae0236f12f0521b5484bfd47/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc

Project Member

Comment 65 by bugdroid1@chromium.org, Jun 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/47f759de1c2f36450ed18c24bb91d636fe9c2195

commit 47f759de1c2f36450ed18c24bb91d636fe9c2195
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Jun 11 18:13:51 2018

Allow unfreezing a WebContents.

With this CL, WebContents exposes an interface to unfreeze a WebContents
while it is still hidden.

In an upcoming CL, TabManager will periodically unfreeze WebContents
that have been frozen for a few minutes. While ideally pages should
use appropriate APIs to refresh their content while in the background,
we believe that periodically unfreezing pages will minimize breakages
of pages that don't use such APIs and reduce the number of pages
opting-out of the freeze feature. Unfreezing is temporary, we will
remove this workaround once enough pages use background APIs.

Bug: 775644
Change-Id: I5379baded20ea59a7582c1d9f376eb57249f99ff
Reviewed-on: https://chromium-review.googlesource.com/1083111
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Dmitry Gozman <dgozman@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566059}
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/browser/devtools/protocol/page_handler.cc
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/browser/web_contents/web_contents_impl.h
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/common/page_messages.h
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/public/browser/web_contents.h
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/renderer/gpu/gpu_benchmarking_extension.cc
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/renderer/render_view_impl.cc
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/content/renderer/render_view_impl.h
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/third_party/blink/public/web/web_view.h
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/third_party/blink/renderer/core/exported/web_view_impl.cc
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/third_party/blink/renderer/core/exported/web_view_impl.h
[modify] https://crrev.com/47f759de1c2f36450ed18c24bb91d636fe9c2195/third_party/blink/renderer/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc

Project Member

Comment 66 by bugdroid1@chromium.org, Jun 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498

commit a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Jun 18 14:30:50 2018

RC: Validate state transitions in TabLifecycleUnit.

This CL adds a function that determines if a state transition is valid
in TabLifecycleUnit. This will help us ensure that things work properly
as we add more possible state transitions (e.g. periodic unfreeze).

Bug: 775644
Change-Id: I89e90021415f68edbed1aca1d6f0052057cd44e9
Reviewed-on: https://chromium-review.googlesource.com/1097550
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567995}
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/a85c146b3a7bf96a0c4118e7b6c4cec1fc54a498/chrome/browser/resource_coordinator/tab_manager_browsertest.cc

Project Member

Comment 67 by bugdroid1@chromium.org, Jun 18 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8a4be6b104b925897d186824dd230670821184b2

commit 8a4be6b104b925897d186824dd230670821184b2
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Jun 18 16:37:15 2018

RC: Remove TabLifecycleUnitExternal::FreezeTab/IsFrozen().

Freezing shouldn't be exposed to external components.

Bug: 775644
Change-Id: I60014f3a39ab241677d678d49ab1ffb2f99689c6
Reviewed-on: https://chromium-review.googlesource.com/1099650
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568033}
[modify] https://crrev.com/8a4be6b104b925897d186824dd230670821184b2/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/8a4be6b104b925897d186824dd230670821184b2/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/8a4be6b104b925897d186824dd230670821184b2/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[modify] https://crrev.com/8a4be6b104b925897d186824dd230670821184b2/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 68 by bugdroid1@chromium.org, Jun 19 2018

This experiment/feature breaks Slack, I appear to be on the "freeze after 10 minutes" experiment, and after a Slack tab is frozen it shows as disconnected in the favicon and status and notifications are not delivered until the tab is unfrozen.

I've also filed support ticket 1804414 with Slack and pointed at this issue.
Project Member

Comment 70 by bugdroid1@chromium.org, Jul 9

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b5e53a4fdfc3ad07265840843905684a329e6b4a

commit b5e53a4fdfc3ad07265840843905684a329e6b4a
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Mon Jul 09 19:36:00 2018

RC: Prevent discarding/freezing of tabs with an attached Devtools console.

Updated the privacy document (approved by msramek: https://docs.google.com/document/d/1BNQ5nLOtPuwP7oxr9r-XKNKr5iObXEiA_69WXAvuYAo/edit?usp=sharing)


Bug: 775644
Change-Id: If9e16711af2d27a7209366a61883997e865c9b50
Reviewed-on: https://chromium-review.googlesource.com/1126332
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573407}
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/decision_details.cc
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/decision_details.h
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/decision_details_unittest.cc
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/b5e53a4fdfc3ad07265840843905684a329e6b4a/tools/metrics/ukm/ukm.xml

Project Member

Comment 71 by bugdroid1@chromium.org, Jul 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a49186f23b99bd728507dd4f3d974aa28f206087

commit a49186f23b99bd728507dd4f3d974aa28f206087
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jul 10 17:00:22 2018

RC: Add a clock that advances when Chrome is in use.

This clock will be use to age tabs only when Chrome is in use. That
will prevent users from finding all their tabs discarded when they
come back to Chrome after a long period of inactivity.

Bug: 775644
Change-Id: Id65a90f0258e2b9095bdc2b35b7f3ed16cc75c38
Reviewed-on: https://chromium-review.googlesource.com/1129825
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573777}
[modify] https://crrev.com/a49186f23b99bd728507dd4f3d974aa28f206087/chrome/browser/BUILD.gn
[add] https://crrev.com/a49186f23b99bd728507dd4f3d974aa28f206087/chrome/browser/resource_coordinator/usage_clock.cc
[add] https://crrev.com/a49186f23b99bd728507dd4f3d974aa28f206087/chrome/browser/resource_coordinator/usage_clock.h
[add] https://crrev.com/a49186f23b99bd728507dd4f3d974aa28f206087/chrome/browser/resource_coordinator/usage_clock_unittest.cc
[modify] https://crrev.com/a49186f23b99bd728507dd4f3d974aa28f206087/chrome/test/BUILD.gn

Project Member

Comment 72 by bugdroid1@chromium.org, Jul 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9b58b685c96e9f82e4d9f9788f7ade7a48af7af9

commit 9b58b685c96e9f82e4d9f9788f7ade7a48af7af9
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jul 10 19:35:10 2018

RC: Allow initialization of UsageClock without metrics::DesktopSessionDurationTracker.

A lot of tests indirectly depend on TabManager. To avoid having to
initialize metrics::DesktopSessionDurationTracker in each of these
tests once UsageClock is used in TabManager, this CL makes UsageClock
resilient to the absence of metrics::DesktopSessionDurationTracker.

Bug: 775644
Change-Id: I6ae9a5a01f867df483c334da6df1a7f6510a7702
Reviewed-on: https://chromium-review.googlesource.com/1131929
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573859}
[modify] https://crrev.com/9b58b685c96e9f82e4d9f9788f7ade7a48af7af9/chrome/browser/resource_coordinator/usage_clock.cc
[modify] https://crrev.com/9b58b685c96e9f82e4d9f9788f7ade7a48af7af9/chrome/browser/resource_coordinator/usage_clock.h

Project Member

Comment 73 by bugdroid1@chromium.org, Jul 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/5dccf31076369b7cef45aa8dd948cf2b182e32e8

commit 5dccf31076369b7cef45aa8dd948cf2b182e32e8
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jul 10 20:26:40 2018

RC: Add LifecycleUnitState::PENDING_UNFREEZE.

A LifeycleUnit transitions to that state after a call to Unfreeze().
It stays in that state until the unfreeze actually happens.

Having this intermediate state instead of transitionning directly
to ACTIVE is important to be able to track when the renderer never
notifies the browser that it ran the "onresume" callback.

Bug: 775644, 855874
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Icf578cd12d113e569b017b604e4e835beeb331bf
Reviewed-on: https://chromium-review.googlesource.com/1131845
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573885}
[modify] https://crrev.com/5dccf31076369b7cef45aa8dd948cf2b182e32e8/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
[modify] https://crrev.com/5dccf31076369b7cef45aa8dd948cf2b182e32e8/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/5dccf31076369b7cef45aa8dd948cf2b182e32e8/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/5dccf31076369b7cef45aa8dd948cf2b182e32e8/chrome/browser/resources/discards/discards.js

Project Member

Comment 74 by bugdroid1@chromium.org, Jul 10

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6de8cae5ed366809bdd8a90ca7b1473cfcf072b5

commit 6de8cae5ed366809bdd8a90ca7b1473cfcf072b5
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jul 10 22:04:10 2018

RC: Update comments in lifecycle_unit_state.mojom and tab_lifecycle_unit.cc.

Fixing comments as requested by fmeawad@ at
https://chromium-review.googlesource.com/c/chromium/src/+/1131845

TBR=fmeawad@chromium.org

Bug: 775644
Change-Id: Ie6851852a80a11efbf6281ee29e8e46f3622e600
Reviewed-on: https://chromium-review.googlesource.com/1132243
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#573939}
[modify] https://crrev.com/6de8cae5ed366809bdd8a90ca7b1473cfcf072b5/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
[modify] https://crrev.com/6de8cae5ed366809bdd8a90ca7b1473cfcf072b5/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc

Project Member

Comment 75 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cc1c4db2029d62332884c5f38a5856871f801a1e

commit cc1c4db2029d62332884c5f38a5856871f801a1e
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Wed Jul 11 12:56:26 2018

Prevent Proactive tab discarding while offline.

Bug: 775644
Change-Id: I63764d060763c2040086c84ae02517f7bea3af52
Reviewed-on: https://chromium-review.googlesource.com/1132399
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574135}
[modify] https://crrev.com/cc1c4db2029d62332884c5f38a5856871f801a1e/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/cc1c4db2029d62332884c5f38a5856871f801a1e/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/cc1c4db2029d62332884c5f38a5856871f801a1e/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 76 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/a3c46f398ec5bbb79c35614309b24c9f616394c9

commit a3c46f398ec5bbb79c35614309b24c9f616394c9
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jul 11 14:43:19 2018

RC: Prevent freezing a tab that is being discarded.

Previously, TabManager::PerformStateTransitions() could be called
repeatedly and needlessly while a tab is being discarded:

- TabManager::PerformStateTransitions()
  Transitions a LifecycleUnit to PENDING_DISCARD.

- TabManager::PerformStateTransitions()
  Calls CanFreeze() to check if the LifecycleUnit can be frozen.
  CanFreeze() returns true even though the LifecycleUnit is already
  being discarded.
  Calls Freeze(), which transitions the LifecycleUnit to
  PENDING_FREEZE.
  Calls CanDiscard() to check if the LifecycleUnit can be discarded.
  CanDiscard() returns true.
  Calls Discard(kProactive) to discard the LifecycleUnit.
  ** Since a LifecycleUnit was discarded, another call to
  PerformStateTransitions() is scheduled immediately. **

- TabManager::PerformStateTransitions()
  Called repeatedly until the LifecycleUnit transitions to DISCARDED.

This CL fixes the issue by returning false from CanFreeze() and
Freeze() for a LifecycleUnit that is being discarded.

Bug: 775644
Change-Id: I4de25dfe7d569f61d0eef988b217203eeae6f006
Reviewed-on: https://chromium-review.googlesource.com/1132343
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574158}
[modify] https://crrev.com/a3c46f398ec5bbb79c35614309b24c9f616394c9/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
[modify] https://crrev.com/a3c46f398ec5bbb79c35614309b24c9f616394c9/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/a3c46f398ec5bbb79c35614309b24c9f616394c9/chrome/browser/resource_coordinator/tab_manager_browsertest.cc

Project Member

Comment 77 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e7cb77851800b7bc200649ca2ca458c4dc0e58ee

commit e7cb77851800b7bc200649ca2ca458c4dc0e58ee
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jul 11 15:07:28 2018

RC: Mark TabManager::IsTab(InSessionRestore|RestoredInForeground) as static.

These methods don't access member variables, so they can easily be
made static. Making these methods static will avoid having to initialize
TabManager and its dependencies in a bunch of tests.

Bug: 775644
Change-Id: I2ef567c855e34e234faad569126e752460cd2418
Reviewed-on: https://chromium-review.googlesource.com/1132094
Reviewed-by: Ryan Sturm <ryansturm@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574163}
[modify] https://crrev.com/e7cb77851800b7bc200649ca2ca458c4dc0e58ee/chrome/browser/page_load_metrics/observers/session_restore_page_load_metrics_observer.cc
[modify] https://crrev.com/e7cb77851800b7bc200649ca2ca458c4dc0e58ee/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/e7cb77851800b7bc200649ca2ca458c4dc0e58ee/chrome/browser/resource_coordinator/tab_manager.h

Project Member

Comment 78 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f455e576ca535f0d008db8de8cc3e3147646e10a

commit f455e576ca535f0d008db8de8cc3e3147646e10a
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jul 11 15:12:55 2018

RC: Do not initialize TabManager in ChromeUnitTestSuite.

This CL removes the initialization of TabManager by ChromeUnitTestSuite
before every Chrome unit test run. This will make it easier to
initialize metrics::DesktopSessionDurationTracker before TabManager in
tests that need to verify that Chrome usage (instead of wall time) is
used for tab lifecycle state transitions.

Bug: 775644
Change-Id: I01d05579964822c87ebc515cafdd25e08fdab661
Reviewed-on: https://chromium-review.googlesource.com/1132121
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574165}
[modify] https://crrev.com/f455e576ca535f0d008db8de8cc3e3147646e10a/chrome/browser/extensions/api/tabs/tabs_api_unittest.cc
[modify] https://crrev.com/f455e576ca535f0d008db8de8cc3e3147646e10a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/f455e576ca535f0d008db8de8cc3e3147646e10a/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/f455e576ca535f0d008db8de8cc3e3147646e10a/chrome/test/base/chrome_unit_test_suite.cc

Project Member

Comment 79 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9e1cac231cec99deee234be3a8c9adb81f966c4e

commit 9e1cac231cec99deee234be3a8c9adb81f966c4e
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jul 11 17:29:29 2018

RC: Add UsageClock::IsInUse().

This method returns true if Chrome is considered to be in use. This
will be used by TabManager to know whether it should schedule a call
to PerformStateTransitions() (it is never necessary to schedule a call
to this method when Chrome is not in use).

Bug: 775644
Change-Id: I20e2e55280c84fcef9b56bb18c2feedb3aed136d
Reviewed-on: https://chromium-review.googlesource.com/1133301
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574216}
[modify] https://crrev.com/9e1cac231cec99deee234be3a8c9adb81f966c4e/chrome/browser/resource_coordinator/usage_clock.cc
[modify] https://crrev.com/9e1cac231cec99deee234be3a8c9adb81f966c4e/chrome/browser/resource_coordinator/usage_clock.h
[modify] https://crrev.com/9e1cac231cec99deee234be3a8c9adb81f966c4e/chrome/browser/resource_coordinator/usage_clock_unittest.cc

Project Member

Comment 80 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6dfc80f9ff2b20a3146bbadc1afe47c5a62096b8

commit 6dfc80f9ff2b20a3146bbadc1afe47c5a62096b8
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jul 11 18:35:00 2018

Build chrome/browser/metrics/desktop_session_duration/ on ChromeOS.

This directory was previously excluded from the ChromeOS build. It
forced #ifdefs to be added to code using DesktopSessionDurationTracker
(e.g. https://cs.chromium.org/chromium/src/chrome/browser/resource_coordinator/usage_clock.cc?rcl=ae0af1511d081f85641f82ac650919dafffa1ee6).
With this CL, the directory is built and the #ifdefs are not longer
required.

Note that for now, DesktopSessionDurationTracker is still not
initialized on ChromeOS.

Bug: 775644
Change-Id: Ic3fcd2646f7577805b986888bc22f79579c9d736
Reviewed-on: https://chromium-review.googlesource.com/1133280
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574256}
[modify] https://crrev.com/6dfc80f9ff2b20a3146bbadc1afe47c5a62096b8/chrome/browser/BUILD.gn
[modify] https://crrev.com/6dfc80f9ff2b20a3146bbadc1afe47c5a62096b8/chrome/browser/metrics/desktop_session_duration/desktop_profile_session_durations_service_factory.cc
[modify] https://crrev.com/6dfc80f9ff2b20a3146bbadc1afe47c5a62096b8/chrome/test/BUILD.gn

Project Member

Comment 81 by bugdroid1@chromium.org, Jul 11

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8ff0122069f9f0ce5c456c9d8eb3ba74142cc7f7

commit 8ff0122069f9f0ce5c456c9d8eb3ba74142cc7f7
Author: Francois Doray <fdoray@chromium.org>
Date: Wed Jul 11 19:40:26 2018

RC: Make UsageClock work on ChromeOS.

Now that DesktopSessionDurationTracker is built on ChromeOS, UsageClock
can work the same way on all platforms.

Bug: 775644
Change-Id: Ic90984b2f36a1ffbf19047fae0bb953d56653eee
Reviewed-on: https://chromium-review.googlesource.com/1133419
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574288}
[modify] https://crrev.com/8ff0122069f9f0ce5c456c9d8eb3ba74142cc7f7/chrome/browser/resource_coordinator/usage_clock.cc
[modify] https://crrev.com/8ff0122069f9f0ce5c456c9d8eb3ba74142cc7f7/chrome/browser/resource_coordinator/usage_clock.h
[modify] https://crrev.com/8ff0122069f9f0ce5c456c9d8eb3ba74142cc7f7/chrome/browser/resource_coordinator/usage_clock_unittest.cc

Project Member

Comment 82 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb

commit 840dc0a7c0eacb82070efe833ef3aacc7b2e89cb
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Jul 12 20:54:33 2018

RC: Record Chrome usage time when a LifecycleUnit is hidden.

With this CL, the total Chrome usage time measured by UsageClock is
recorded in a LifecycleUnit when it is hidden. In an upcoming CL, this
will be used to discard a LifecycleUnit after a given amount of Chrome
usage time has elapsed since it was hidden.

We also record the wall time when a LifecycleUnit is hidden, because
freezing occurs when a LifeycleUnit has been hidden for a given amount
of wall clock time, not Chrome usage time.

Bug: 775644
Change-Id: I76d504e9bbf3eb86ded1203e4e117086faf93277
Reviewed-on: https://chromium-review.googlesource.com/1133593
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574712}
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/browser_process_impl.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/browser_process_impl.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/tab_manager_stats_collector.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/test_lifecycle_unit.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/browser/resource_coordinator/test_lifecycle_unit.h
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/test/base/testing_browser_process.cc
[modify] https://crrev.com/840dc0a7c0eacb82070efe833ef3aacc7b2e89cb/chrome/test/base/testing_browser_process.h

Project Member

Comment 83 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/3c279f295bc8924c82ed072f564ac9fe8fa3c8aa

commit 3c279f295bc8924c82ed072f564ac9fe8fa3c8aa
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Jul 12 21:11:50 2018

RC: Use Chrome usage time since hidden to decide if tab can be proactively discarded.

Previously, a tab was proactively discarded when it had spent T time hidden,
where T depends on the number of non-discarded tabs and the amount of
physical memory. Unfortunately, that meant that if a user kept Chrome
open during the night without touching it, all hidden tabs were discarded
in the morning.

With this CL, we use the "Chrome usage time since hidden" to determine
if a tab should be proactively discarded. That will prevent the unwanted
behavior of finding all tabs discarded after a long period of inactivity.

Bug: 775644
Change-Id: Ie45ddfc07df782adeb32e3334a97bacaec429d45
Reviewed-on: https://chromium-review.googlesource.com/1130470
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574720}
[modify] https://crrev.com/3c279f295bc8924c82ed072f564ac9fe8fa3c8aa/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/3c279f295bc8924c82ed072f564ac9fe8fa3c8aa/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/3c279f295bc8924c82ed072f564ac9fe8fa3c8aa/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 84 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/79fba7433e865da18a2726f058eb21a2f000ca90

commit 79fba7433e865da18a2726f058eb21a2f000ca90
Author: Francois Doray <fdoray@chromium.org>
Date: Thu Jul 12 21:53:33 2018

RC: Move parts of TabManager::PerformStateTransitions() into helper methods.

This is a no-op cleanup before adding more stuff in
TabManager::PerformStateTransitions().

Bug: 775644
Change-Id: I023dd944f536f704398d2ee7470080278ba529e8
Reviewed-on: https://chromium-review.googlesource.com/1133972
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574739}
[modify] https://crrev.com/79fba7433e865da18a2726f058eb21a2f000ca90/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/79fba7433e865da18a2726f058eb21a2f000ca90/chrome/browser/resource_coordinator/tab_manager.h

Blockedon: 863243
Project Member

Comment 86 by bugdroid1@chromium.org, Jul 12

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1462acffad5f9eeb4229aac3a655f276f98f1ea5

commit 1462acffad5f9eeb4229aac3a655f276f98f1ea5
Author: Kenneth Russell <kbr@chromium.org>
Date: Thu Jul 12 23:42:17 2018

Revert "RC: Record Chrome usage time when a LifecycleUnit is hidden."

This reverts commit 840dc0a7c0eacb82070efe833ef3aacc7b2e89cb.

Revert "RC: Use Chrome usage time since hidden to decide if tab can be proactively discarded."

This reverts commit 3c279f295bc8924c82ed072f564ac9fe8fa3c8aa.

Revert "RC: Move parts of TabManager::PerformStateTransitions() into helper methods."

This reverts commit 79fba7433e865da18a2726f058eb21a2f000ca90.

These three CLs stack on top of each other and the first one (
840dc0a7c0eacb82070efe833ef3aacc7b2e89cb ,
https://chromium-review.googlesource.com/1133593 ) seems to have
introduced assertion failures and crashes per http://crbug.com/863243 .

Tbr: fdoray@chromium.org
Tbr: sky@chromium.org
Bug: 775644, 863243
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Change-Id: I7f02f28de26a8c531e6eebe847120f45b133fd7d
Reviewed-on: https://chromium-review.googlesource.com/1135969
Reviewed-by: Kenneth Russell <kbr@chromium.org>
Commit-Queue: Kenneth Russell <kbr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#574775}
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/browser_process_impl.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/browser_process_impl.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_manager_stats_collector.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/tab_manager_unittest.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/test_lifecycle_unit.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/browser/resource_coordinator/test_lifecycle_unit.h
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/test/base/testing_browser_process.cc
[modify] https://crrev.com/1462acffad5f9eeb4229aac3a655f276f98f1ea5/chrome/test/base/testing_browser_process.h

https://chromium-review.googlesource.com/1133593 is the likely cause of assertion failures and crashes seen in Issue 863243 but it couldn't be reverted independently of the others, so https://chromium-review.googlesource.com/1135969 reverts it and the subsequent two CLs.

For any future re-lands of these patches – after tracking down and fixing the cause of the above assertion failure – please add the following line to the CL description to run these additional tests:

Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel

Thanks.

Project Member

Comment 89 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/74fe9bebdc3fa4f92b31df89a043061a1b43dedd

commit 74fe9bebdc3fa4f92b31df89a043061a1b43dedd
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jul 13 19:48:11 2018

RC: Record Chrome usage time when a LifecycleUnit is hidden (reland)

This is a reland of https://chromium-review.googlesource.com/1133593.
The double end session issue was fixed by
https://chromium-review.googlesource.com/1136725.

With this CL, the total Chrome usage time measured by UsageClock is
recorded in a LifecycleUnit when it is hidden. In an upcoming CL, this
will be used to discard a LifecycleUnit after a given amount of Chrome
usage time has elapsed since it was hidden.

We also record the wall time when a LifecycleUnit is hidden, because
freezing occurs when a LifeycleUnit has been hidden for a given amount
of wall clock time, not Chrome usage time.

TBR=sky@chromium.org,sebmarchand@chromium.org

Bug: 775644
Change-Id: I4accaee333f8907695c672505e295734d7206566
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/1136726
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575030}
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/browser_process_impl.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/browser_process_impl.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/tab_manager_stats_collector.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/test_lifecycle_unit.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/browser/resource_coordinator/test_lifecycle_unit.h
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/test/base/testing_browser_process.cc
[modify] https://crrev.com/74fe9bebdc3fa4f92b31df89a043061a1b43dedd/chrome/test/base/testing_browser_process.h

Project Member

Comment 90 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/71ac0427fe64b5f0ef21b5988987727386466566

commit 71ac0427fe64b5f0ef21b5988987727386466566
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jul 13 19:53:58 2018

RC: Use Chrome usage time since hidden to decide if tab can be proactively discarded (reland).

This is a reland of https://chromium-review.googlesource.com/1130470.
The double end session issue was fixed by
https://chromium-review.googlesource.com/1136725.

Previously, a tab was proactively discarded when it had spent T time hidden,
where T depends on the number of non-discarded tabs and the amount of
physical memory. Unfortunately, that meant that if a user kept Chrome
open during the night without touching it, all hidden tabs were discarded
in the morning.

With this CL, we use the "Chrome usage time since hidden" to determine
if a tab should be proactively discarded. That will prevent the unwanted
behavior of finding all tabs discarded after a long period of inactivity.

TBR=sebmarchand@chromium.org

Bug: 775644
Change-Id: I57a08a47aad76087b54277d19849228e1ed00305
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/1136791
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575032}
[modify] https://crrev.com/71ac0427fe64b5f0ef21b5988987727386466566/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/71ac0427fe64b5f0ef21b5988987727386466566/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/71ac0427fe64b5f0ef21b5988987727386466566/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 91 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f727b6ad63068d66227193299f0e8985d1af4531

commit f727b6ad63068d66227193299f0e8985d1af4531
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jul 13 19:59:42 2018

RC: Move parts of TabManager::PerformStateTransitions() into helper methods (reland).

This is a reland of https://chromium-review.googlesource.com/1133972.
The double end session issue was fixed by
https://chromium-review.googlesource.com/1136725.

This is a no-op cleanup before adding more stuff in
TabManager::PerformStateTransitions().

TBR=sebmarchand@chromium.org

Bug: 775644
Change-Id: I35a7b3cbb877a26fb41dfce7340bf3a4b2c777b9
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Reviewed-on: https://chromium-review.googlesource.com/1136792
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575036}
[modify] https://crrev.com/f727b6ad63068d66227193299f0e8985d1af4531/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/f727b6ad63068d66227193299f0e8985d1af4531/chrome/browser/resource_coordinator/tab_manager.h

Project Member

Comment 92 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/04c60edb1e27b1d152b695766e6c6f3464e0cbb2

commit 04c60edb1e27b1d152b695766e6c6f3464e0cbb2
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jul 13 21:13:21 2018

RC: Add LifecycleUnit::GetStateChangeTime().

This method the last time at which the state of a LifecycleUnit
changed. It will be used to determine if a LifeycleUnit has been
unfrozen long enough and should be frozen again.

Bug: 775644
Change-Id: I2ba04b9ed4085767e67108cd46901d876efc2217
Reviewed-on: https://chromium-review.googlesource.com/1134029
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575067}
[modify] https://crrev.com/04c60edb1e27b1d152b695766e6c6f3464e0cbb2/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/04c60edb1e27b1d152b695766e6c6f3464e0cbb2/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/04c60edb1e27b1d152b695766e6c6f3464e0cbb2/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/04c60edb1e27b1d152b695766e6c6f3464e0cbb2/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc

Project Member

Comment 93 by bugdroid1@chromium.org, Jul 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/441db9c3c09a9f3e65b977283392450a4c5de6d2

commit 441db9c3c09a9f3e65b977283392450a4c5de6d2
Author: Francois Doray <fdoray@chromium.org>
Date: Fri Jul 13 22:22:48 2018

RC: Periodically unfreeze frozen tabs.

With this CL, frozen tabs can be unfrozen at configurable intervals
for a configurable amount of time. The goal of unfreezing tabs is to
let them update their state, so they are up to date when they are
reactivated. The code enforces that a single tab is unfrozen at a
time.

Bug: 775644
Change-Id: Ifd57c4ef0aea866089a931020242bc60486f6edd
Reviewed-on: https://chromium-review.googlesource.com/1135639
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575092}
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/about_flags.cc
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/resource_coordinator/tab_manager_features.h
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/resource_coordinator/tab_manager_features_unittest.cc
[modify] https://crrev.com/441db9c3c09a9f3e65b977283392450a4c5de6d2/chrome/browser/resource_coordinator/tab_manager_unittest.cc

Project Member

Comment 94 by bugdroid1@chromium.org, Jul 14

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c

commit 0537074d3c771f8aa9465ce02dfdd9dacf7ab47c
Author: Francois Doray <fdoray@chromium.org>
Date: Sat Jul 14 02:59:10 2018

RC: Do not freeze or discard tabs capturing the desktop.

With this CL, Hangouts should no longer be discarded during a
screenshare session.

See privacy doc update:
https://docs.google.com/a/google.com/document/d/1BNQ5nLOtPuwP7oxr9r-XKNKr5iObXEiA_69WXAvuYAo/edit?disco=AAAACBUojIc

Bug: 775644, 857495
Change-Id: I2fa58efc58d1a9c92ae49c5eb308514722637c14
Reviewed-on: https://chromium-review.googlesource.com/1136513
Reviewed-by: Robert Kaplow (slow) <rkaplow@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575141}
[modify] https://crrev.com/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c/chrome/browser/resource_coordinator/decision_details.cc
[modify] https://crrev.com/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c/chrome/browser/resource_coordinator/decision_details.h
[modify] https://crrev.com/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c/chrome/browser/resource_coordinator/decision_details_unittest.cc
[modify] https://crrev.com/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/0537074d3c771f8aa9465ce02dfdd9dacf7ab47c/tools/metrics/ukm/ukm.xml

Project Member

Comment 95 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/126b44ea82354743b32880737800007f19ca5480

commit 126b44ea82354743b32880737800007f19ca5480
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jul 17 01:31:27 2018

RC: Add reason arg to LifecycleUnitObserver::OnLifecycleUnitStateChanged().

The state change reason should be logged with every discard metric,
to allow proper interpretation.

Adding the state change reason to the observer interface is the first
step towards adding it to every metric.

Bug: 775644
Change-Id: I671ca55494a50bb99e89e8bdd1ec0b18dbe281cb
Reviewed-on: https://chromium-review.googlesource.com/1136949
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575512}
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/lifecycle_unit_observer.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/lifecycle_unit_observer.h
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/126b44ea82354743b32880737800007f19ca5480/chrome/browser/resource_coordinator/tab_manager_browsertest.cc

Project Member

Comment 96 by bugdroid1@chromium.org, Jul 17

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9f3e95009dee6616c99c025dc22c9fb9963941ec

commit 9f3e95009dee6616c99c025dc22c9fb9963941ec
Author: Francois Doray <fdoray@chromium.org>
Date: Tue Jul 17 22:19:54 2018

RC: Add histogram indicating online state when discarded tab is reloaded.

Bug: 775644
Change-Id: I2e1558710c665322c1cbba93ed20176f6be83667
Reviewed-on: https://chromium-review.googlesource.com/1136984
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Robert Kaplow (slow) <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#575802}
[modify] https://crrev.com/9f3e95009dee6616c99c025dc22c9fb9963941ec/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/9f3e95009dee6616c99c025dc22c9fb9963941ec/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[modify] https://crrev.com/9f3e95009dee6616c99c025dc22c9fb9963941ec/tools/metrics/histograms/histograms.xml

Project Member

Comment 97 by bugdroid1@chromium.org, Jul 20

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/94d6d3941e6a172f8254d168be15163dee6e1c05

commit 94d6d3941e6a172f8254d168be15163dee6e1c05
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Fri Jul 20 05:29:44 2018

Prevent a tab from being discarded if it shares its BrowsingInstance

This CL add a feature parameter to the Proactive Tab Discarding and
Freezing experiment to prevent discarding tabs that share their browsing
instance with another tab. This might be too agressive, in practice we
might just want to consider tabs under the same SiteInstance but this is
not an information that we can access yet.

Check this page for more details about the SiteInstance/BrowsingInstance
concepts: https://www.chromium.org/developers/design-documents/process-models#Implementation_Notes

UKM privacy document has been updated here (pending approval): https://docs.google.com/a/google.com/document/d/1BNQ5nLOtPuwP7oxr9r-XKNKr5iObXEiA_69WXAvuYAo/edit?disco=AAAABzM-vE0

Bug: 775644, 862203
Change-Id: Iaf5107db1d68aa4a0155ecbae7283f487c23bb7c
Reviewed-on: https://chromium-review.googlesource.com/1144188
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576789}
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/decision_details.cc
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/decision_details.h
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/tab_manager_features.h
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/chrome/browser/resource_coordinator/tab_manager_features_unittest.cc
[modify] https://crrev.com/94d6d3941e6a172f8254d168be15163dee6e1c05/tools/metrics/ukm/ukm.xml

Project Member

Comment 98 by bugdroid1@chromium.org, Jul 25

Labels: merge-merged-3497
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4dc421aedb46253a98832e534f02eb5907c1d75b

commit 4dc421aedb46253a98832e534f02eb5907c1d75b
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Wed Jul 25 19:21:56 2018

Prevent a tab from being discarded if it shares its BrowsingInstance

This CL add a feature parameter to the Proactive Tab Discarding and
Freezing experiment to prevent discarding tabs that share their browsing
instance with another tab. This might be too agressive, in practice we
might just want to consider tabs under the same SiteInstance but this is
not an information that we can access yet.

Check this page for more details about the SiteInstance/BrowsingInstance
concepts: https://www.chromium.org/developers/design-documents/process-models#Implementation_Notes

UKM privacy document has been updated here (pending approval): https://docs.google.com/a/google.com/document/d/1BNQ5nLOtPuwP7oxr9r-XKNKr5iObXEiA_69WXAvuYAo/edit?disco=AAAABzM-vE0

Bug: 775644, 862203
Change-Id: Iaf5107db1d68aa4a0155ecbae7283f487c23bb7c
Reviewed-on: https://chromium-review.googlesource.com/1144188
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Alexei Svitkine <asvitkine@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#576789}(cherry picked from commit 94d6d3941e6a172f8254d168be15163dee6e1c05)
Reviewed-on: https://chromium-review.googlesource.com/1150261
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#85}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/decision_details.cc
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/decision_details.h
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/tab_manager_features.cc
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/tab_manager_features.h
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/chrome/browser/resource_coordinator/tab_manager_features_unittest.cc
[modify] https://crrev.com/4dc421aedb46253a98832e534f02eb5907c1d75b/tools/metrics/ukm/ukm.xml

Project Member

Comment 99 by bugdroid1@chromium.org, Jul 25

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/be9460a253178bcf4e6cad9179f33c465f60eac2

commit be9460a253178bcf4e6cad9179f33c465f60eac2
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Wed Jul 25 23:04:48 2018

Add the fieldtrial testing config for ProactiveTabDiscarding.

Bug: 775644, 773382
Change-Id: I8c0426728b31644797e6e641d16ac049ab61a8ce
Reviewed-on: https://chromium-review.googlesource.com/1148950
Reviewed-by: Steven Holte <holte@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578113}
[modify] https://crrev.com/be9460a253178bcf4e6cad9179f33c465f60eac2/testing/variations/fieldtrial_testing_config.json

Project Member

Comment 100 by bugdroid1@chromium.org, Jul 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c1271dc544271f29bde796e2ccebe7adec6a4242

commit c1271dc544271f29bde796e2ccebe7adec6a4242
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Tue Jul 31 20:58:49 2018

RC: Allow the Frozen->Active user-initiated transitions.

This makes TabManager aware of the navigation events happening on a
frozen tab (e.g. by right-clicking + choosing reload on a frozen tab).

Bug: 775644, 867647
Change-Id: I3877a40884f4c365390202bd5a1d696b17c69b54
Reviewed-on: https://chromium-review.googlesource.com/1133958
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/heads/master@{#579561}
[modify] https://crrev.com/c1271dc544271f29bde796e2ccebe7adec6a4242/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/c1271dc544271f29bde796e2ccebe7adec6a4242/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/c1271dc544271f29bde796e2ccebe7adec6a4242/chrome/browser/resource_coordinator/tab_manager_browsertest.cc

Project Member

Comment 101 by bugdroid1@chromium.org, Aug 2

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b2e2a73c1f083ba8608d77cf4d74a7c3d9df705c

commit b2e2a73c1f083ba8608d77cf4d74a7c3d9df705c
Author: Sebastien Marchand <sebmarchand@chromium.org>
Date: Thu Aug 02 20:00:57 2018

RC: Allow the Frozen->Active user-initiated transitions.

This makes TabManager aware of the navigation events happening on a
frozen tab (e.g. by right-clicking + choosing reload on a frozen tab).

Bug: 775644, 867647
Change-Id: I3877a40884f4c365390202bd5a1d696b17c69b54
Reviewed-on: https://chromium-review.googlesource.com/1133958
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#579561}(cherry picked from commit c1271dc544271f29bde796e2ccebe7adec6a4242)
Reviewed-on: https://chromium-review.googlesource.com/1161124
Reviewed-by: Sébastien Marchand <sebmarchand@chromium.org>
Cr-Commit-Position: refs/branch-heads/3497@{#349}
Cr-Branched-From: 271eaf50594eb818c9295dc78d364aea18c82ea8-refs/heads/master@{#576753}
[modify] https://crrev.com/b2e2a73c1f083ba8608d77cf4d74a7c3d9df705c/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/b2e2a73c1f083ba8608d77cf4d74a7c3d9df705c/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/b2e2a73c1f083ba8608d77cf4d74a7c3d9df705c/chrome/browser/resource_coordinator/tab_manager_browsertest.cc

Components: Internals>ResourceCoordinator
Project Member

Comment 103 by bugdroid1@chromium.org, Aug 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4e6b50ac1cc073c2bd33d56deeb26ce27881ce66

commit 4e6b50ac1cc073c2bd33d56deeb26ce27881ce66
Author: Francois Doray <fdoray@chromium.org>
Date: Mon Aug 27 17:38:54 2018

[Lifecycle] Update testing config for proactive freeze and discard experiment.

This updates field_trial_testing_config.json with the parameters that we
plan to use to experiment with proactive freeze and discard on beta.

PageAlmostIdle feature is independant from ProactiveTabFreezeAndDiscard.

SiteCharacteristicsDatabase feature is required to enable
ProactiveTabFreezeAndDiscard, so they need to be enabled by the same
study.

stop-non-timers-in-background defines the effect of freezing a tab,
so it needs to be in the same study as ProactiveTabFreezeAndDiscard.

Bug: 775644
Change-Id: I8ef64a716585a6284e9744c93cf5dfc58a22f77f
Reviewed-on: https://chromium-review.googlesource.com/1188862
Commit-Queue: François Doray <fdoray@chromium.org>
Reviewed-by: Gayane Petrosyan <gayane@chromium.org>
Cr-Commit-Position: refs/heads/master@{#586299}
[modify] https://crrev.com/4e6b50ac1cc073c2bd33d56deeb26ce27881ce66/testing/variations/fieldtrial_testing_config.json

My corp machine is in the ProactiveTabFreezeAndDiscard-FreezeAndDiscardHighTabCountOnlyAggressive9_Dogfood group. I have to say, this is *really really* irritating. I have a number of crbug.com tabs and code review tabs open that I go back to throughout the day, and every single one needs to be reloaded when I go back to it. I'm on the verge of manually overriding the experiment using disable-features.

That might suggest the heuristics that a tab is unlikely to be used again aren't all that accurate....
Could you share the content of chrome:://discards ? Feel free to remove the URLs if you don't want to share them. This is really not the expected behavior.
My chrome://discards is attached. I'm on Mac OS X Dev 70.0.3538.9 and there are 77 tabs all up in discards (I'm not sure if that's high or low or when it's refreshed). If this is only during the current session of Chrome, I restarted my browser this morning and it's been up for about 9 hours so far.
Discards.html
136 KB View Download
Thanks for the data! It looks like all the discarded tabs haven't been used for more than 8 hours, which shouldn't cause any reload during the same day? (the time here is relative to the active usage time of Chrome, the timer stop when you stop using Chrome for more than 5 minutes). 

Could it be a session restore issue? E.g. some tabs not being loaded when you restart Chrome and so they to be loaded the first time you navigate to them.

Note that we will soon stop the discarding experiments and only enable tab freezing, if the current feature is too painful then I'd recommend switching  chrome://flags/#proactive-tab-freeze-and-discard to "Enabled Freeze only" (AFAWK there's no negative side effects associated with tab freezing and this has a clear performance impact).

Thanks
Showing comments 8 - 107 of 107 Older

Sign in to add a comment