| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CHROME_RENDERER_RENDER_THREAD_H_ | 5 #ifndef CHROME_RENDERER_RENDER_THREAD_H_ |
| 6 #define CHROME_RENDERER_RENDER_THREAD_H_ | 6 #define CHROME_RENDERER_RENDER_THREAD_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "app/gfx/native_widget_types.h" | 11 #include "app/gfx/native_widget_types.h" |
| 12 #include "base/shared_memory.h" | 12 #include "base/shared_memory.h" |
| 13 #include "base/string16.h" | 13 #include "base/string16.h" |
| 14 #include "base/task.h" | 14 #include "base/task.h" |
| 15 #include "base/time.h" |
| 16 #include "base/timer.h" |
| 15 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 16 #include "chrome/common/child_thread.h" | 18 #include "chrome/common/child_thread.h" |
| 17 #include "chrome/common/css_colors.h" | 19 #include "chrome/common/css_colors.h" |
| 18 #include "chrome/common/dom_storage_type.h" | 20 #include "chrome/common/dom_storage_type.h" |
| 19 #include "chrome/renderer/renderer_histogram_snapshots.h" | 21 #include "chrome/renderer/renderer_histogram_snapshots.h" |
| 20 #include "chrome/renderer/visitedlink_slave.h" | 22 #include "chrome/renderer/visitedlink_slave.h" |
| 21 #include "ipc/ipc_platform_file.h" | 23 #include "ipc/ipc_platform_file.h" |
| 22 | 24 |
| 23 class AppCacheDispatcher; | 25 class AppCacheDispatcher; |
| 24 class DBMessageFilter; | 26 class DBMessageFilter; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 AppCacheDispatcher* appcache_dispatcher() const { | 120 AppCacheDispatcher* appcache_dispatcher() const { |
| 119 return appcache_dispatcher_.get(); | 121 return appcache_dispatcher_.get(); |
| 120 } | 122 } |
| 121 | 123 |
| 122 SpellCheck* spellchecker() const { | 124 SpellCheck* spellchecker() const { |
| 123 return spellchecker_.get(); | 125 return spellchecker_.get(); |
| 124 } | 126 } |
| 125 | 127 |
| 126 bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } | 128 bool plugin_refresh_allowed() const { return plugin_refresh_allowed_; } |
| 127 | 129 |
| 130 bool is_extension_process() const { return is_extension_process_; } |
| 131 |
| 128 // Do DNS prefetch resolution of a hostname. | 132 // Do DNS prefetch resolution of a hostname. |
| 129 void Resolve(const char* name, size_t length); | 133 void Resolve(const char* name, size_t length); |
| 130 | 134 |
| 131 // Send all the Histogram data to browser. | 135 // Send all the Histogram data to browser. |
| 132 void SendHistograms(int sequence_number); | 136 void SendHistograms(int sequence_number); |
| 133 | 137 |
| 134 // Invokes InformHostOfCacheStats after a short delay. Used to move this | 138 // Invokes InformHostOfCacheStats after a short delay. Used to move this |
| 135 // bookkeeping operation off the critical latency path. | 139 // bookkeeping operation off the critical latency path. |
| 136 void InformHostOfCacheStatsLater(); | 140 void InformHostOfCacheStatsLater(); |
| 137 | 141 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 // These functions should be call periodically so that the host can make | 203 // These functions should be call periodically so that the host can make |
| 200 // decisions about how to allocation resources using current information. | 204 // decisions about how to allocation resources using current information. |
| 201 void InformHostOfCacheStats(); | 205 void InformHostOfCacheStats(); |
| 202 | 206 |
| 203 // We initialize WebKit as late as possible. | 207 // We initialize WebKit as late as possible. |
| 204 void EnsureWebKitInitialized(); | 208 void EnsureWebKitInitialized(); |
| 205 | 209 |
| 206 // A task we invoke periodically to assist with idle cleanup. | 210 // A task we invoke periodically to assist with idle cleanup. |
| 207 void IdleHandler(); | 211 void IdleHandler(); |
| 208 | 212 |
| 213 // Schedule a call to IdleHandler with the given initial delay. |
| 214 void ScheduleIdleHandler(double initial_delay_s); |
| 215 |
| 209 // These objects live solely on the render thread. | 216 // These objects live solely on the render thread. |
| 210 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; | 217 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; |
| 211 scoped_ptr<VisitedLinkSlave> visited_link_slave_; | 218 scoped_ptr<VisitedLinkSlave> visited_link_slave_; |
| 212 scoped_ptr<UserScriptSlave> user_script_slave_; | 219 scoped_ptr<UserScriptSlave> user_script_slave_; |
| 213 scoped_ptr<RenderDnsMaster> dns_master_; | 220 scoped_ptr<RenderDnsMaster> dns_master_; |
| 214 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; | 221 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
| 215 scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_; | 222 scoped_refptr<DevToolsAgentFilter> devtools_agent_filter_; |
| 216 scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; | 223 scoped_ptr<RendererHistogramSnapshots> histogram_snapshots_; |
| 217 scoped_ptr<RendererWebKitClientImpl> webkit_client_; | 224 scoped_ptr<RendererWebKitClientImpl> webkit_client_; |
| 218 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; | 225 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 235 | 242 |
| 236 // The count of RenderWidgets running through this thread. | 243 // The count of RenderWidgets running through this thread. |
| 237 int widget_count_; | 244 int widget_count_; |
| 238 | 245 |
| 239 // The count of hidden RenderWidgets running through this thread. | 246 // The count of hidden RenderWidgets running through this thread. |
| 240 int hidden_widget_count_; | 247 int hidden_widget_count_; |
| 241 | 248 |
| 242 // The current value of the idle notification timer delay. | 249 // The current value of the idle notification timer delay. |
| 243 double idle_notification_delay_in_s_; | 250 double idle_notification_delay_in_s_; |
| 244 | 251 |
| 252 // True if this renderer is running extensions. |
| 253 bool is_extension_process_; |
| 254 |
| 255 // Timer that periodically calls IdleHandler. |
| 256 base::RepeatingTimer<RenderThread> idle_timer_; |
| 257 |
| 258 // Same as above, but on a longer timer and will run even if the process is |
| 259 // not idle, to ensure that IdleHandle gets called eventually. |
| 260 base::RepeatingTimer<RenderThread> forced_idle_timer_; |
| 261 |
| 245 DISALLOW_COPY_AND_ASSIGN(RenderThread); | 262 DISALLOW_COPY_AND_ASSIGN(RenderThread); |
| 246 }; | 263 }; |
| 247 | 264 |
| 248 #endif // CHROME_RENDERER_RENDER_THREAD_H_ | 265 #endif // CHROME_RENDERER_RENDER_THREAD_H_ |
| OLD | NEW |