| OLD | NEW |
| 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 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1688 } else { | 1688 } else { |
| 1689 renderer_scheduler_->OnRendererForegrounded(); | 1689 renderer_scheduler_->OnRendererForegrounded(); |
| 1690 is_renderer_suspended_ = false; | 1690 is_renderer_suspended_ = false; |
| 1691 } | 1691 } |
| 1692 } | 1692 } |
| 1693 | 1693 |
| 1694 void RenderThreadImpl::OnProcessPurgeAndSuspend() { | 1694 void RenderThreadImpl::OnProcessPurgeAndSuspend() { |
| 1695 ChildThreadImpl::OnProcessPurgeAndSuspend(); | 1695 ChildThreadImpl::OnProcessPurgeAndSuspend(); |
| 1696 if (is_renderer_suspended_) | 1696 if (is_renderer_suspended_) |
| 1697 return; | 1697 return; |
| 1698 // TODO(hajimehoshi): Implement purging e.g. cache (crbug/607077) | 1698 // Use ChildMemoryCoordinator to free this renderer's caches as much as |
| 1699 // possible before suspending the renderer. |
| 1700 memory_coordinator::ChildMemoryCoordinatorImpl::GetInstance() |
| 1701 ->PrepareToSuspend(); |
| 1702 |
| 1699 is_renderer_suspended_ = true; | 1703 is_renderer_suspended_ = true; |
| 1700 renderer_scheduler_->SuspendRenderer(); | 1704 renderer_scheduler_->SuspendRenderer(); |
| 1701 } | 1705 } |
| 1702 | 1706 |
| 1703 void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { | 1707 void RenderThreadImpl::OnCreateNewFrame(FrameMsg_NewFrame_Params params) { |
| 1704 // Debug cases of https://crbug.com/626802. | 1708 // Debug cases of https://crbug.com/626802. |
| 1705 base::debug::SetCrashKeyValue("newframe_routing_id", | 1709 base::debug::SetCrashKeyValue("newframe_routing_id", |
| 1706 base::IntToString(params.routing_id)); | 1710 base::IntToString(params.routing_id)); |
| 1707 base::debug::SetCrashKeyValue("newframe_proxy_id", | 1711 base::debug::SetCrashKeyValue("newframe_proxy_id", |
| 1708 base::IntToString(params.proxy_routing_id)); | 1712 base::IntToString(params.proxy_routing_id)); |
| (...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2244 if (blink::mainThreadIsolate()) { | 2248 if (blink::mainThreadIsolate()) { |
| 2245 blink::mainThreadIsolate()->MemoryPressureNotification( | 2249 blink::mainThreadIsolate()->MemoryPressureNotification( |
| 2246 v8::MemoryPressureLevel::kCritical); | 2250 v8::MemoryPressureLevel::kCritical); |
| 2247 blink::MemoryPressureNotificationToWorkerThreadIsolates( | 2251 blink::MemoryPressureNotificationToWorkerThreadIsolates( |
| 2248 v8::MemoryPressureLevel::kCritical); | 2252 v8::MemoryPressureLevel::kCritical); |
| 2249 } | 2253 } |
| 2250 } | 2254 } |
| 2251 | 2255 |
| 2252 | 2256 |
| 2253 } // namespace content | 2257 } // namespace content |
| OLD | NEW |