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

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: Rebaselined Created 4 years, 2 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 d9d08837604403d2782db63eee0e53d20a7a2c5d..8c9593204b3c492bd199b6af3eabbf4b5029457a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -925,6 +925,8 @@ bool RenderProcessHostImpl::Init() {
is_initialized_ = true;
init_time_ = base::TimeTicks::Now();
+ last_purged_and_suspended_time_ = base::TimeTicks::FromInternalValue(0);
+ last_resumed_in_background_time_ = last_purged_and_suspended_time_;
return true;
}
@@ -1411,6 +1413,22 @@ 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_in_background_time_ = base::TimeTicks::Now();
+}
+
+const base::TimeTicks& RenderProcessHostImpl::GetLastPurgedAndSuspendedTime()
+ const {
+ return last_purged_and_suspended_time_;
+}
+
+const base::TimeTicks& RenderProcessHostImpl::GetLastResumedInBackgroundTime()
+ const {
+ return last_resumed_in_background_time_;
}
mojom::Renderer* RenderProcessHostImpl::GetRendererInterface() {

Powered by Google App Engine
This is Rietveld 408576698