| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_MOJO_IMPL_H_ | |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_MOJO_IMPL_H_ | |
| 7 | |
| 8 #include "base/memory/scoped_ptr.h" | |
| 9 #include "base/process/process_handle.h" | |
| 10 #include "content/common/mojo/render_process.mojom.h" | |
| 11 #include "mojo/public/cpp/bindings/remote_ptr.h" | |
| 12 | |
| 13 namespace mojo { | |
| 14 namespace common { | |
| 15 class MojoChannelInit; | |
| 16 } | |
| 17 } | |
| 18 | |
| 19 namespace content { | |
| 20 | |
| 21 class RenderProcessHost; | |
| 22 | |
| 23 // RenderProcessHostMojoImpl is responsible for initiating and maintaining the | |
| 24 // connection with the content side of RenderProcessHostMojo. | |
| 25 class RenderProcessHostMojoImpl : public RenderProcessHostMojo { | |
| 26 public: | |
| 27 explicit RenderProcessHostMojoImpl(RenderProcessHost* host); | |
| 28 virtual ~RenderProcessHostMojoImpl(); | |
| 29 | |
| 30 void SetWebUIHandle(int32 view_routing_id, | |
| 31 mojo::ScopedMessagePipeHandle handle); | |
| 32 | |
| 33 // Invoked when the RenderPorcessHost has established a channel. | |
| 34 void OnProcessLaunched(); | |
| 35 | |
| 36 private: | |
| 37 struct PendingHandle; | |
| 38 | |
| 39 // Establishes the mojo channel to the renderer. | |
| 40 void CreateMojoChannel(base::ProcessHandle process_handle); | |
| 41 | |
| 42 RenderProcessHost* host_; | |
| 43 | |
| 44 // Used to establish the connection. | |
| 45 scoped_ptr<mojo::common::MojoChannelInit> mojo_channel_init_; | |
| 46 | |
| 47 mojo::RemotePtr<content::RenderProcessMojo> render_process_mojo_; | |
| 48 | |
| 49 // If non-null we're waiting to send a WebUI handle to the renderer when | |
| 50 // connected. | |
| 51 scoped_ptr<PendingHandle> pending_handle_; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(RenderProcessHostMojoImpl); | |
| 54 }; | |
| 55 | |
| 56 } // namespace content | |
| 57 | |
| 58 #endif // CONTENT_BROWSER_RENDERER_HOST_BROWSER_RENDER_PROCESS_HOST_MOJO_IMPL_H
_ | |
| OLD | NEW |