Index: content/browser/renderer_host/render_process_host_impl.h |
diff --git a/content/browser/renderer_host/render_process_host_impl.h b/content/browser/renderer_host/render_process_host_impl.h |
index e46e2c511257b92098a5282633d58b3f1f738b0e..de40bf8385307a6c9f7b5d51a76078cea48d1653 100644 |
--- a/content/browser/renderer_host/render_process_host_impl.h |
+++ b/content/browser/renderer_host/render_process_host_impl.h |
@@ -135,6 +135,8 @@ class CONTENT_EXPORT RenderProcessHostImpl |
void SetSuddenTerminationAllowed(bool enabled) override; |
bool SuddenTerminationAllowed() const override; |
IPC::ChannelProxy* GetChannel() override; |
+ IPC::Sender* GetImmediateSender() override; |
+ IPC::Sender* GetIOThreadSender() override; |
void AddFilter(BrowserMessageFilter* filter) override; |
bool FastShutdownForPageCount(size_t count) override; |
bool FastShutdownStarted() const override; |
@@ -291,8 +293,11 @@ class CONTENT_EXPORT RenderProcessHostImpl |
int32_t pending_views_; |
private: |
- friend class VisitRelayingRenderProcessHost; |
+ class SafeSenderProxy; |
+ |
friend class ChildProcessLauncherBrowserTest_ChildSpawnFail_Test; |
+ friend class SafeSenderProxy; |
+ friend class VisitRelayingRenderProcessHost; |
std::unique_ptr<IPC::ChannelProxy> CreateChannelProxy( |
const std::string& channel_id); |
@@ -300,6 +305,9 @@ class CONTENT_EXPORT RenderProcessHostImpl |
// Creates and adds the IO thread message filters. |
void CreateMessageFilters(); |
+ // Shared implementation for IPC::Senders exposed by this RPH. |
+ bool SendImpl(IPC::Message* message, bool send_now); |
+ |
// Registers Mojo services to be exposed to the renderer. |
void RegisterMojoServices(); |
@@ -362,6 +370,10 @@ class CONTENT_EXPORT RenderProcessHostImpl |
base::FilePath GetEventLogFilePathWithExtensions(const base::FilePath& file); |
#endif |
+ // An IPC::Sender which lives as long as this RPH and provides safe, opaque |
+ // access to ChannelProxy SendNow() and SendOnIOThread(). |
+ const std::unique_ptr<SafeSenderProxy> safe_sender_; |
+ |
std::unique_ptr<MojoChildConnection> mojo_child_connection_; |
std::unique_ptr<MojoApplicationHost> mojo_application_host_; |