Chromium Code Reviews| Index: content/browser/renderer_host/render_process_host_impl.cc |
| diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc |
| index 2d679e3236f31b2710423d7f5d4cf2d2d85d1a73..dbee07e5bcdf0af6894c1893fca4886b13085f6a 100644 |
| --- a/content/browser/renderer_host/render_process_host_impl.cc |
| +++ b/content/browser/renderer_host/render_process_host_impl.cc |
| @@ -993,6 +993,8 @@ bool RenderProcessHostImpl::Init() { |
| is_initialized_ = true; |
| init_time_ = base::TimeTicks::Now(); |
| + last_purged_and_suspended_time_ = base::TimeTicks::FromInternalValue(0); |
| + last_resumed_time_ = last_purged_and_suspended_time_; |
|
hajimehoshi
2016/09/30 11:22:46
Is this updated when the tab is foregrounded and r
tasak
2016/10/03 05:44:16
No. This is only updated when the tab is backgroun
|
| return true; |
| } |
| @@ -1428,6 +1430,21 @@ bool RenderProcessHostImpl::IsWorkerRefCountDisabled() { |
| void RenderProcessHostImpl::PurgeAndSuspend() { |
| Send(new ChildProcessMsg_PurgeAndSuspend()); |
| + last_purged_and_suspended_time_ = base::TimeTicks::Now(); |
| +} |
| + |
| +void RenderProcessHostImpl::Resume() { |
| + Send(new ChildProcessMsg_Resume()); |
| + last_resumed_time_ = base::TimeTicks::Now(); |
| +} |
| + |
| +const base::TimeTicks& RenderProcessHostImpl::GetLastPurgedAndSuspendedTime() |
| + const { |
| + return last_purged_and_suspended_time_; |
| +} |
| + |
| +const base::TimeTicks& RenderProcessHostImpl::GetLastResumedTime() const { |
| + return last_resumed_time_; |
| } |
| mojom::RouteProvider* RenderProcessHostImpl::GetRemoteRouteProvider() { |