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

Unified Diff: chrome/renderer/render_thread.h

Issue 174303: Modify the RenderThread to track the number of widgets... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/mock_render_thread.h ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_thread.h
===================================================================
--- chrome/renderer/render_thread.h (revision 24223)
+++ chrome/renderer/render_thread.h (working copy)
@@ -49,6 +49,10 @@
virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) = 0;
virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) = 0;
+
+ // Called by a RenderWidget when it is hidden or restored.
+ virtual void WidgetHidden() = 0;
+ virtual void WidgetRestored() = 0;
};
// The RenderThread class represents a background thread where RenderView
@@ -79,15 +83,20 @@
}
virtual void AddRoute(int32 routing_id, IPC::Channel::Listener* listener) {
+ widget_count_++;
return ChildThread::AddRoute(routing_id, listener);
}
virtual void RemoveRoute(int32 routing_id) {
+ widget_count_--;
return ChildThread::RemoveRoute(routing_id);
}
virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter);
virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter);
+ virtual void WidgetHidden();
+ virtual void WidgetRestored();
+
VisitedLinkSlave* visited_link_slave() const {
return visited_link_slave_.get();
}
@@ -163,8 +172,11 @@
// We initialize WebKit as late as possible.
void EnsureWebKitInitialized();
+ // A task we invoke periodically to assist with idle cleanup.
+ void IdleHandler();
+
// These objects live solely on the render thread.
- scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > cache_stats_factory_;
+ scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_;
scoped_ptr<VisitedLinkSlave> visited_link_slave_;
scoped_ptr<UserScriptSlave> user_script_slave_;
scoped_ptr<RenderDnsMaster> dns_master_;
@@ -183,6 +195,18 @@
// If true, then a GetPlugins call is allowed to rescan the disk.
bool plugin_refresh_allowed_;
+ // Is there a pending task for doing CacheStats.
+ bool cache_stats_task_pending_;
+
+ // The count of RenderWidgets running through this thread.
+ int widget_count_;
+
+ // The count of hidden RenderWidgets running through this thread.
+ int hidden_widget_count_;
+
+ // The current value of the idle notification timer delay.
+ double idle_notification_delay_in_s_;
+
DISALLOW_COPY_AND_ASSIGN(RenderThread);
};
« no previous file with comments | « chrome/renderer/mock_render_thread.h ('k') | chrome/renderer/render_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698