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