[email protected] | f85f070 | 2010-01-30 09:31:01 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
[email protected] | 1d97d2e | 2008-12-18 23:39:02 | [diff] [blame] | 5 | #ifndef CHROME_RENDERER_RENDER_THREAD_H_ |
| 6 | #define CHROME_RENDERER_RENDER_THREAD_H_ |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 7 | |
[email protected] | c886596 | 2009-12-16 07:47:39 | [diff] [blame] | 8 | #include <set> |
[email protected] | b68d5ed | 2009-04-16 02:41:28 | [diff] [blame] | 9 | #include <string> |
[email protected] | 1bc8306 | 2009-02-06 00:16:37 | [diff] [blame] | 10 | #include <vector> |
| 11 | |
[email protected] | 010ea08a | 2009-10-11 20:21:32 | [diff] [blame] | 12 | #include "app/gfx/native_widget_types.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 13 | #include "base/shared_memory.h" |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 14 | #include "base/string16.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 15 | #include "base/task.h" |
[email protected] | 71d6d85 | 2009-12-07 22:12:36 | [diff] [blame] | 16 | #include "base/time.h" |
| 17 | #include "base/timer.h" |
[email protected] | 037fce0 | 2009-01-22 01:42:15 | [diff] [blame] | 18 | #include "build/build_config.h" |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 19 | #include "chrome/common/child_thread.h" |
[email protected] | b9ab10c | 2009-08-07 18:09:55 | [diff] [blame] | 20 | #include "chrome/common/css_colors.h" |
[email protected] | 4e6419c | 2010-01-15 04:50:34 | [diff] [blame] | 21 | #include "chrome/common/dom_storage_common.h" |
[email protected] | 55e57d4 | 2009-02-25 06:10:17 | [diff] [blame] | 22 | #include "chrome/renderer/renderer_histogram_snapshots.h" |
[email protected] | 3e90d4a | 2009-07-03 17:38:39 | [diff] [blame] | 23 | #include "chrome/renderer/visitedlink_slave.h" |
[email protected] | cb6037d | 2009-11-16 22:55:17 | [diff] [blame] | 24 | #include "ipc/ipc_platform_file.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 25 | |
[email protected] | 1edc16b8 | 2009-04-07 17:45:54 | [diff] [blame] | 26 | class AppCacheDispatcher; |
[email protected] | dd924193 | 2010-02-24 19:23:13 | [diff] [blame] | 27 | class CookieMessageFilter; |
[email protected] | 017022b | 2009-07-27 23:06:34 | [diff] [blame] | 28 | class DBMessageFilter; |
[email protected] | a862471 | 2009-04-17 00:51:35 | [diff] [blame] | 29 | class DevToolsAgentFilter; |
[email protected] | 39008c0 | 2009-02-11 23:59:25 | [diff] [blame] | 30 | class FilePath; |
[email protected] | dfcb62a | 2009-06-17 19:32:43 | [diff] [blame] | 31 | class ListValue; |
[email protected] | b7c7bcf | 2009-10-03 07:07:34 | [diff] [blame] | 32 | class NullableString16; |
[email protected] | 39008c0 | 2009-02-11 23:59:25 | [diff] [blame] | 33 | class RenderDnsMaster; |
[email protected] | 55e57d4 | 2009-02-25 06:10:17 | [diff] [blame] | 34 | class RendererHistogram; |
[email protected] | e2b2d4a | 2009-10-24 03:32:59 | [diff] [blame] | 35 | class RendererWebDatabaseObserver; |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 36 | class RendererWebKitClientImpl; |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 37 | class SpellCheck; |
[email protected] | 39008c0 | 2009-02-11 23:59:25 | [diff] [blame] | 38 | class SkBitmap; |
[email protected] | 4d395d09 | 2009-02-11 21:40:40 | [diff] [blame] | 39 | class UserScriptSlave; |
[email protected] | cccf9093 | 2009-08-23 17:56:25 | [diff] [blame] | 40 | class URLPattern; |
| 41 | |
[email protected] | f85f070 | 2010-01-30 09:31:01 | [diff] [blame] | 42 | struct ContentSettings; |
[email protected] | 9b6f40e | 2009-06-11 15:54:26 | [diff] [blame] | 43 | struct RendererPreferences; |
[email protected] | c61cc65 | 2009-11-04 05:44:40 | [diff] [blame] | 44 | struct ViewMsg_DOMStorageEvent_Params; |
[email protected] | 4e6419c | 2010-01-15 04:50:34 | [diff] [blame] | 45 | struct ViewMsg_New_Params; |
[email protected] | 39008c0 | 2009-02-11 23:59:25 | [diff] [blame] | 46 | struct WebPreferences; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 47 | |
[email protected] | b7c7bcf | 2009-10-03 07:07:34 | [diff] [blame] | 48 | namespace WebKit { |
| 49 | class WebStorageEventDispatcher; |
| 50 | } |
| 51 | |
[email protected] | 81a3441 | 2009-01-05 19:17:24 | [diff] [blame] | 52 | // The RenderThreadBase is the minimal interface that a RenderView/Widget |
| 53 | // expects from a render thread. The interface basically abstracts a way to send |
| 54 | // and receive messages. |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 55 | class RenderThreadBase { |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 56 | public: |
| 57 | virtual ~RenderThreadBase() {} |
| 58 | |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 59 | virtual bool Send(IPC::Message* msg) = 0; |
| 60 | |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 61 | // Called to add or remove a listener for a particular message routing ID. |
| 62 | // These methods normally get delegated to a MessageRouter. |
| 63 | virtual void AddRoute(int32 routing_id, IPC::Channel::Listener* listener) = 0; |
| 64 | virtual void RemoveRoute(int32 routing_id) = 0; |
[email protected] | 81a3441 | 2009-01-05 19:17:24 | [diff] [blame] | 65 | |
| 66 | virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter) = 0; |
| 67 | virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter) = 0; |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 68 | |
| 69 | // Called by a RenderWidget when it is hidden or restored. |
| 70 | virtual void WidgetHidden() = 0; |
| 71 | virtual void WidgetRestored() = 0; |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 72 | }; |
| 73 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 74 | // The RenderThread class represents a background thread where RenderView |
| 75 | // instances live. The RenderThread supports an API that is used by its |
| 76 | // consumer to talk indirectly to the RenderViews and supporting objects. |
| 77 | // Likewise, it provides an API for the RenderViews to talk back to the main |
[email protected] | 57c6a65 | 2009-05-04 07:58:34 | [diff] [blame] | 78 | // process (i.e., their corresponding TabContents). |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 79 | // |
| 80 | // Most of the communication occurs in the form of IPC messages. They are |
| 81 | // routed to the RenderThread according to the routing IDs of the messages. |
| 82 | // The routing IDs correspond to RenderView instances. |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 83 | class RenderThread : public RenderThreadBase, |
| 84 | public ChildThread { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 85 | public: |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 86 | // Grabs the IPC channel name from the command line. |
| 87 | RenderThread(); |
| 88 | // Constructor that's used when running in single process mode. |
[email protected] | 11f485728 | 2009-11-13 19:56:17 | [diff] [blame] | 89 | explicit RenderThread(const std::string& channel_name); |
[email protected] | 8085dbc8 | 2008-09-26 22:53:44 | [diff] [blame] | 90 | virtual ~RenderThread(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 91 | |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 92 | // Returns the one render thread for this process. Note that this should only |
| 93 | // be accessed when running on the render thread itself |
| 94 | static RenderThread* current(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 95 | |
[email protected] | c1f50aa | 2010-02-18 03:46:57 | [diff] [blame] | 96 | // Returns the routing ID of the RenderWidget containing the current script |
| 97 | // execution context (corresponding to WebFrame::frameForCurrentContext). |
| 98 | static int32 RoutingIDForCurrentContext(); |
| 99 | |
[email protected] | 4577622 | 2009-07-15 20:21:58 | [diff] [blame] | 100 | // Overridden from RenderThreadBase. |
[email protected] | c1f50aa | 2010-02-18 03:46:57 | [diff] [blame] | 101 | virtual bool Send(IPC::Message* msg); |
| 102 | virtual void AddRoute(int32 routing_id, IPC::Channel::Listener* listener); |
| 103 | virtual void RemoveRoute(int32 routing_id); |
[email protected] | 81a3441 | 2009-01-05 19:17:24 | [diff] [blame] | 104 | virtual void AddFilter(IPC::ChannelProxy::MessageFilter* filter); |
| 105 | virtual void RemoveFilter(IPC::ChannelProxy::MessageFilter* filter); |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 106 | virtual void WidgetHidden(); |
| 107 | virtual void WidgetRestored(); |
| 108 | |
[email protected] | c1f50aa | 2010-02-18 03:46:57 | [diff] [blame] | 109 | // These methods modify how the next message is sent. Normally, when sending |
| 110 | // a synchronous message that runs a nested message loop, we need to suspend |
| 111 | // callbacks into WebKit. This involves disabling timers and deferring |
| 112 | // resource loads. However, there are exceptions when we need to customize |
| 113 | // the behavior. |
| 114 | void DoNotSuspendWebKitSharedTimer(); |
| 115 | void DoNotNotifyWebKitOfModalLoop(); |
| 116 | |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 117 | VisitedLinkSlave* visited_link_slave() const { |
| 118 | return visited_link_slave_.get(); |
| 119 | } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 120 | |
[email protected] | 8d86fce | 2009-02-26 23:37:55 | [diff] [blame] | 121 | UserScriptSlave* user_script_slave() const { |
| 122 | return user_script_slave_.get(); |
| 123 | } |
[email protected] | 1e0f7040 | 2008-10-16 23:57:47 | [diff] [blame] | 124 | |
[email protected] | f430b571 | 2009-08-21 21:46:31 | [diff] [blame] | 125 | AppCacheDispatcher* appcache_dispatcher() const { |
| 126 | return appcache_dispatcher_.get(); |
| 127 | } |
| 128 | |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 129 | SpellCheck* spellchecker() const { |
| 130 | return spellchecker_.get(); |
| 131 | } |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 132 | |
[email protected] | dd924193 | 2010-02-24 19:23:13 | [diff] [blame] | 133 | CookieMessageFilter* cookie_message_filter() const { |
| 134 | return cookie_message_filter_.get(); |
| 135 | } |
| 136 | |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 137 | bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } |
| 138 | |
[email protected] | 71d6d85 | 2009-12-07 22:12:36 | [diff] [blame] | 139 | bool is_extension_process() const { return is_extension_process_; } |
| 140 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 141 | // Do DNS prefetch resolution of a hostname. |
| 142 | void Resolve(const char* name, size_t length); |
| 143 | |
[email protected] | 55e57d4 | 2009-02-25 06:10:17 | [diff] [blame] | 144 | // Send all the Histogram data to browser. |
[email protected] | c9a3ef8 | 2009-05-28 22:02:46 | [diff] [blame] | 145 | void SendHistograms(int sequence_number); |
[email protected] | 55e57d4 | 2009-02-25 06:10:17 | [diff] [blame] | 146 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 147 | // Invokes InformHostOfCacheStats after a short delay. Used to move this |
| 148 | // bookkeeping operation off the critical latency path. |
| 149 | void InformHostOfCacheStatsLater(); |
| 150 | |
[email protected] | c40acc3 | 2010-01-14 01:02:53 | [diff] [blame] | 151 | // Sends a message to the browser to close all connections. |
| 152 | void CloseCurrentConnections(); |
[email protected] | b07f2909 | 2009-06-05 07:33:21 | [diff] [blame] | 153 | |
| 154 | // Sends a message to the browser to enable or disable the disk cache. |
| 155 | void SetCacheMode(bool enabled); |
| 156 | |
[email protected] | c886596 | 2009-12-16 07:47:39 | [diff] [blame] | 157 | // Update the list of active extensions that will be reported when we crash. |
| 158 | void UpdateActiveExtensions(); |
| 159 | |
[email protected] | 8930d47 | 2009-02-21 08:05:28 | [diff] [blame] | 160 | private: |
| 161 | virtual void OnControlMessageReceived(const IPC::Message& msg); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 162 | |
[email protected] | 42f1d782 | 2009-07-23 18:17:55 | [diff] [blame] | 163 | void Init(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 164 | |
[email protected] | 176aa48 | 2008-11-14 03:25:15 | [diff] [blame] | 165 | void OnUpdateVisitedLinks(base::SharedMemoryHandle table); |
[email protected] | 3e90d4a | 2009-07-03 17:38:39 | [diff] [blame] | 166 | void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints); |
| 167 | void OnResetVisitedLinks(); |
[email protected] | 40bd658 | 2009-12-04 23:49:51 | [diff] [blame] | 168 | void OnSetZoomLevelForCurrentHost(const std::string& host, int zoom_level); |
[email protected] | f85f070 | 2010-01-30 09:31:01 | [diff] [blame] | 169 | void OnSetContentSettingsForCurrentHost( |
| 170 | const std::string& host, const ContentSettings& content_settings); |
[email protected] | 55a3569 | 2010-02-11 23:25:21 | [diff] [blame] | 171 | void OnUpdateUserScripts(base::SharedMemoryHandle table, |
| 172 | bool only_inject_incognito); |
[email protected] | 703e807a | 2009-03-28 19:56:51 | [diff] [blame] | 173 | void OnSetExtensionFunctionNames(const std::vector<std::string>& names); |
[email protected] | 4577622 | 2009-07-15 20:21:58 | [diff] [blame] | 174 | void OnPageActionsUpdated(const std::string& extension_id, |
[email protected] | b7c7bcf | 2009-10-03 07:07:34 | [diff] [blame] | 175 | const std::vector<std::string>& page_actions); |
[email protected] | c61cc65 | 2009-11-04 05:44:40 | [diff] [blame] | 176 | void OnDOMStorageEvent(const ViewMsg_DOMStorageEvent_Params& params); |
[email protected] | 75e126b93 | 2009-09-28 19:38:49 | [diff] [blame] | 177 | void OnExtensionSetAPIPermissions( |
| 178 | const std::string& extension_id, |
| 179 | const std::vector<std::string>& permissions); |
| 180 | void OnExtensionSetHostPermissions( |
| 181 | const GURL& extension_url, |
| 182 | const std::vector<URLPattern>& permissions); |
[email protected] | db7331a | 2010-02-25 22:10:50 | [diff] [blame^] | 183 | void OnExtensionSetIncognitoEnabled( |
| 184 | const std::string& extension_id, |
| 185 | bool enabled); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 186 | void OnSetNextPageID(int32 next_page_id); |
[email protected] | b9ab10c | 2009-08-07 18:09:55 | [diff] [blame] | 187 | void OnSetCSSColors(const std::vector<CSSColors::CSSColorMapping>& colors); |
[email protected] | 4e6419c | 2010-01-15 04:50:34 | [diff] [blame] | 188 | void OnCreateNewView(const ViewMsg_New_Params& params); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 189 | void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
| 190 | void OnSetCacheCapacities(size_t min_dead_capacity, |
| 191 | size_t max_dead_capacity, |
| 192 | size_t capacity); |
| 193 | void OnGetCacheResourceStats(); |
| 194 | |
[email protected] | 55e57d4 | 2009-02-25 06:10:17 | [diff] [blame] | 195 | // Send all histograms to browser. |
[email protected] | c9a3ef8 | 2009-05-28 22:02:46 | [diff] [blame] | 196 | void OnGetRendererHistograms(int sequence_number); |
[email protected] | 55e57d4 | 2009-02-25 06:10:17 | [diff] [blame] | 197 | |
[email protected] | d4104109 | 2009-10-08 06:56:57 | [diff] [blame] | 198 | // Send tcmalloc info to browser. |
| 199 | void OnGetRendererTcmalloc(); |
[email protected] | 38b48a8 | 2009-11-11 01:51:32 | [diff] [blame] | 200 | void OnGetV8HeapStats(); |
[email protected] | d4104109 | 2009-10-08 06:56:57 | [diff] [blame] | 201 | |
[email protected] | dfcb62a | 2009-06-17 19:32:43 | [diff] [blame] | 202 | void OnExtensionMessageInvoke(const std::string& function_name, |
| 203 | const ListValue& args); |
[email protected] | fede6ca1 | 2009-10-08 18:24:26 | [diff] [blame] | 204 | void OnPurgeMemory(); |
[email protected] | b78e168b | 2009-09-21 22:05:45 | [diff] [blame] | 205 | void OnPurgePluginListCache(bool reload_pages); |
[email protected] | 75e5a87 | 2009-04-02 23:56:11 | [diff] [blame] | 206 | |
[email protected] | cb6037d | 2009-11-16 22:55:17 | [diff] [blame] | 207 | void OnInitSpellChecker(IPC::PlatformFileForTransit bdict_file, |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 208 | const std::vector<std::string>& custom_words, |
| 209 | const std::string& language, |
| 210 | bool auto_spell_correct); |
| 211 | void OnSpellCheckWordAdded(const std::string& word); |
| 212 | void OnSpellCheckEnableAutoSpellCorrect(bool enable); |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 213 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 214 | // Gather usage statistics from the in-memory cache and inform our host. |
| 215 | // These functions should be call periodically so that the host can make |
| 216 | // decisions about how to allocation resources using current information. |
| 217 | void InformHostOfCacheStats(); |
| 218 | |
[email protected] | 90a3fbb1 | 2009-02-28 01:13:47 | [diff] [blame] | 219 | // We initialize WebKit as late as possible. |
| 220 | void EnsureWebKitInitialized(); |
| 221 | |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 222 | // A task we invoke periodically to assist with idle cleanup. |
| 223 | void IdleHandler(); |
| 224 | |
[email protected] | 71d6d85 | 2009-12-07 22:12:36 | [diff] [blame] | 225 | // Schedule a call to IdleHandler with the given initial delay. |
| 226 | void ScheduleIdleHandler(double initial_delay_s); |
| 227 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 228 | // These objects live solely on the render thread. |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 229 | scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; |
[email protected] | 42f1d782 | 2009-07-23 18:17:55 | [diff] [blame] | 230 | scoped_ptr<VisitedLinkSlave> visited_link_slave_; |
| 231 | scoped_ptr<UserScriptSlave> user_script_slave_; |
| 232 | scoped_ptr<RenderDnsMaster> dns_master_; |
[email protected] | f430b571 | 2009-08-21 21:46:31 | [diff] [blame] | 233 | scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
[email protected] | 9291ed1 | 2009-07-23 17:33:22 | [diff] [blame] | 234 | scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_; |
[email protected] | 42f1d782 | 2009-07-23 18:17:55 | [diff] [blame] | 235 | scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; |
| 236 | scoped_ptr<RendererWebKitClientImpl> webkit_client_; |
[email protected] | b7c7bcf | 2009-10-03 07:07:34 | [diff] [blame] | 237 | scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; |
[email protected] | e2b2d4a | 2009-10-24 03:32:59 | [diff] [blame] | 238 | scoped_ptr<RendererWebDatabaseObserver> renderer_web_database_observer_; |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 239 | scoped_ptr<SpellCheck> spellchecker_; |
[email protected] | 9291ed1 | 2009-07-23 17:33:22 | [diff] [blame] | 240 | |
[email protected] | e2b2d4a | 2009-10-24 03:32:59 | [diff] [blame] | 241 | // Used on the renderer and IPC threads. |
[email protected] | 017022b | 2009-07-27 23:06:34 | [diff] [blame] | 242 | scoped_refptr<DBMessageFilter> db_message_filter_; |
[email protected] | dd924193 | 2010-02-24 19:23:13 | [diff] [blame] | 243 | scoped_refptr<CookieMessageFilter> cookie_message_filter_; |
[email protected] | 017022b | 2009-07-27 23:06:34 | [diff] [blame] | 244 | |
[email protected] | 5fa1c54 | 2009-05-05 20:36:07 | [diff] [blame] | 245 | #if defined(OS_POSIX) |
| 246 | scoped_refptr<IPC::ChannelProxy::MessageFilter> |
| 247 | suicide_on_channel_error_filter_; |
| 248 | #endif |
| 249 | |
[email protected] | b547fd4 | 2009-04-23 23:16:27 | [diff] [blame] | 250 | // If true, then a GetPlugins call is allowed to rescan the disk. |
| 251 | bool plugin_refresh_allowed_; |
| 252 | |
[email protected] | bee16aab | 2009-08-26 15:55:03 | [diff] [blame] | 253 | // Is there a pending task for doing CacheStats. |
| 254 | bool cache_stats_task_pending_; |
| 255 | |
| 256 | // The count of RenderWidgets running through this thread. |
| 257 | int widget_count_; |
| 258 | |
| 259 | // The count of hidden RenderWidgets running through this thread. |
| 260 | int hidden_widget_count_; |
| 261 | |
| 262 | // The current value of the idle notification timer delay. |
| 263 | double idle_notification_delay_in_s_; |
| 264 | |
[email protected] | 71d6d85 | 2009-12-07 22:12:36 | [diff] [blame] | 265 | // True if this renderer is running extensions. |
| 266 | bool is_extension_process_; |
| 267 | |
[email protected] | c1f50aa | 2010-02-18 03:46:57 | [diff] [blame] | 268 | bool do_not_suspend_webkit_shared_timer_; |
| 269 | bool do_not_notify_webkit_of_modal_loop_; |
| 270 | bool did_notify_webkit_of_modal_loop_; |
| 271 | |
[email protected] | 71d6d85 | 2009-12-07 22:12:36 | [diff] [blame] | 272 | // Timer that periodically calls IdleHandler. |
| 273 | base::RepeatingTimer<RenderThread> idle_timer_; |
| 274 | |
| 275 | // Same as above, but on a longer timer and will run even if the process is |
| 276 | // not idle, to ensure that IdleHandle gets called eventually. |
| 277 | base::RepeatingTimer<RenderThread> forced_idle_timer_; |
| 278 | |
[email protected] | 1bc8306 | 2009-02-06 00:16:37 | [diff] [blame] | 279 | DISALLOW_COPY_AND_ASSIGN(RenderThread); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 280 | }; |
| 281 | |
[email protected] | 1d97d2e | 2008-12-18 23:39:02 | [diff] [blame] | 282 | #endif // CHROME_RENDERER_RENDER_THREAD_H_ |