| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 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" | 15 #include "base/time.h" |
| 16 #include "base/timer.h" | 16 #include "base/timer.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "chrome/common/child_thread.h" | 18 #include "chrome/common/child_thread.h" |
| 19 #include "chrome/common/css_colors.h" | 19 #include "chrome/common/css_colors.h" |
| 20 #include "chrome/common/dom_storage_common.h" | 20 #include "chrome/common/dom_storage_common.h" |
| 21 #include "chrome/renderer/gpu_channel_host.h" |
| 21 #include "chrome/renderer/renderer_histogram_snapshots.h" | 22 #include "chrome/renderer/renderer_histogram_snapshots.h" |
| 22 #include "chrome/renderer/visitedlink_slave.h" | 23 #include "chrome/renderer/visitedlink_slave.h" |
| 23 #include "gfx/native_widget_types.h" | 24 #include "gfx/native_widget_types.h" |
| 25 #include "ipc/ipc_channel_handle.h" |
| 24 #include "ipc/ipc_platform_file.h" | 26 #include "ipc/ipc_platform_file.h" |
| 25 | 27 |
| 26 class AppCacheDispatcher; | 28 class AppCacheDispatcher; |
| 27 class CookieMessageFilter; | 29 class CookieMessageFilter; |
| 28 class DBMessageFilter; | 30 class DBMessageFilter; |
| 29 class DevToolsAgentFilter; | 31 class DevToolsAgentFilter; |
| 30 class FilePath; | 32 class FilePath; |
| 31 class ListValue; | 33 class ListValue; |
| 32 class NullableString16; | 34 class NullableString16; |
| 33 class RenderDnsMaster; | 35 class RenderDnsMaster; |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 | 160 |
| 159 // Sends a message to the browser to close all connections. | 161 // Sends a message to the browser to close all connections. |
| 160 void CloseCurrentConnections(); | 162 void CloseCurrentConnections(); |
| 161 | 163 |
| 162 // Sends a message to the browser to enable or disable the disk cache. | 164 // Sends a message to the browser to enable or disable the disk cache. |
| 163 void SetCacheMode(bool enabled); | 165 void SetCacheMode(bool enabled); |
| 164 | 166 |
| 165 // Update the list of active extensions that will be reported when we crash. | 167 // Update the list of active extensions that will be reported when we crash. |
| 166 void UpdateActiveExtensions(); | 168 void UpdateActiveExtensions(); |
| 167 | 169 |
| 170 // Asynchronously establish a channel to the GPU plugin if not previously |
| 171 // established or if it has been lost (for example if the GPU plugin crashed). |
| 172 // Use GetGpuChannel() to determine when the channel is ready for use. |
| 173 void EstablishGpuChannel(); |
| 174 |
| 175 // Get the GPU channel. Returns NULL if the channel is not established or |
| 176 // has been lost. |
| 177 GpuChannelHost* GetGpuChannel(); |
| 178 |
| 168 private: | 179 private: |
| 169 virtual void OnControlMessageReceived(const IPC::Message& msg); | 180 virtual void OnControlMessageReceived(const IPC::Message& msg); |
| 170 | 181 |
| 171 void Init(); | 182 void Init(); |
| 172 | 183 |
| 173 void OnUpdateVisitedLinks(base::SharedMemoryHandle table); | 184 void OnUpdateVisitedLinks(base::SharedMemoryHandle table); |
| 174 void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints); | 185 void OnAddVisitedLinks(const VisitedLinkSlave::Fingerprints& fingerprints); |
| 175 void OnResetVisitedLinks(); | 186 void OnResetVisitedLinks(); |
| 176 void OnSetZoomLevelForCurrentHost(const std::string& host, int zoom_level); | 187 void OnSetZoomLevelForCurrentHost(const std::string& host, int zoom_level); |
| 177 void OnSetContentSettingsForCurrentHost( | 188 void OnSetContentSettingsForCurrentHost( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 void OnPurgeMemory(); | 224 void OnPurgeMemory(); |
| 214 void OnPurgePluginListCache(bool reload_pages); | 225 void OnPurgePluginListCache(bool reload_pages); |
| 215 | 226 |
| 216 void OnInitSpellChecker(IPC::PlatformFileForTransit bdict_file, | 227 void OnInitSpellChecker(IPC::PlatformFileForTransit bdict_file, |
| 217 const std::vector<std::string>& custom_words, | 228 const std::vector<std::string>& custom_words, |
| 218 const std::string& language, | 229 const std::string& language, |
| 219 bool auto_spell_correct); | 230 bool auto_spell_correct); |
| 220 void OnSpellCheckWordAdded(const std::string& word); | 231 void OnSpellCheckWordAdded(const std::string& word); |
| 221 void OnSpellCheckEnableAutoSpellCorrect(bool enable); | 232 void OnSpellCheckEnableAutoSpellCorrect(bool enable); |
| 222 | 233 |
| 234 void OnGpuChannelEstablished(const IPC::ChannelHandle& channel_handle); |
| 235 |
| 223 // Gather usage statistics from the in-memory cache and inform our host. | 236 // Gather usage statistics from the in-memory cache and inform our host. |
| 224 // These functions should be call periodically so that the host can make | 237 // These functions should be call periodically so that the host can make |
| 225 // decisions about how to allocation resources using current information. | 238 // decisions about how to allocation resources using current information. |
| 226 void InformHostOfCacheStats(); | 239 void InformHostOfCacheStats(); |
| 227 | 240 |
| 228 // We initialize WebKit as late as possible. | 241 // We initialize WebKit as late as possible. |
| 229 void EnsureWebKitInitialized(); | 242 void EnsureWebKitInitialized(); |
| 230 | 243 |
| 231 // A task we invoke periodically to assist with idle cleanup. | 244 // A task we invoke periodically to assist with idle cleanup. |
| 232 void IdleHandler(); | 245 void IdleHandler(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 bool notify_webkit_of_modal_loop_; | 294 bool notify_webkit_of_modal_loop_; |
| 282 bool did_notify_webkit_of_modal_loop_; | 295 bool did_notify_webkit_of_modal_loop_; |
| 283 | 296 |
| 284 // Timer that periodically calls IdleHandler. | 297 // Timer that periodically calls IdleHandler. |
| 285 base::RepeatingTimer<RenderThread> idle_timer_; | 298 base::RepeatingTimer<RenderThread> idle_timer_; |
| 286 | 299 |
| 287 // Same as above, but on a longer timer and will run even if the process is | 300 // Same as above, but on a longer timer and will run even if the process is |
| 288 // not idle, to ensure that IdleHandle gets called eventually. | 301 // not idle, to ensure that IdleHandle gets called eventually. |
| 289 base::RepeatingTimer<RenderThread> forced_idle_timer_; | 302 base::RepeatingTimer<RenderThread> forced_idle_timer_; |
| 290 | 303 |
| 304 // The channel from the renderer process to the GPU process. |
| 305 scoped_refptr<GpuChannelHost> gpu_channel_; |
| 306 |
| 291 DISALLOW_COPY_AND_ASSIGN(RenderThread); | 307 DISALLOW_COPY_AND_ASSIGN(RenderThread); |
| 292 }; | 308 }; |
| 293 | 309 |
| 294 #endif // CHROME_RENDERER_RENDER_THREAD_H_ | 310 #endif // CHROME_RENDERER_RENDER_THREAD_H_ |
| OLD | NEW |