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

Side by Side Diff: content/renderer/render_thread_impl.cc

Issue 2387603003: Resume a backgrounded renderer that was purged and suspended (Closed)
Patch Set: Fixed comment. 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_thread_impl.h" 5 #include "content/renderer/render_thread_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 #include <map> 9 #include <map>
10 #include <utility> 10 #include <utility>
(...skipping 1758 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 1769
1770 void RenderThreadImpl::OnProcessPurgeAndSuspend() { 1770 void RenderThreadImpl::OnProcessPurgeAndSuspend() {
1771 ChildThreadImpl::OnProcessPurgeAndSuspend(); 1771 ChildThreadImpl::OnProcessPurgeAndSuspend();
1772 if (is_renderer_suspended_) 1772 if (is_renderer_suspended_)
1773 return; 1773 return;
1774 // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077) 1774 // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077)
1775 is_renderer_suspended_ = true; 1775 is_renderer_suspended_ = true;
1776 renderer_scheduler_->SuspendRenderer(); 1776 renderer_scheduler_->SuspendRenderer();
1777 } 1777 }
1778 1778
1779 void RenderThreadImpl::OnProcessResume() {
1780 ChildThreadImpl::OnProcessResume();
1781 if (!is_renderer_suspended_)
1782 return;
1783
1784 is_renderer_suspended_ = false;
1785 renderer_scheduler_->ResumeRenderer();
1786 }
1787
1779 void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { 1788 void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) {
1780 // Debug cases of https://crbug.com/626802. 1789 // Debug cases of https://crbug.com/626802.
1781 base::debug::SetCrashKeyValue("newframe_routing_id", 1790 base::debug::SetCrashKeyValue("newframe_routing_id",
1782 base::IntToString(params.routing_id)); 1791 base::IntToString(params.routing_id));
1783 base::debug::SetCrashKeyValue("newframe_proxy_id", 1792 base::debug::SetCrashKeyValue("newframe_proxy_id",
1784 base::IntToString(params.proxy_routing_id)); 1793 base::IntToString(params.proxy_routing_id));
1785 base::debug::SetCrashKeyValue("newframe_opener_id", 1794 base::debug::SetCrashKeyValue("newframe_opener_id",
1786 base::IntToString(params.opener_routing_id)); 1795 base::IntToString(params.opener_routing_id));
1787 base::debug::SetCrashKeyValue("newframe_parent_id", 1796 base::debug::SetCrashKeyValue("newframe_parent_id",
1788 base::IntToString(params.parent_routing_id)); 1797 base::IntToString(params.parent_routing_id));
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
2331 } 2340 }
2332 } 2341 }
2333 2342
2334 void RenderThreadImpl::OnRendererInterfaceRequest( 2343 void RenderThreadImpl::OnRendererInterfaceRequest(
2335 mojom::RendererAssociatedRequest request) { 2344 mojom::RendererAssociatedRequest request) {
2336 DCHECK(!renderer_binding_.is_bound()); 2345 DCHECK(!renderer_binding_.is_bound());
2337 renderer_binding_.Bind(std::move(request)); 2346 renderer_binding_.Bind(std::move(request));
2338 } 2347 }
2339 2348
2340 } // namespace content 2349 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698