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

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

Issue 1028373002: Replace IdleNotification calls with IdleNotificationDeadline (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <vector> 10 #include <vector>
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698