Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index c81e108be2fee15ac2e233e91f3a4035618ed098..cb92fc64457ec55190201ffa036cdde30d9e406c 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -811,6 +811,8 @@ void RenderThreadImpl::Init( |
service_registry()->ConnectToRemoteService( |
mojo::GetProxy(&storage_partition_service_)); |
+ |
+ is_cache_purged_ = false; |
} |
RenderThreadImpl::~RenderThreadImpl() { |
@@ -1679,10 +1681,21 @@ bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) { |
void RenderThreadImpl::OnProcessBackgrounded(bool backgrounded) { |
ChildThreadImpl::OnProcessBackgrounded(backgrounded); |
- if (backgrounded) |
+ if (backgrounded) { |
renderer_scheduler_->OnRendererBackgrounded(); |
- else |
+ } else { |
renderer_scheduler_->OnRendererForegrounded(); |
+ is_cache_purged_ = false; |
+ } |
+} |
+ |
+void RenderThreadImpl::OnProcessPurgeAndSuspend() { |
+ ChildThreadImpl::OnProcessPurgeAndSuspend(); |
+ if (is_cache_purged_) |
+ return; |
+ // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077) |
+ is_cache_purged_ = true; |
+ renderer_scheduler_->SuspendRendererWhenBackgrounded(); |
dcheng
2016/05/10 16:28:06
Will we ever send a "purge and suspend" to a non-b
hajimehoshi
2016/05/11 07:23:31
Good point. Done by adding |is_backgrounded_|.
|
} |
void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { |