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

Unified Diff: content/renderer/render_thread_impl.h

Issue 8513008: Schedule idle handler in the foreground tab based on CPU usage and user activity. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove redundant 'using' and rebase Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/idle_user_detector.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_thread_impl.h
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index b62878d0bbe69018db6657ddcfd24fbf22092ba2..e35a1822f0c9860fe44a697e6292a34cab5a5cbd 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -42,6 +42,7 @@ class WebStorageEventDispatcher;
}
namespace base {
+class ProcessMetrics;
class MessageLoopProxy;
class Thread;
namespace win {
@@ -167,6 +168,11 @@ class CONTENT_EXPORT RenderThreadImpl : public content::RenderThread,
// on the renderer's main thread.
scoped_refptr<base::MessageLoopProxy> GetFileThreadMessageLoopProxy();
+ // Causes the idle handler to skip sending idle notifications
+ // on the two next scheduled calls, so idle notifications are
+ // not sent for at least one notification delay.
+ void PostponeIdleNotification();
+
private:
virtual bool OnControlMessageReceived(const IPC::Message& msg) OVERRIDE;
@@ -183,6 +189,8 @@ class CONTENT_EXPORT RenderThreadImpl : public content::RenderThread,
void OnGetAccessibilityTree();
void OnTempCrashWithData(const GURL& data);
+ void IdleHandlerInForegroundTab();
+
// These objects live solely on the render thread.
scoped_ptr<ScopedRunnableMethodFactory<RenderThreadImpl> > task_factory_;
scoped_ptr<AppCacheDispatcher> appcache_dispatcher_;
@@ -217,12 +225,17 @@ class CONTENT_EXPORT RenderThreadImpl : public content::RenderThread,
// The current value of the idle notification timer delay.
int64 idle_notification_delay_in_ms_;
+ // The number of idle handler calls that skip sending idle notifications.
+ int idle_notifications_to_skip_;
+
bool suspend_webkit_shared_timer_;
bool notify_webkit_of_modal_loop_;
// Timer that periodically calls IdleHandler.
base::RepeatingTimer<RenderThreadImpl> idle_timer_;
+ scoped_ptr<base::ProcessMetrics> process_metrics_;
+
// The channel from the renderer process to the GPU process.
scoped_refptr<GpuChannelHost> gpu_channel_;
« no previous file with comments | « content/renderer/idle_user_detector.cc ('k') | content/renderer/render_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698