| 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/dom_storage/session_storage_namespace_impl.h" | 17 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 18 #include "content/browser/mojo/mojo_application_host.h" | |
| 19 #include "content/browser/power_monitor_message_broadcaster.h" | 18 #include "content/browser/power_monitor_message_broadcaster.h" |
| 20 #include "content/common/content_export.h" | 19 #include "content/common/content_export.h" |
| 21 #include "content/common/mojo/service_registry_impl.h" | |
| 22 #include "content/public/browser/gpu_data_manager_observer.h" | 20 #include "content/public/browser/gpu_data_manager_observer.h" |
| 23 #include "content/public/browser/render_process_host.h" | 21 #include "content/public/browser/render_process_host.h" |
| 24 #include "ipc/ipc_channel_proxy.h" | 22 #include "ipc/ipc_channel_proxy.h" |
| 25 #include "ipc/ipc_platform_file.h" | 23 #include "ipc/ipc_platform_file.h" |
| 26 #include "mojo/public/cpp/bindings/interface_ptr.h" | 24 #include "mojo/public/cpp/bindings/interface_ptr.h" |
| 27 | 25 |
| 28 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
| 29 #include <IOSurface/IOSurfaceAPI.h> | 27 #include <IOSurface/IOSurfaceAPI.h> |
| 30 #include "base/mac/scoped_cftyperef.h" | 28 #include "base/mac/scoped_cftyperef.h" |
| 31 #endif | 29 #endif |
| 32 | 30 |
| 33 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 31 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
| 34 | 32 |
| 35 namespace base { | 33 namespace base { |
| 36 class CommandLine; | 34 class CommandLine; |
| 37 class MessageLoop; | 35 class MessageLoop; |
| 38 } | 36 } |
| 39 | 37 |
| 40 namespace gfx { | 38 namespace gfx { |
| 41 class Size; | 39 class Size; |
| 42 struct GpuMemoryBufferHandle; | 40 struct GpuMemoryBufferHandle; |
| 43 } | 41 } |
| 44 | 42 |
| 45 namespace content { | 43 namespace content { |
| 46 class AudioRendererHost; | 44 class AudioRendererHost; |
| 47 class BrowserDemuxerAndroid; | 45 class BrowserDemuxerAndroid; |
| 48 class GpuMessageFilter; | 46 class GpuMessageFilter; |
| 49 class MessagePortMessageFilter; | 47 class MessagePortMessageFilter; |
| 48 class MojoApplicationHost; |
| 50 #if defined(ENABLE_WEBRTC) | 49 #if defined(ENABLE_WEBRTC) |
| 51 class P2PSocketDispatcherHost; | 50 class P2PSocketDispatcherHost; |
| 52 #endif | 51 #endif |
| 53 class PeerConnectionTrackerHost; | 52 class PeerConnectionTrackerHost; |
| 54 class RendererMainThread; | 53 class RendererMainThread; |
| 54 class RenderProcessHostMojoImpl; |
| 55 class RenderWidgetHelper; | 55 class RenderWidgetHelper; |
| 56 class RenderWidgetHost; | 56 class RenderWidgetHost; |
| 57 class RenderWidgetHostImpl; | 57 class RenderWidgetHostImpl; |
| 58 class RenderWidgetHostViewFrameSubscriber; | 58 class RenderWidgetHostViewFrameSubscriber; |
| 59 class StoragePartition; | 59 class StoragePartition; |
| 60 class StoragePartitionImpl; | 60 class StoragePartitionImpl; |
| 61 | 61 |
| 62 typedef base::Thread* (*RendererMainThreadFactoryFunction)( | 62 typedef base::Thread* (*RendererMainThreadFactoryFunction)( |
| 63 const std::string& id); | 63 const std::string& id); |
| 64 | 64 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 virtual void SetWebRtcLogMessageCallback( | 136 virtual void SetWebRtcLogMessageCallback( |
| 137 base::Callback<void(const std::string&)> callback) OVERRIDE; | 137 base::Callback<void(const std::string&)> callback) OVERRIDE; |
| 138 virtual WebRtcStopRtpDumpCallback StartRtpDump( | 138 virtual WebRtcStopRtpDumpCallback StartRtpDump( |
| 139 bool incoming, | 139 bool incoming, |
| 140 bool outgoing, | 140 bool outgoing, |
| 141 const WebRtcRtpPacketCallback& packet_callback) OVERRIDE; | 141 const WebRtcRtpPacketCallback& packet_callback) OVERRIDE; |
| 142 #endif | 142 #endif |
| 143 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) | 143 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) |
| 144 OVERRIDE; | 144 OVERRIDE; |
| 145 virtual void NotifyTimezoneChange() OVERRIDE; | 145 virtual void NotifyTimezoneChange() OVERRIDE; |
| 146 virtual ServiceRegistry* GetServiceRegistry() OVERRIDE; | |
| 147 | 146 |
| 148 // IPC::Sender via RenderProcessHost. | 147 // IPC::Sender via RenderProcessHost. |
| 149 virtual bool Send(IPC::Message* msg) OVERRIDE; | 148 virtual bool Send(IPC::Message* msg) OVERRIDE; |
| 150 | 149 |
| 151 // IPC::Listener via RenderProcessHost. | 150 // IPC::Listener via RenderProcessHost. |
| 152 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 151 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 153 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 152 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
| 154 virtual void OnChannelError() OVERRIDE; | 153 virtual void OnChannelError() OVERRIDE; |
| 155 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE; | 154 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE; |
| 156 | 155 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 void set_is_isolated_guest_for_testing(bool is_isolated_guest) { | 243 void set_is_isolated_guest_for_testing(bool is_isolated_guest) { |
| 245 is_isolated_guest_ = is_isolated_guest; | 244 is_isolated_guest_ = is_isolated_guest; |
| 246 } | 245 } |
| 247 | 246 |
| 248 // Called when the existence of the other renderer process which is connected | 247 // Called when the existence of the other renderer process which is connected |
| 249 // to the Worker in this renderer process has changed. | 248 // to the Worker in this renderer process has changed. |
| 250 // It is only called when "enable-embedded-shared-worker" flag is set. | 249 // It is only called when "enable-embedded-shared-worker" flag is set. |
| 251 void IncrementWorkerRefCount(); | 250 void IncrementWorkerRefCount(); |
| 252 void DecrementWorkerRefCount(); | 251 void DecrementWorkerRefCount(); |
| 253 | 252 |
| 253 // Establish a connection to a renderer-provided service. See |
| 254 // content/common/mojo/mojo_service_names.h for a list of services. |
| 255 void ConnectTo(const base::StringPiece& service_name, |
| 256 mojo::ScopedMessagePipeHandle handle); |
| 257 |
| 258 template <typename Interface> |
| 259 void ConnectTo(const base::StringPiece& service_name, |
| 260 mojo::InterfacePtr<Interface>* ptr) { |
| 261 mojo::MessagePipe pipe; |
| 262 ptr->Bind(pipe.handle0.Pass()); |
| 263 ConnectTo(service_name, pipe.handle1.Pass()); |
| 264 } |
| 265 |
| 254 // Call this function to resume the navigation when it was deferred | 266 // Call this function to resume the navigation when it was deferred |
| 255 // immediately after receiving response headers. | 267 // immediately after receiving response headers. |
| 256 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); | 268 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); |
| 257 | 269 |
| 258 // Activates Mojo for this process. Does nothing if Mojo is already activated. | |
| 259 void EnsureMojoActivated(); | |
| 260 | |
| 261 protected: | 270 protected: |
| 262 // A proxy for our IPC::Channel that lives on the IO thread (see | 271 // A proxy for our IPC::Channel that lives on the IO thread (see |
| 263 // browser_process.h) | 272 // browser_process.h) |
| 264 scoped_ptr<IPC::ChannelProxy> channel_; | 273 scoped_ptr<IPC::ChannelProxy> channel_; |
| 265 | 274 |
| 266 // True if fast shutdown has been performed on this RPH. | 275 // True if fast shutdown has been performed on this RPH. |
| 267 bool fast_shutdown_started_; | 276 bool fast_shutdown_started_; |
| 268 | 277 |
| 269 // True if we've posted a DeleteTask and will be deleted soon. | 278 // True if we've posted a DeleteTask and will be deleted soon. |
| 270 bool deleting_soon_; | 279 bool deleting_soon_; |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 #if defined(OS_MACOSX) | 470 #if defined(OS_MACOSX) |
| 462 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; | 471 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; |
| 463 #endif | 472 #endif |
| 464 | 473 |
| 465 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 474 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
| 466 }; | 475 }; |
| 467 | 476 |
| 468 } // namespace content | 477 } // namespace content |
| 469 | 478 |
| 470 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 479 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
| OLD | NEW |