Index: content/renderer/render_thread_impl.cc |
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc |
index 795e8cf02aa0fd970425b9f434fee33c8c173294..14c2a27266f2567e14dbb56a9049c5b3f3e69f2d 100644 |
--- a/content/renderer/render_thread_impl.cc |
+++ b/content/renderer/render_thread_impl.cc |
@@ -822,6 +822,8 @@ void RenderThreadImpl::Init( |
service_registry()->ConnectToRemoteService( |
mojo::GetProxy(&storage_partition_service_)); |
+ |
+ is_cache_purged_ = false; |
} |
RenderThreadImpl::~RenderThreadImpl() { |
@@ -1707,10 +1709,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; |
haraken
2016/05/13 07:23:32
Nit: It would make more sense to rename this to is
hajimehoshi
2016/05/13 07:36:04
Done.
|
+ renderer_scheduler_->SuspendRenderer(); |
} |
void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { |