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