| 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 "mojo/public/cpp/system/core.h" | 24 #include "mojo/embedder/scoped_platform_handle.h" |
| 25 #include "mojo/public/cpp/bindings/remote_ptr.h" |
| 26 #include "mojo/public/interfaces/shell/shell.mojom.h" |
| 25 #include "ui/surface/transport_dib.h" | 27 #include "ui/surface/transport_dib.h" |
| 26 | 28 |
| 27 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 29 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
| 28 | 30 |
| 29 namespace base { | 31 namespace base { |
| 30 class CommandLine; | 32 class CommandLine; |
| 31 class MessageLoop; | 33 class MessageLoop; |
| 32 } | 34 } |
| 33 | 35 |
| 34 namespace gfx { | 36 namespace gfx { |
| 35 class Size; | 37 class Size; |
| 36 } | 38 } |
| 37 | 39 |
| 38 namespace content { | 40 namespace content { |
| 39 class AudioRendererHost; | 41 class AudioRendererHost; |
| 40 class BrowserDemuxerAndroid; | 42 class BrowserDemuxerAndroid; |
| 41 class GeolocationDispatcherHost; | 43 class GeolocationDispatcherHost; |
| 42 class GpuMessageFilter; | 44 class GpuMessageFilter; |
| 43 class MessagePortMessageFilter; | 45 class MessagePortMessageFilter; |
| 46 class MojoApplicationHost; |
| 44 class PeerConnectionTrackerHost; | 47 class PeerConnectionTrackerHost; |
| 45 class RendererMainThread; | 48 class RendererMainThread; |
| 46 class RenderProcessHostMojoImpl; | 49 class RenderProcessHostMojoImpl; |
| 47 class RenderWidgetHelper; | 50 class RenderWidgetHelper; |
| 48 class RenderWidgetHost; | 51 class RenderWidgetHost; |
| 49 class RenderWidgetHostImpl; | 52 class RenderWidgetHostImpl; |
| 50 class RenderWidgetHostViewFrameSubscriber; | 53 class RenderWidgetHostViewFrameSubscriber; |
| 51 class ScreenOrientationDispatcherHost; | 54 class ScreenOrientationDispatcherHost; |
| 52 class StoragePartition; | 55 class StoragePartition; |
| 53 class StoragePartitionImpl; | 56 class StoragePartitionImpl; |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 void SetIsGuestForTesting(bool is_guest) { | 236 void SetIsGuestForTesting(bool is_guest) { |
| 234 is_guest_ = is_guest; | 237 is_guest_ = is_guest; |
| 235 } | 238 } |
| 236 | 239 |
| 237 // Called when the existence of the other renderer process which is connected | 240 // Called when the existence of the other renderer process which is connected |
| 238 // to the Worker in this renderer process has changed. | 241 // to the Worker in this renderer process has changed. |
| 239 // It is only called when "enable-embedded-shared-worker" flag is set. | 242 // It is only called when "enable-embedded-shared-worker" flag is set. |
| 240 void IncrementWorkerRefCount(); | 243 void IncrementWorkerRefCount(); |
| 241 void DecrementWorkerRefCount(); | 244 void DecrementWorkerRefCount(); |
| 242 | 245 |
| 243 void SetWebUIHandle(int32 view_routing_id, | 246 // Establish a connection to a renderer-provided service. See |
| 244 mojo::ScopedMessagePipeHandle handle); | 247 // content/common/mojo/mojo_service_names.h for a list of services. |
| 248 void ConnectTo(const base::StringPiece& service_name, |
| 249 mojo::ScopedMessagePipeHandle handle); |
| 245 | 250 |
| 246 protected: | 251 protected: |
| 247 // A proxy for our IPC::Channel that lives on the IO thread (see | 252 // A proxy for our IPC::Channel that lives on the IO thread (see |
| 248 // browser_process.h) | 253 // browser_process.h) |
| 249 scoped_ptr<IPC::ChannelProxy> channel_; | 254 scoped_ptr<IPC::ChannelProxy> channel_; |
| 250 | 255 |
| 251 // True if fast shutdown has been performed on this RPH. | 256 // True if fast shutdown has been performed on this RPH. |
| 252 bool fast_shutdown_started_; | 257 bool fast_shutdown_started_; |
| 253 | 258 |
| 254 // True if we've posted a DeleteTask and will be deleted soon. | 259 // True if we've posted a DeleteTask and will be deleted soon. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 void ProcessDied(bool already_dead); | 304 void ProcessDied(bool already_dead); |
| 300 | 305 |
| 301 virtual void OnGpuSwitching() OVERRIDE; | 306 virtual void OnGpuSwitching() OVERRIDE; |
| 302 | 307 |
| 303 #if defined(ENABLE_WEBRTC) | 308 #if defined(ENABLE_WEBRTC) |
| 304 // Sends |file_for_transit| to the render process. | 309 // Sends |file_for_transit| to the render process. |
| 305 void SendAecDumpFileToRenderer(IPC::PlatformFileForTransit file_for_transit); | 310 void SendAecDumpFileToRenderer(IPC::PlatformFileForTransit file_for_transit); |
| 306 void SendDisableAecDumpToRenderer(); | 311 void SendDisableAecDumpToRenderer(); |
| 307 #endif | 312 #endif |
| 308 | 313 |
| 314 scoped_ptr<MojoApplicationHost> mojo_application_host_; |
| 315 |
| 309 // The registered IPC listener objects. When this list is empty, we should | 316 // The registered IPC listener objects. When this list is empty, we should |
| 310 // delete ourselves. | 317 // delete ourselves. |
| 311 IDMap<IPC::Listener> listeners_; | 318 IDMap<IPC::Listener> listeners_; |
| 312 | 319 |
| 313 // The count of currently visible widgets. Since the host can be a container | 320 // The count of currently visible widgets. Since the host can be a container |
| 314 // for multiple widgets, it uses this count to determine when it should be | 321 // for multiple widgets, it uses this count to determine when it should be |
| 315 // backgrounded. | 322 // backgrounded. |
| 316 int32 visible_widgets_; | 323 int32 visible_widgets_; |
| 317 | 324 |
| 318 // Does this process have backgrounded priority. | 325 // Does this process have backgrounded priority. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 #endif | 431 #endif |
| 425 | 432 |
| 426 // Message filter and dispatcher for screen orientation. | 433 // Message filter and dispatcher for screen orientation. |
| 427 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_; | 434 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_; |
| 428 | 435 |
| 429 int worker_ref_count_; | 436 int worker_ref_count_; |
| 430 | 437 |
| 431 // Records the time when the process starts surviving for workers for UMA. | 438 // Records the time when the process starts surviving for workers for UMA. |
| 432 base::TimeTicks survive_for_worker_start_time_; | 439 base::TimeTicks survive_for_worker_start_time_; |
| 433 | 440 |
| 434 scoped_ptr<RenderProcessHostMojoImpl> render_process_host_mojo_; | |
| 435 | |
| 436 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; | 441 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; |
| 437 | 442 |
| 438 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 443 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 439 }; | 444 }; |
| 440 | 445 |
| 441 } // namespace content | 446 } // namespace content |
| 442 | 447 |
| 443 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 448 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |