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" |
18 #include "content/browser/power_monitor_message_broadcaster.h" | 19 #include "content/browser/power_monitor_message_broadcaster.h" |
19 #include "content/common/content_export.h" | 20 #include "content/common/content_export.h" |
| 21 #include "content/common/mojo/service_registry_impl.h" |
20 #include "content/public/browser/gpu_data_manager_observer.h" | 22 #include "content/public/browser/gpu_data_manager_observer.h" |
21 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
22 #include "ipc/ipc_channel_proxy.h" | 24 #include "ipc/ipc_channel_proxy.h" |
23 #include "ipc/ipc_platform_file.h" | 25 #include "ipc/ipc_platform_file.h" |
24 #include "mojo/public/cpp/bindings/interface_ptr.h" | 26 #include "mojo/public/cpp/bindings/interface_ptr.h" |
25 | 27 |
26 #if defined(OS_MACOSX) | 28 #if defined(OS_MACOSX) |
27 #include <IOSurface/IOSurfaceAPI.h> | 29 #include <IOSurface/IOSurfaceAPI.h> |
28 #include "base/mac/scoped_cftyperef.h" | 30 #include "base/mac/scoped_cftyperef.h" |
29 #endif | 31 #endif |
30 | 32 |
31 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; | 33 struct ViewHostMsg_CompositorSurfaceBuffersSwapped_Params; |
32 | 34 |
33 namespace base { | 35 namespace base { |
34 class CommandLine; | 36 class CommandLine; |
35 class MessageLoop; | 37 class MessageLoop; |
36 } | 38 } |
37 | 39 |
38 namespace gfx { | 40 namespace gfx { |
39 class Size; | 41 class Size; |
40 struct GpuMemoryBufferHandle; | 42 struct GpuMemoryBufferHandle; |
41 } | 43 } |
42 | 44 |
43 namespace content { | 45 namespace content { |
44 class AudioRendererHost; | 46 class AudioRendererHost; |
45 class BrowserDemuxerAndroid; | 47 class BrowserDemuxerAndroid; |
46 class GpuMessageFilter; | 48 class GpuMessageFilter; |
47 class MessagePortMessageFilter; | 49 class MessagePortMessageFilter; |
48 class MojoApplicationHost; | |
49 #if defined(ENABLE_WEBRTC) | 50 #if defined(ENABLE_WEBRTC) |
50 class P2PSocketDispatcherHost; | 51 class P2PSocketDispatcherHost; |
51 #endif | 52 #endif |
52 class PeerConnectionTrackerHost; | 53 class PeerConnectionTrackerHost; |
53 class RendererMainThread; | 54 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; |
146 | 147 |
147 // IPC::Sender via RenderProcessHost. | 148 // IPC::Sender via RenderProcessHost. |
148 virtual bool Send(IPC::Message* msg) OVERRIDE; | 149 virtual bool Send(IPC::Message* msg) OVERRIDE; |
149 | 150 |
150 // IPC::Listener via RenderProcessHost. | 151 // IPC::Listener via RenderProcessHost. |
151 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 152 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
152 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; | 153 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; |
153 virtual void OnChannelError() OVERRIDE; | 154 virtual void OnChannelError() OVERRIDE; |
154 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE; | 155 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE; |
155 | 156 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 void set_is_isolated_guest_for_testing(bool is_isolated_guest) { | 244 void set_is_isolated_guest_for_testing(bool is_isolated_guest) { |
244 is_isolated_guest_ = is_isolated_guest; | 245 is_isolated_guest_ = is_isolated_guest; |
245 } | 246 } |
246 | 247 |
247 // Called when the existence of the other renderer process which is connected | 248 // Called when the existence of the other renderer process which is connected |
248 // to the Worker in this renderer process has changed. | 249 // to the Worker in this renderer process has changed. |
249 // It is only called when "enable-embedded-shared-worker" flag is set. | 250 // It is only called when "enable-embedded-shared-worker" flag is set. |
250 void IncrementWorkerRefCount(); | 251 void IncrementWorkerRefCount(); |
251 void DecrementWorkerRefCount(); | 252 void DecrementWorkerRefCount(); |
252 | 253 |
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 | |
266 // Call this function to resume the navigation when it was deferred | 254 // Call this function to resume the navigation when it was deferred |
267 // immediately after receiving response headers. | 255 // immediately after receiving response headers. |
268 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); | 256 void ResumeResponseDeferredAtStart(const GlobalRequestID& request_id); |
269 | 257 |
| 258 // Activates Mojo for this process. Does nothing if Mojo is already activated. |
| 259 void EnsureMojoActivated(); |
| 260 |
270 protected: | 261 protected: |
271 // A proxy for our IPC::Channel that lives on the IO thread (see | 262 // A proxy for our IPC::Channel that lives on the IO thread (see |
272 // browser_process.h) | 263 // browser_process.h) |
273 scoped_ptr<IPC::ChannelProxy> channel_; | 264 scoped_ptr<IPC::ChannelProxy> channel_; |
274 | 265 |
275 // True if fast shutdown has been performed on this RPH. | 266 // True if fast shutdown has been performed on this RPH. |
276 bool fast_shutdown_started_; | 267 bool fast_shutdown_started_; |
277 | 268 |
278 // True if we've posted a DeleteTask and will be deleted soon. | 269 // True if we've posted a DeleteTask and will be deleted soon. |
279 bool deleting_soon_; | 270 bool deleting_soon_; |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 #if defined(OS_MACOSX) | 461 #if defined(OS_MACOSX) |
471 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; | 462 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; |
472 #endif | 463 #endif |
473 | 464 |
474 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); | 465 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); |
475 }; | 466 }; |
476 | 467 |
477 } // namespace content | 468 } // namespace content |
478 | 469 |
479 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ | 470 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ |
OLD | NEW |