| 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 <vector> | 10 #include <vector> |
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1185 } | 1185 } |
| 1186 | 1186 |
| 1187 base::allocator::ReleaseFreeMemory(); | 1187 base::allocator::ReleaseFreeMemory(); |
| 1188 discardable_shared_memory_manager()->ReleaseFreeMemory(); | 1188 discardable_shared_memory_manager()->ReleaseFreeMemory(); |
| 1189 | 1189 |
| 1190 // Continue the idle timer if the webkit shared timer is not suspended or | 1190 // Continue the idle timer if the webkit shared timer is not suspended or |
| 1191 // something is left to do. | 1191 // something is left to do. |
| 1192 bool continue_timer = !webkit_shared_timer_suspended_; | 1192 bool continue_timer = !webkit_shared_timer_suspended_; |
| 1193 | 1193 |
| 1194 if (blink::mainThreadIsolate() && | 1194 if (blink::mainThreadIsolate() && |
| 1195 !blink::mainThreadIsolate()->IdleNotification(1000)) { | 1195 !blink::mainThreadIsolate()->IdleNotificationDeadline( |
| 1196 blink_platform_impl_->monotonicallyIncreasingTime() + 1.0)) { |
| 1196 continue_timer = true; | 1197 continue_timer = true; |
| 1197 } | 1198 } |
| 1198 | 1199 |
| 1199 // Schedule next invocation. When the tab is originally hidden, an invocation | 1200 // Schedule next invocation. When the tab is originally hidden, an invocation |
| 1200 // is scheduled for kInitialIdleHandlerDelayMs in | 1201 // is scheduled for kInitialIdleHandlerDelayMs in |
| 1201 // RenderThreadImpl::WidgetHidden in order to race to a minimal heap. | 1202 // RenderThreadImpl::WidgetHidden in order to race to a minimal heap. |
| 1202 // After that, idle calls can be much less frequent, so run at a maximum of | 1203 // After that, idle calls can be much less frequent, so run at a maximum of |
| 1203 // once every kLongIdleHandlerDelayMs. | 1204 // once every kLongIdleHandlerDelayMs. |
| 1204 // Dampen the delay using the algorithm (if delay is in seconds): | 1205 // Dampen the delay using the algorithm (if delay is in seconds): |
| 1205 // delay = delay + 1 / (delay + 2) | 1206 // delay = delay + 1 / (delay + 2) |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1851 } | 1852 } |
| 1852 | 1853 |
| 1853 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { | 1854 void RenderThreadImpl::PendingRenderFrameConnect::OnConnectionError() { |
| 1854 size_t erased = | 1855 size_t erased = |
| 1855 RenderThreadImpl::current()->pending_render_frame_connects_.erase( | 1856 RenderThreadImpl::current()->pending_render_frame_connects_.erase( |
| 1856 routing_id_); | 1857 routing_id_); |
| 1857 DCHECK_EQ(1u, erased); | 1858 DCHECK_EQ(1u, erased); |
| 1858 } | 1859 } |
| 1859 | 1860 |
| 1860 } // namespace content | 1861 } // namespace content |
| OLD | NEW |