Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(918)

Unified Diff: content/browser/renderer_host/render_process_host_impl.cc

Issue 2387603003: Resume a backgrounded renderer that was purged and suspended (Closed)
Patch Set: Add Resume Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698