Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: content/browser/renderer_host/render_process_host_impl.h

Issue 285333003: Support exposing Mojo services between render frames, render threads, and their respective hosts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: InterfaceRequest in RenderFrameSetup Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/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/common/mojo/service_registry_impl.h"
20 #include "content/public/browser/gpu_data_manager_observer.h" 21 #include "content/public/browser/gpu_data_manager_observer.h"
21 #include "content/public/browser/render_process_host.h" 22 #include "content/public/browser/render_process_host.h"
22 #include "ipc/ipc_channel_proxy.h" 23 #include "ipc/ipc_channel_proxy.h"
23 #include "ipc/ipc_platform_file.h" 24 #include "ipc/ipc_platform_file.h"
24 #include "mojo/public/cpp/bindings/interface_ptr.h" 25 #include "mojo/public/cpp/bindings/interface_ptr.h"
25 26
26 #if defined(OS_MACOSX) 27 #if defined(OS_MACOSX)
27 #include <IOSurface/IOSurfaceAPI.h> 28 #include <IOSurface/IOSurfaceAPI.h>
28 #include "base/mac/scoped_cftyperef.h" 29 #include "base/mac/scoped_cftyperef.h"
29 #endif 30 #endif
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 virtual void SetWebRtcLogMessageCallback( 138 virtual void SetWebRtcLogMessageCallback(
138 base::Callback<void(const std::string&)> callback) OVERRIDE; 139 base::Callback<void(const std::string&)> callback) OVERRIDE;
139 virtual WebRtcStopRtpDumpCallback StartRtpDump( 140 virtual WebRtcStopRtpDumpCallback StartRtpDump(
140 bool incoming, 141 bool incoming,
141 bool outgoing, 142 bool outgoing,
142 const WebRtcRtpPacketCallback& packet_callback) OVERRIDE; 143 const WebRtcRtpPacketCallback& packet_callback) OVERRIDE;
143 #endif 144 #endif
144 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id) 145 virtual void ResumeDeferredNavigation(const GlobalRequestID& request_id)
145 OVERRIDE; 146 OVERRIDE;
146 virtual void NotifyTimezoneChange() OVERRIDE; 147 virtual void NotifyTimezoneChange() OVERRIDE;
148 virtual ServiceRegistry* GetServiceRegistry() OVERRIDE;
149 virtual void ActivateMojo() OVERRIDE;
147 150
148 // IPC::Sender via RenderProcessHost. 151 // IPC::Sender via RenderProcessHost.
149 virtual bool Send(IPC::Message* msg) OVERRIDE; 152 virtual bool Send(IPC::Message* msg) OVERRIDE;
150 153
151 // IPC::Listener via RenderProcessHost. 154 // IPC::Listener via RenderProcessHost.
152 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 155 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
153 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE; 156 virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
154 virtual void OnChannelError() OVERRIDE; 157 virtual void OnChannelError() OVERRIDE;
155 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE; 158 virtual void OnBadMessageReceived(const IPC::Message& message) OVERRIDE;
156 159
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 void set_is_isolated_guest_for_testing(bool is_isolated_guest) { 250 void set_is_isolated_guest_for_testing(bool is_isolated_guest) {
248 is_isolated_guest_ = is_isolated_guest; 251 is_isolated_guest_ = is_isolated_guest;
249 } 252 }
250 253
251 // Called when the existence of the other renderer process which is connected 254 // Called when the existence of the other renderer process which is connected
252 // to the Worker in this renderer process has changed. 255 // to the Worker in this renderer process has changed.
253 // It is only called when "enable-embedded-shared-worker" flag is set. 256 // It is only called when "enable-embedded-shared-worker" flag is set.
254 void IncrementWorkerRefCount(); 257 void IncrementWorkerRefCount();
255 void DecrementWorkerRefCount(); 258 void DecrementWorkerRefCount();
256 259
257 // Establish a connection to a renderer-provided service. See
258 // content/common/mojo/mojo_service_names.h for a list of services.
259 void ConnectTo(const base::StringPiece& service_name,
260 mojo::ScopedMessagePipeHandle handle);
261
262 template <typename Interface>
263 void ConnectTo(const base::StringPiece& service_name,
264 mojo::InterfacePtr<Interface>* ptr) {
265 mojo::MessagePipe pipe;
266 ptr->Bind(pipe.handle0.Pass());
267 ConnectTo(service_name, pipe.handle1.Pass());
268 }
269
270 protected: 260 protected:
271 // A proxy for our IPC::Channel that lives on the IO thread (see 261 // A proxy for our IPC::Channel that lives on the IO thread (see
272 // browser_process.h) 262 // browser_process.h)
273 scoped_ptr<IPC::ChannelProxy> channel_; 263 scoped_ptr<IPC::ChannelProxy> channel_;
274 264
275 // True if fast shutdown has been performed on this RPH. 265 // True if fast shutdown has been performed on this RPH.
276 bool fast_shutdown_started_; 266 bool fast_shutdown_started_;
277 267
278 // True if we've posted a DeleteTask and will be deleted soon. 268 // True if we've posted a DeleteTask and will be deleted soon.
279 bool deleting_soon_; 269 bool deleting_soon_;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 #endif 442 #endif
453 443
454 // Message filter and dispatcher for screen orientation. 444 // Message filter and dispatcher for screen orientation.
455 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_; 445 ScreenOrientationDispatcherHost* screen_orientation_dispatcher_host_;
456 446
457 int worker_ref_count_; 447 int worker_ref_count_;
458 448
459 // Records the time when the process starts surviving for workers for UMA. 449 // Records the time when the process starts surviving for workers for UMA.
460 base::TimeTicks survive_for_worker_start_time_; 450 base::TimeTicks survive_for_worker_start_time_;
461 451
452 ServiceRegistryImpl service_registry_;
453
462 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_; 454 base::WeakPtrFactory<RenderProcessHostImpl> weak_factory_;
463 455
464 #if defined(OS_MACOSX) 456 #if defined(OS_MACOSX)
465 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_; 457 base::ScopedCFTypeRef<IOSurfaceRef> last_io_surface_;
466 #endif 458 #endif
467 459
468 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl); 460 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostImpl);
469 }; 461 };
470 462
471 } // namespace content 463 } // namespace content
472 464
473 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_ 465 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698