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_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <queue> | 9 #include <queue> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/observer_list.h" | 13 #include "base/observer_list.h" |
14 #include "base/process/process.h" | 14 #include "base/process/process.h" |
15 #include "base/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "content/browser/child_process_launcher.h" | 16 #include "content/browser/child_process_launcher.h" |
17 #include "content/browser/geolocation/geolocation_dispatcher_host.h" | 17 #include "content/browser/geolocation/geolocation_dispatcher_host.h" |
18 #include "content/browser/power_monitor_message_broadcaster.h" | 18 #include "content/browser/power_monitor_message_broadcaster.h" |
19 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
20 #include "content/public/browser/gpu_data_manager_observer.h" | 20 #include "content/public/browser/gpu_data_manager_observer.h" |
21 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
22 #include "ipc/ipc_channel_proxy.h" | 22 #include "ipc/ipc_channel_proxy.h" |
23 #include "ipc/ipc_platform_file.h" | 23 #include "ipc/ipc_platform_file.h" |
24 #include "ui/surface/transport_dib.h" | 24 #include "ui/surface/transport_dib.h" |
25 | 25 |
| 26 #if defined(USE_MOJO) |
| 27 #include "content/common/mojo/render_process.mojom.h" |
| 28 #include "mojo/public/bindings/remote_ptr.h" |
| 29 #endif |
| 30 |
26 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 31 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
27 | 32 |
28 namespace base { | 33 namespace base { |
29 class CommandLine; | 34 class CommandLine; |
30 class MessageLoop; | 35 class MessageLoop; |
31 } | 36 } |
32 | 37 |
33 namespace gfx { | 38 namespace gfx { |
34 class Size; | 39 class Size; |
35 } | 40 } |
36 | 41 |
37 namespace content { | 42 namespace content { |
38 class AudioRendererHost; | 43 class AudioRendererHost; |
39 class BrowserDemuxerAndroid; | 44 class BrowserDemuxerAndroid; |
40 class GeolocationDispatcherHost; | 45 class GeolocationDispatcherHost; |
41 class GpuMessageFilter; | 46 class GpuMessageFilter; |
42 class MessagePortMessageFilter; | 47 class MessagePortMessageFilter; |
43 class PeerConnectionTrackerHost; | 48 class PeerConnectionTrackerHost; |
44 class RendererMainThread; | 49 class RendererMainThread; |
45 class RenderWidgetHelper; | 50 class RenderWidgetHelper; |
46 class RenderWidgetHost; | 51 class RenderWidgetHost; |
47 class RenderWidgetHostImpl; | 52 class RenderWidgetHostImpl; |
48 class RenderWidgetHostViewFrameSubscriber; | 53 class RenderWidgetHostViewFrameSubscriber; |
49 class ScreenOrientationDispatcherHost; | 54 class ScreenOrientationDispatcherHost; |
50 class StoragePartition; | 55 class StoragePartition; |
51 class StoragePartitionImpl; | 56 class StoragePartitionImpl; |
52 | 57 |
53 #if defined(USE_MOJO) | 58 #if defined(USE_MOJO) |
54 class MojoChannelInit; | 59 class RenderProcessHostMojoImpl; |
55 #endif | 60 #endif |
56 | 61 |
57 // Implements a concrete RenderProcessHost for the browser process for talking | 62 // Implements a concrete RenderProcessHost for the browser process for talking |
58 // to actual renderer processes (as opposed to mocks). | 63 // to actual renderer processes (as opposed to mocks). |
59 // | 64 // |
60 // Represents the browser side of the browser <--> renderer communication | 65 // Represents the browser side of the browser <--> renderer communication |
61 // channel. There will be one RenderProcessHost per renderer process. | 66 // channel. There will be one RenderProcessHost per renderer process. |
62 // | 67 // |
63 // This object is refcounted so that it can release its resources when all | 68 // This object is refcounted so that it can release its resources when all |
64 // hosts using it go away. | 69 // hosts using it go away. |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 void SetIsGuestForTesting(bool is_guest) { | 235 void SetIsGuestForTesting(bool is_guest) { |
231 is_guest_ = is_guest; | 236 is_guest_ = is_guest; |
232 } | 237 } |
233 | 238 |
234 // Called when the existence of the other renderer process which is connected | 239 // Called when the existence of the other renderer process which is connected |
235 // to the Worker in this renderer process has changed. | 240 // to the Worker in this renderer process has changed. |
236 // It is only called when "enable-embedded-shared-worker" flag is set. | 241 // It is only called when "enable-embedded-shared-worker" flag is set. |
237 void IncrementWorkerRefCount(); | 242 void IncrementWorkerRefCount(); |
238 void DecrementWorkerRefCount(); | 243 void DecrementWorkerRefCount(); |
239 | 244 |
| 245 #if defined(USE_MOJO) |
| 246 void SetWebUIHandle(int32 view_routing_id, |
| 247 mojo::ScopedMessagePipeHandle handle); |
| 248 #endif |
| 249 |
240 protected: | 250 protected: |
241 // A proxy for our IPC::Channel that lives on the IO thread (see | 251 // A proxy for our IPC::Channel that lives on the IO thread (see |
242 // browser_process.h) | 252 // browser_process.h) |
243 scoped_ptr<IPC::ChannelProxy> channel_; | 253 scoped_ptr<IPC::ChannelProxy> channel_; |
244 | 254 |
245 // True if fast shutdown has been performed on this RPH. | 255 // True if fast shutdown has been performed on this RPH. |
246 bool fast_shutdown_started_; | 256 bool fast_shutdown_started_; |
247 | 257 |
248 // True if we've posted a DeleteTask and will be deleted soon. | 258 // True if we've posted a DeleteTask and will be deleted soon. |
249 bool deleting_soon_; | 259 bool deleting_soon_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 void ProcessDied(bool already_dead); | 303 void ProcessDied(bool already_dead); |
294 | 304 |
295 virtual void OnGpuSwitching() OVERRIDE; | 305 virtual void OnGpuSwitching() OVERRIDE; |
296 | 306 |
297 #if defined(ENABLE_WEBRTC) | 307 #if defined(ENABLE_WEBRTC) |
298 // Sends |file_for_transit| to the render process. | 308 // Sends |file_for_transit| to the render process. |
299 void SendAecDumpFileToRenderer(IPC::PlatformFileForTransit file_for_transit); | 309 void SendAecDumpFileToRenderer(IPC::PlatformFileForTransit file_for_transit); |
300 void SendDisableAecDumpToRenderer(); | 310 void SendDisableAecDumpToRenderer(); |
301 #endif | 311 #endif |
302 | 312 |
303 #if defined(USE_MOJO) | |
304 // Establishes the mojo channel to the renderer. | |
305 void CreateMojoChannel(); | |
306 #endif | |
307 | |
308 // The registered IPC listener objects. When this list is empty, we should | 313 // The registered IPC listener objects. When this list is empty, we should |
309 // delete ourselves. | 314 // delete ourselves. |
310 IDMap<IPC::Listener> listeners_; | 315 IDMap<IPC::Listener> listeners_; |
311 | 316 |
312 // The count of currently visible widgets. Since the host can be a container | 317 // The count of currently visible widgets. Since the host can be a container |
313 // for multiple widgets, it uses this count to determine when it should be | 318 // for multiple widgets, it uses this count to determine when it should be |
314 // backgrounded. | 319 // backgrounded. |
315 int32 visible_widgets_; | 320 int32 visible_widgets_; |
316 | 321 |
317 // Does this process have backgrounded priority. | 322 // Does this process have backgrounded priority. |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 #if defined(ENABLE_WEBRTC) | 430 #if defined(ENABLE_WEBRTC) |
426 base::Callback<void(const std::string&)> webrtc_log_message_callback_; | 431 base::Callback<void(const std::string&)> webrtc_log_message_callback_; |
427 #endif | 432 #endif |
428 | 433 |
429 // Message filter and dispatcher for screen orientation. | 434 // Message filter and dispatcher for screen orientation. |
430 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_; | 435 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_; |
431 | 436 |
432 int worker_ref_count_; | 437 int worker_ref_count_; |
433 | 438 |
434 #if defined(USE_MOJO) | 439 #if defined(USE_MOJO) |
435 scoped_ptr<MojoChannelInit> mojo_channel_init_; | 440 scoped_ptr<RenderProcessHostMojoImpl> render_process_host_mojo_; |
436 #endif | 441 #endif |
437 | 442 |
438 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 443 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
439 | 444 |
440 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 445 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
441 }; | 446 }; |
442 | 447 |
443 } // namespace content | 448 } // namespace content |
444 | 449 |
445 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 450 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |