OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/id_map.h" | 9 #include "base/id_map.h" |
10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
11 #include "base/process/process_handle.h" | 11 #include "base/process/process_handle.h" |
12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
13 #include "ipc/ipc_channel_proxy.h" | 13 #include "ipc/ipc_channel_proxy.h" |
14 #include "ipc/ipc_sender.h" | 14 #include "ipc/ipc_sender.h" |
15 #include "ui/gfx/native_widget_types.h" | 15 #include "ui/gfx/native_widget_types.h" |
16 #include "ui/surface/transport_dib.h" | 16 #include "ui/surface/transport_dib.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 struct ViewMsg_SwapOut_Params; | 19 struct ViewMsg_SwapOut_Params; |
20 | 20 |
21 namespace content { | |
22 class BrowserContext; | |
23 class RenderWidgetHost; | |
24 class StoragePartition; | |
25 } | |
26 | |
27 namespace base { | 21 namespace base { |
28 class TimeDelta; | 22 class TimeDelta; |
29 } | 23 } |
30 | 24 |
31 namespace content { | 25 namespace content { |
| 26 class BrowserContext; |
| 27 class BrowserMessageFilter; |
| 28 class RenderWidgetHost; |
| 29 class StoragePartition; |
32 | 30 |
33 typedef base::Thread* (*RendererMainThreadFactoryFunction)( | 31 typedef base::Thread* (*RendererMainThreadFactoryFunction)( |
34 const std::string& id); | 32 const std::string& id); |
35 | 33 |
36 // Interface that represents the browser side of the browser <-> renderer | 34 // Interface that represents the browser side of the browser <-> renderer |
37 // communication channel. There will generally be one RenderProcessHost per | 35 // communication channel. There will generally be one RenderProcessHost per |
38 // renderer process. | 36 // renderer process. |
39 class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, | 37 class CONTENT_EXPORT RenderProcessHost : public IPC::Sender, |
40 public IPC::Listener { | 38 public IPC::Listener { |
41 public: | 39 public: |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 // if there is connection or not. Virtual for mocking out for tests. | 151 // if there is connection or not. Virtual for mocking out for tests. |
154 virtual bool HasConnection() const = 0; | 152 virtual bool HasConnection() const = 0; |
155 | 153 |
156 // Call this to allow queueing of IPC messages that are sent before the | 154 // Call this to allow queueing of IPC messages that are sent before the |
157 // process is launched. | 155 // process is launched. |
158 virtual void EnableSendQueue() = 0; | 156 virtual void EnableSendQueue() = 0; |
159 | 157 |
160 // Returns the renderer channel. | 158 // Returns the renderer channel. |
161 virtual IPC::ChannelProxy* GetChannel() = 0; | 159 virtual IPC::ChannelProxy* GetChannel() = 0; |
162 | 160 |
| 161 // Adds a message filter to the IPC channel. |
| 162 virtual void AddFilter(BrowserMessageFilter* filter) = 0; |
| 163 |
163 // Try to shutdown the associated render process as fast as possible | 164 // Try to shutdown the associated render process as fast as possible |
164 virtual bool FastShutdownForPageCount(size_t count) = 0; | 165 virtual bool FastShutdownForPageCount(size_t count) = 0; |
165 | 166 |
166 // TODO(ananta) | 167 // TODO(ananta) |
167 // Revisit whether the virtual functions declared from here on need to be | 168 // Revisit whether the virtual functions declared from here on need to be |
168 // part of the interface. | 169 // part of the interface. |
169 virtual void SetIgnoreInputEvents(bool ignore_input_events) = 0; | 170 virtual void SetIgnoreInputEvents(bool ignore_input_events) = 0; |
170 virtual bool IgnoreInputEvents() const = 0; | 171 virtual bool IgnoreInputEvents() const = 0; |
171 | 172 |
172 // Schedules the host for deletion and removes it from the all_hosts list. | 173 // Schedules the host for deletion and removes it from the all_hosts list. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 // module. | 253 // module. |
253 static size_t GetMaxRendererProcessCount(); | 254 static size_t GetMaxRendererProcessCount(); |
254 | 255 |
255 static void RegisterRendererMainThreadFactory( | 256 static void RegisterRendererMainThreadFactory( |
256 RendererMainThreadFactoryFunction create); | 257 RendererMainThreadFactoryFunction create); |
257 }; | 258 }; |
258 | 259 |
259 } // namespace content. | 260 } // namespace content. |
260 | 261 |
261 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ | 262 #endif // CONTENT_PUBLIC_BROWSER_RENDER_PROCESS_HOST_H_ |
OLD | NEW |