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

Side by Side Diff: content/renderer/mojo/mojo_render_process_observer.h

Issue 236813002: Move Mojo channel initialization closer to IPC::Channel setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more missing deps Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « content/content_worker.gypi ('k') | content/renderer/mojo/mojo_render_process_observer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
6 #define CONTENT_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "content/common/mojo/render_process.mojom.h"
10 #include "content/public/renderer/render_process_observer.h"
11 #include "ipc/ipc_platform_file.h"
12 #include "mojo/public/cpp/bindings/remote_ptr.h"
13
14 namespace mojo {
15 namespace common {
16 class MojoChannelInit;
17 }
18 namespace embedder {
19 struct ChannelInfo;
20 }
21 }
22
23 namespace content {
24
25 class RenderThread;
26
27 // RenderProcessObserver implementation that initializes the mojo channel when
28 // the right IPC is seen.
29 // MojoRenderProcessObserver deletes itself when the RenderProcess is shutdown.
30 class MojoRenderProcessObserver
31 : public content::RenderProcessObserver,
32 public RenderProcessMojo {
33 public:
34 MojoRenderProcessObserver(RenderThread* render_thread);
35
36 // RenderProcessObserver overrides:
37 virtual bool OnControlMessageReceived(const IPC::Message& message) OVERRIDE;
38 virtual void OnRenderProcessShutdown() OVERRIDE;
39
40 private:
41 virtual ~MojoRenderProcessObserver();
42
43 void OnChannelCreated(const IPC::PlatformFileForTransit& file);
44
45 // RenderProcessMojo overrides:
46 virtual void SetWebUIHandle(
47 int32 view_routing_id,
48 mojo::ScopedMessagePipeHandle web_ui_handle) OVERRIDE;
49
50 content::RenderThread* render_thread_;
51
52 scoped_ptr<mojo::common::MojoChannelInit> channel_init_;
53
54 mojo::RemotePtr<content::RenderProcessHostMojo> render_process_host_mojo_;
55
56 DISALLOW_COPY_AND_ASSIGN(MojoRenderProcessObserver);
57 };
58
59 } // namespace content
60
61 #endif // CONTENT_RENDERER_MOJO_MOJO_RENDER_PROCESS_OBSERVER_H_
OLDNEW
« no previous file with comments | « content/content_worker.gypi ('k') | content/renderer/mojo/mojo_render_process_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698