| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_RENDERER_RENDER_THREAD_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 6 #define CONTENT_RENDERER_RENDER_THREAD_H_ | 6 #define CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
| 14 #include "base/shared_memory.h" | 14 #include "base/shared_memory.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/timer.h" | 16 #include "base/timer.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 60 } |
| 61 | 61 |
| 62 namespace content { | 62 namespace content { |
| 63 class RenderProcessObserver; | 63 class RenderProcessObserver; |
| 64 } | 64 } |
| 65 | 65 |
| 66 namespace v8 { | 66 namespace v8 { |
| 67 class Extension; | 67 class Extension; |
| 68 } | 68 } |
| 69 | 69 |
| 70 // The RenderThread class represents a background thread where RenderView | 70 // The RenderThreadImpl class represents a background thread where RenderView |
| 71 // instances live. The RenderThread supports an API that is used by its | 71 // instances live. The RenderThread supports an API that is used by its |
| 72 // consumer to talk indirectly to the RenderViews and supporting objects. | 72 // consumer to talk indirectly to the RenderViews and supporting objects. |
| 73 // Likewise, it provides an API for the RenderViews to talk back to the main | 73 // Likewise, it provides an API for the RenderViews to talk back to the main |
| 74 // process (i.e., their corresponding TabContents). | 74 // process (i.e., their corresponding TabContents). |
| 75 // | 75 // |
| 76 // Most of the communication occurs in the form of IPC messages. They are | 76 // Most of the communication occurs in the form of IPC messages. They are |
| 77 // routed to the RenderThread according to the routing IDs of the messages. | 77 // routed to the RenderThread according to the routing IDs of the messages. |
| 78 // The routing IDs correspond to RenderView instances. | 78 // The routing IDs correspond to RenderView instances. |
| 79 class CONTENT_EXPORT RenderThread : public content::RenderThread, | 79 class CONTENT_EXPORT RenderThreadImpl : public content::RenderThread, |
| 80 public ChildThread { | 80 public ChildThread { |
| 81 public: | 81 public: |
| 82 static RenderThread* current(); | 82 static RenderThreadImpl* current(); |
| 83 | 83 |
| 84 RenderThread(); | 84 RenderThreadImpl(); |
| 85 // Constructor that's used when running in single process mode. | 85 // Constructor that's used when running in single process mode. |
| 86 explicit RenderThread(const std::string& channel_name); | 86 explicit RenderThreadImpl(const std::string& channel_name); |
| 87 virtual ~RenderThread(); | 87 virtual ~RenderThreadImpl(); |
| 88 | 88 |
| 89 // Returns the routing ID of the RenderWidget containing the current script | 89 // Returns the routing ID of the RenderWidget containing the current script |
| 90 // execution context (corresponding to WebFrame::frameForCurrentContext). | 90 // execution context (corresponding to WebFrame::frameForCurrentContext). |
| 91 static int32 RoutingIDForCurrentContext(); | 91 static int32 RoutingIDForCurrentContext(); |
| 92 | 92 |
| 93 // content::RenderThread implementation: | 93 // content::RenderThread implementation: |
| 94 virtual bool Send(IPC::Message* msg) OVERRIDE; | 94 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 95 virtual MessageLoop* GetMessageLoop() OVERRIDE; | 95 virtual MessageLoop* GetMessageLoop() OVERRIDE; |
| 96 virtual IPC::SyncChannel* GetChannel() OVERRIDE; | 96 virtual IPC::SyncChannel* GetChannel() OVERRIDE; |
| 97 virtual ResourceDispatcher* GetResourceDispatcher() OVERRIDE; | 97 virtual ResourceDispatcher* GetResourceDispatcher() OVERRIDE; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 void OnDOMStorageEvent(const DOMStorageMsg_Event_Params& params); | 181 void OnDOMStorageEvent(const DOMStorageMsg_Event_Params& params); |
| 182 void OnSetNextPageID(int32 next_page_id); | 182 void OnSetNextPageID(int32 next_page_id); |
| 183 void OnSetCSSColors(const std::vector<CSSColors::CSSColorMapping>& colors); | 183 void OnSetCSSColors(const std::vector<CSSColors::CSSColorMapping>& colors); |
| 184 void OnCreateNewView(const ViewMsg_New_Params& params); | 184 void OnCreateNewView(const ViewMsg_New_Params& params); |
| 185 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); | 185 void OnTransferBitmap(const SkBitmap& bitmap, int resource_id); |
| 186 void OnPurgePluginListCache(bool reload_pages); | 186 void OnPurgePluginListCache(bool reload_pages); |
| 187 void OnNetworkStateChanged(bool online); | 187 void OnNetworkStateChanged(bool online); |
| 188 void OnGetAccessibilityTree(); | 188 void OnGetAccessibilityTree(); |
| 189 | 189 |
| 190 // These objects live solely on the render thread. | 190 // These objects live solely on the render thread. |
| 191 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > task_factory_; | 191 scoped_ptr<ScopedRunnableMethodFactory<RenderThreadImpl> > task_factory_; |
| 192 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; | 192 scoped_ptr<AppCacheDispatcher> appcache_dispatcher_; |
| 193 scoped_ptr<IndexedDBDispatcher> indexed_db_dispatcher_; | 193 scoped_ptr<IndexedDBDispatcher> indexed_db_dispatcher_; |
| 194 scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_; | 194 scoped_ptr<RendererWebKitPlatformSupportImpl> webkit_platform_support_; |
| 195 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; | 195 scoped_ptr<WebKit::WebStorageEventDispatcher> dom_storage_event_dispatcher_; |
| 196 | 196 |
| 197 // Used on the renderer and IPC threads. | 197 // Used on the renderer and IPC threads. |
| 198 scoped_refptr<DBMessageFilter> db_message_filter_; | 198 scoped_refptr<DBMessageFilter> db_message_filter_; |
| 199 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_; | 199 scoped_refptr<AudioInputMessageFilter> audio_input_message_filter_; |
| 200 scoped_refptr<AudioMessageFilter> audio_message_filter_; | 200 scoped_refptr<AudioMessageFilter> audio_message_filter_; |
| 201 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_; | 201 scoped_refptr<DevToolsAgentFilter> devtools_agent_message_filter_; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 215 // The count of hidden RenderWidgets running through this thread. | 215 // The count of hidden RenderWidgets running through this thread. |
| 216 int hidden_widget_count_; | 216 int hidden_widget_count_; |
| 217 | 217 |
| 218 // The current value of the idle notification timer delay. | 218 // The current value of the idle notification timer delay. |
| 219 double idle_notification_delay_in_s_; | 219 double idle_notification_delay_in_s_; |
| 220 | 220 |
| 221 bool suspend_webkit_shared_timer_; | 221 bool suspend_webkit_shared_timer_; |
| 222 bool notify_webkit_of_modal_loop_; | 222 bool notify_webkit_of_modal_loop_; |
| 223 | 223 |
| 224 // Timer that periodically calls IdleHandler. | 224 // Timer that periodically calls IdleHandler. |
| 225 base::RepeatingTimer<RenderThread> idle_timer_; | 225 base::RepeatingTimer<RenderThreadImpl> idle_timer_; |
| 226 | 226 |
| 227 // The channel from the renderer process to the GPU process. | 227 // The channel from the renderer process to the GPU process. |
| 228 scoped_refptr<GpuChannelHost> gpu_channel_; | 228 scoped_refptr<GpuChannelHost> gpu_channel_; |
| 229 | 229 |
| 230 // A lazily initiated thread on which file operations are run. | 230 // A lazily initiated thread on which file operations are run. |
| 231 scoped_ptr<base::Thread> file_thread_; | 231 scoped_ptr<base::Thread> file_thread_; |
| 232 | 232 |
| 233 // Map of registered v8 extensions. The key is the extension name. | 233 // Map of registered v8 extensions. The key is the extension name. |
| 234 std::set<std::string> v8_extensions_; | 234 std::set<std::string> v8_extensions_; |
| 235 | 235 |
| 236 scoped_ptr<CompositorThread> compositor_thread_; | 236 scoped_ptr<CompositorThread> compositor_thread_; |
| 237 | 237 |
| 238 ObserverList<content::RenderProcessObserver> observers_; | 238 ObserverList<content::RenderProcessObserver> observers_; |
| 239 | 239 |
| 240 DISALLOW_COPY_AND_ASSIGN(RenderThread); | 240 DISALLOW_COPY_AND_ASSIGN(RenderThreadImpl); |
| 241 }; | 241 }; |
| 242 | 242 |
| 243 #endif // CONTENT_RENDERER_RENDER_THREAD_H_ | 243 #endif // CONTENT_RENDERER_RENDER_THREAD_IMPL_H_ |
| OLD | NEW |