| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 <vector> |
| 9 |
| 8 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 9 #include "base/gfx/native_widget_types.h" | 11 #include "base/gfx/native_widget_types.h" |
| 10 #include "base/ref_counted.h" | 12 #include "base/ref_counted.h" |
| 11 #include "base/shared_memory.h" | 13 #include "base/shared_memory.h" |
| 12 #include "base/task.h" | 14 #include "base/task.h" |
| 13 #include "base/thread.h" | 15 #include "base/thread.h" |
| 14 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 15 #include "chrome/common/ipc_sync_channel.h" | 17 #include "chrome/common/ipc_sync_channel.h" |
| 16 #include "chrome/common/message_router.h" | 18 #include "chrome/common/message_router.h" |
| 17 #include "chrome/common/modal_dialog_event.h" | 19 #include "chrome/common/modal_dialog_event.h" |
| 18 | 20 |
| 19 class SkBitmap; | 21 class SkBitmap; |
| 20 class Task; | |
| 21 class VisitedLinkSlave; | 22 class VisitedLinkSlave; |
| 22 struct WebPreferences; | 23 struct WebPreferences; |
| 23 class RenderDnsMaster; | 24 class RenderDnsMaster; |
| 24 class NotificationService; | 25 class NotificationService; |
| 25 class UserScriptSlave; | 26 class UserScriptSlave; |
| 26 | 27 |
| 27 // The RenderThreadBase is the minimal interface that a RenderView/Widget | 28 // The RenderThreadBase is the minimal interface that a RenderView/Widget |
| 28 // expects from a render thread. The interface basically abstracts a way to send | 29 // expects from a render thread. The interface basically abstracts a way to send |
| 29 // and receive messages. | 30 // and receive messages. |
| 30 class RenderThreadBase : public IPC::Message::Sender { | 31 class RenderThreadBase : public IPC::Message::Sender { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 49 // Likewise, it provides an API for the RenderViews to talk back to the main | 50 // Likewise, it provides an API for the RenderViews to talk back to the main |
| 50 // process (i.e., their corresponding WebContents). | 51 // process (i.e., their corresponding WebContents). |
| 51 // | 52 // |
| 52 // Most of the communication occurs in the form of IPC messages. They are | 53 // Most of the communication occurs in the form of IPC messages. They are |
| 53 // routed to the RenderThread according to the routing IDs of the messages. | 54 // routed to the RenderThread according to the routing IDs of the messages. |
| 54 // The routing IDs correspond to RenderView instances. | 55 // The routing IDs correspond to RenderView instances. |
| 55 class RenderThread : public IPC::Channel::Listener, | 56 class RenderThread : public IPC::Channel::Listener, |
| 56 public RenderThreadBase, | 57 public RenderThreadBase, |
| 57 public base::Thread { | 58 public base::Thread { |
| 58 public: | 59 public: |
| 59 RenderThread(const std::wstring& channel_name); | 60 explicit RenderThread(const std::wstring& channel_name); |
| 60 virtual ~RenderThread(); | 61 virtual ~RenderThread(); |
| 61 | 62 |
| 62 // IPC::Channel::Listener implementation: | 63 // IPC::Channel::Listener implementation: |
| 63 virtual void OnMessageReceived(const IPC::Message& msg); | 64 virtual void OnMessageReceived(const IPC::Message& msg); |
| 64 virtual void OnChannelError(); | 65 virtual void OnChannelError(); |
| 65 | 66 |
| 66 // IPC::Message::Sender implementation: | 67 // IPC::Message::Sender implementation: |
| 67 virtual bool Send(IPC::Message* msg); | 68 virtual bool Send(IPC::Message* msg); |
| 68 | 69 |
| 69 // Overridded from RenderThreadBase. | 70 // Overridded from RenderThreadBase. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 UserScriptSlave* user_script_slave_; | 135 UserScriptSlave* user_script_slave_; |
| 135 | 136 |
| 136 scoped_ptr<RenderDnsMaster> render_dns_master_; | 137 scoped_ptr<RenderDnsMaster> render_dns_master_; |
| 137 | 138 |
| 138 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > cache_stats_factory_; | 139 scoped_ptr<ScopedRunnableMethodFactory<RenderThread> > cache_stats_factory_; |
| 139 | 140 |
| 140 scoped_ptr<NotificationService> notification_service_; | 141 scoped_ptr<NotificationService> notification_service_; |
| 141 | 142 |
| 142 int in_send_; | 143 int in_send_; |
| 143 | 144 |
| 144 DISALLOW_EVIL_CONSTRUCTORS(RenderThread); | 145 DISALLOW_COPY_AND_ASSIGN(RenderThread); |
| 145 }; | 146 }; |
| 146 | 147 |
| 147 // The global RenderThread object for this process. Note that this should only | 148 // The global RenderThread object for this process. Note that this should only |
| 148 // be accessed when running on the render thread itself. | 149 // be accessed when running on the render thread itself. |
| 149 extern RenderThread* g_render_thread; | 150 extern RenderThread* g_render_thread; |
| 150 | 151 |
| 151 #endif // CHROME_RENDERER_RENDER_THREAD_H_ | 152 #endif // CHROME_RENDERER_RENDER_THREAD_H_ |
| OLD | NEW |