New issue
Advanced search Search tips

Issue 804976 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Sep 12
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Extend chrome://discards to handle full lifecycle: stop, resume etc

Project Member Reported by panicker@chromium.org, Jan 23 2018

Issue description

In addition - we want to be able to trigger all active / in-progress chrome interventions:
- stop timer tasks, loading tasks
- throttle web-worker 
etc.

 
Cc: -fmea...@chromium.org
Owner: fmea...@chromium.org
feel free to dup if you already have another bug for this.
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 10 2018

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

commit a6573e033d821f24d914ff8142387fcca691f5d8
Author: Fadi Meawad <fmeawad@chromium.org>
Date: Sat Mar 10 00:52:11 2018

[PageLifecycle] Enable Freezing tabs from the TabManager

This CL allows the TabManager to freeze a specific tab, it also extends
the chrome://discards UI to freeze a selected tab.

What this CL does:
- It calls the WebViewScheduler::SetPageFrozen.
- It reaches all the WebViewSchedulers in the page including the ones
  out-of-process.
- That in turns fires the window.onfreeze callback with its current and
  future restrictions
- It enables the TabManager to freeze a tab instead of discarding it if
  it sees fit
- It allows developers to test the onfreeze callback from the
  chrome://discards page

What this CL does not do:
- It does not actually freeze the page, as this logic needs to be
  migrated from the RendererSchedulerImpl down to the FrameSchedulerImpl
- It does not propagate the lifecycle state back to the TabManager

Both of them are coming up in follow up CLs

Bug:  chromium:804976 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ide3963dbe65b3adc1a5aa99dd0bdaca8f7bae9df
Reviewed-on: https://chromium-review.googlesource.com/924274
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#542300}
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/resource_coordinator/tab_manager_browsertest.cc
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/content/browser/web_contents/web_contents_impl.cc
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/content/browser/web_contents/web_contents_impl.h
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/content/common/page_messages.h
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/content/public/browser/web_contents.h
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/content/renderer/render_view_impl.cc
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/content/renderer/render_view_impl.h
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/third_party/WebKit/Source/core/exported/WebViewImpl.h
[modify] https://crrev.com/a6573e033d821f24d914ff8142387fcca691f5d8/third_party/WebKit/public/web/WebView.h

Project Member

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

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

commit a911a5d9273b5649c9087a0eced216cd7538bcbf
Author: Fadi Meawad <fmeawad@chromium.org>
Date: Fri Apr 06 19:43:20 2018

[PageLifecycle] Always unfreeze visible pages

Until recently, the RendererSchedulerImpl was the sole responsible for
freezing/unfreezing (resuming) the pages. But recently we have
introduced logic that can freeze the page directly (i.e. not through RSI)
from the TabManager.

This CL allows frozen pages to automatically resume if they become
visible regardless of the freezing origin.

Bug:  chromium:804976 
Change-Id: I136676f176416d40e45b88a5dab57fea22a810fc
Reviewed-on: https://chromium-review.googlesource.com/991077
Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Shubhie Panicker <panicker@chromium.org>
Cr-Commit-Position: refs/heads/master@{#548906}
[modify] https://crrev.com/a911a5d9273b5649c9087a0eced216cd7538bcbf/third_party/WebKit/Source/platform/scheduler/main_thread/frame_scheduler_impl.cc
[modify] https://crrev.com/a911a5d9273b5649c9087a0eced216cd7538bcbf/third_party/WebKit/Source/platform/scheduler/main_thread/page_scheduler_impl.cc
[modify] https://crrev.com/a911a5d9273b5649c9087a0eced216cd7538bcbf/third_party/WebKit/Source/platform/scheduler/main_thread/page_scheduler_impl.h
[modify] https://crrev.com/a911a5d9273b5649c9087a0eced216cd7538bcbf/third_party/WebKit/Source/platform/scheduler/main_thread/page_scheduler_impl_unittest.cc

Status: Started (was: Available)
Project Member

Comment 5 by bugdroid1@chromium.org, May 4 2018

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

commit 686a5f7b76906307dfa670b5661033d291c1a47e
Author: Fadi Meawad <fmeawad@chromium.org>
Date: Fri May 04 16:37:59 2018

[PageLifecycle] Update the TabManager with the page freezing state

In this CL, each frame updates its FrameResourceCoordinator with any
updates the lifecycle state. If the main frame lifecycle state is
updated, then the page inherit the new state.

The PageSignalGeneratorImpl then updates the state in TabLifecycleUnit
which is used by the chrome:://discards UI.

The CL also disables freezing a Tab that is already frozen.

Bug:  chromium:804976 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Iba82286a06af17ccb74a7f6fac18cdb7914c003a
Reviewed-on: https://chromium-review.googlesource.com/942022
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: Shubhie Panicker <panicker@chromium.org>
Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556084}
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/lifecycle_unit_observer.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/lifecycle_unit_observer.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/page_signal_receiver.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/page_signal_receiver.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/chrome/test/data/webui/discards/discards_browsertest.js
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl_unittest.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/observers/page_signal_generator_impl.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/observers/page_signal_generator_impl.h
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/public/mojom/BUILD.gn
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/public/mojom/coordination_unit.mojom
[add] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/public/mojom/lifecycle.mojom
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/public/mojom/page_signal.mojom
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/services/resource_coordinator/public/mojom/signals.mojom
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/third_party/blink/renderer/platform/instrumentation/resource_coordinator/frame_resource_coordinator.cc
[modify] https://crrev.com/686a5f7b76906307dfa670b5661033d291c1a47e/third_party/blink/renderer/platform/instrumentation/resource_coordinator/frame_resource_coordinator.h

Project Member

Comment 6 by bugdroid1@chromium.org, May 4 2018

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

commit acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08
Author: CJ DiMeglio <lethalantidote@chromium.org>
Date: Fri May 04 19:17:23 2018

Revert "[PageLifecycle] Update the TabManager with the page freezing state"

This reverts commit 686a5f7b76906307dfa670b5661033d291c1a47e.

Reason for revert: suspected cause for https://ci.chromium.org/buildbot/chromium.webkit/WebKit%20Win10/ failures

external/wpt/websockets/constructor/014.html?wss ( Code Search )
external/wpt/websockets/keeping-connection-open/001.html?wss ( Code Search )
virtual/off-main-thread-websocket/external/wpt/websockets/constructor/014.html?wss ( Code Search )
virtual/off-main-thread-websocket/external/wpt/websockets/keeping-connection-open/001.html?wss ( Code Search )

Original change's description:
> [PageLifecycle] Update the TabManager with the page freezing state
> 
> In this CL, each frame updates its FrameResourceCoordinator with any
> updates the lifecycle state. If the main frame lifecycle state is
> updated, then the page inherit the new state.
> 
> The PageSignalGeneratorImpl then updates the state in TabLifecycleUnit
> which is used by the chrome:://discards UI.
> 
> The CL also disables freezing a Tab that is already frozen.
> 
> Bug:  chromium:804976 
> Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
> Change-Id: Iba82286a06af17ccb74a7f6fac18cdb7914c003a
> Reviewed-on: https://chromium-review.googlesource.com/942022
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: François Doray <fdoray@chromium.org>
> Reviewed-by: Chris Hamilton <chrisha@chromium.org>
> Reviewed-by: Shubhie Panicker <panicker@chromium.org>
> Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#556084}

TBR=dcheng@chromium.org,chrisha@chromium.org,fdoray@chromium.org,fmeawad@chromium.org,altimin@chromium.org,panicker@chromium.org

Change-Id: Id1f8907c265e249d4bbe87cf514d66e6612fe18a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug:  chromium:804976 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Reviewed-on: https://chromium-review.googlesource.com/1044573
Reviewed-by: CJ DiMeglio <lethalantidote@chromium.org>
Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556144}
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/lifecycle_unit_observer.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/lifecycle_unit_observer.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/page_signal_receiver.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/page_signal_receiver.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/chrome/test/data/webui/discards/discards_browsertest.js
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl_unittest.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/observers/page_signal_generator_impl.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/observers/page_signal_generator_impl.h
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/public/mojom/BUILD.gn
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/public/mojom/coordination_unit.mojom
[delete] https://crrev.com/9e9e53c7bfcf539219bf57c020abe6c6a4bc439c/services/resource_coordinator/public/mojom/lifecycle.mojom
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/public/mojom/page_signal.mojom
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/services/resource_coordinator/public/mojom/signals.mojom
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/third_party/blink/renderer/platform/instrumentation/resource_coordinator/frame_resource_coordinator.cc
[modify] https://crrev.com/acfc35c6419c00ddaa8bbaa935eb0cce3aeb9c08/third_party/blink/renderer/platform/instrumentation/resource_coordinator/frame_resource_coordinator.h

Project Member

Comment 7 by bugdroid1@chromium.org, May 4 2018

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

commit f4b58aece2d7374c70b856c456adb3c901c95041
Author: Fadi Meawad <fmeawad@chromium.org>
Date: Fri May 04 22:34:45 2018

Reland "[PageLifecycle] Update the TabManager with the page freezing state"

This is a reland of 686a5f7b76906307dfa670b5661033d291c1a47e

Relanding as is as the failure recovered before the revert did.

Original change's description:
> [PageLifecycle] Update the TabManager with the page freezing state
>
> In this CL, each frame updates its FrameResourceCoordinator with any
> updates the lifecycle state. If the main frame lifecycle state is
> updated, then the page inherit the new state.
>
> The PageSignalGeneratorImpl then updates the state in TabLifecycleUnit
> which is used by the chrome:://discards UI.
>
> The CL also disables freezing a Tab that is already frozen.
>
> Bug:  chromium:804976 
> Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
> Change-Id: Iba82286a06af17ccb74a7f6fac18cdb7914c003a
> Reviewed-on: https://chromium-review.googlesource.com/942022
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Reviewed-by: François Doray <fdoray@chromium.org>
> Reviewed-by: Chris Hamilton <chrisha@chromium.org>
> Reviewed-by: Shubhie Panicker <panicker@chromium.org>
> Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#556084}

Bug:  chromium:804976 
Change-Id: If64bd40453211d40aef584c20f6055f0679732b1
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation

TBR=dcheng@chromium.org, chrisha@chromium.org, fdoray@chromium.org, panicker@chromium.org

Change-Id: If64bd40453211d40aef584c20f6055f0679732b1
Reviewed-on: https://chromium-review.googlesource.com/1044728
Reviewed-by: Fadi Meawad <fmeawad@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#556221}
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/lifecycle_unit_observer.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/lifecycle_unit_observer.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/page_signal_receiver.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/page_signal_receiver.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit_external.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit_source.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resource_coordinator/tab_manager_delegate_chromeos_unittest.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/chrome/test/data/webui/discards/discards_browsertest.js
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/coordination_unit/frame_coordination_unit_impl_unittest.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/observers/page_signal_generator_impl.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/observers/page_signal_generator_impl.h
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/public/mojom/BUILD.gn
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/public/mojom/coordination_unit.mojom
[add] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/public/mojom/lifecycle.mojom
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/public/mojom/page_signal.mojom
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/services/resource_coordinator/public/mojom/signals.mojom
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/third_party/blink/renderer/core/frame/local_frame.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/third_party/blink/renderer/platform/instrumentation/resource_coordinator/frame_resource_coordinator.cc
[modify] https://crrev.com/f4b58aece2d7374c70b856c456adb3c901c95041/third_party/blink/renderer/platform/instrumentation/resource_coordinator/frame_resource_coordinator.h

Project Member

Comment 8 by bugdroid1@chromium.org, May 30 2018

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

commit 9c029de78353a5a8f1bf3e61b540adcdce4ef9c4
Author: Fadi Meawad <fmeawad@chromium.org>
Date: Wed May 30 20:47:23 2018

Merge discarded and frozen states in the chrome://discards UI

The frozen states and the discarded states are mutually exclusive. The
CL merges the 2 booleans into one "state" column instead, and tracks
the transition states as well.

Instead of creating an new mojo enum for the lifecycle state in
discards.mojom, I have moved the existing enum to to become a mojo enum
that can be used in both locations and avoid conversion.

Bug:  chromium:804976 
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: I32cf0e3f24fc921270533046351f57079be20d5a
Reviewed-on: https://chromium-review.googlesource.com/1054183
Reviewed-by: Robert Kaplow <rkaplow@chromium.org>
Reviewed-by: Chris Hamilton <chrisha@chromium.org>
Reviewed-by: John Abd-El-Malek <jam@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Commit-Queue: Fadi Meawad <fmeawad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#562986}
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/BUILD.gn
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/browser_resources.grd
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/BUILD.gn
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/OWNERS
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer.h
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/discard_metrics_lifecycle_unit_observer_unittest.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit.h
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit_base.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit_base.h
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit_base_unittest.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit_observer.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit_observer.h
[rename] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/lifecycle_unit_state.mojom
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/tab_lifecycle_unit.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/tab_lifecycle_unit_source_unittest.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/tab_lifecycle_unit_unittest.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/tab_manager.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resource_coordinator/tab_manager.h
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resources/discards/discards.html
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/resources/discards/discards.js
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/ui/webui/discards/BUILD.gn
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/ui/webui/discards/discards.mojom
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/browser/ui/webui/discards/discards_ui.cc
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/chrome/test/data/webui/discards/discards_browsertest.js
[modify] https://crrev.com/9c029de78353a5a8f1bf3e61b540adcdce4ef9c4/tools/metrics/ukm/ukm.xml

Cc: fmea...@chromium.org
Owner: ----
Status: Available (was: Started)
We have added the freezing to the discarding states, but not throttling.

This can either be marked as fixed, or available if there is still interest in adding throttling.

Leaving as available for now.
Status: Fixed (was: Available)

Sign in to add a comment