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

Side by Side Diff: content/child/mojo/mojo_application.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/child/child_thread.cc ('k') | content/child/mojo/mojo_application.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_CHILD_MOJO_MOJO_APPLICATION_H_
6 #define CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_
7
8 #include "ipc/ipc_platform_file.h"
9 #include "mojo/common/channel_init.h"
10 #include "mojo/public/cpp/bindings/remote_ptr.h"
11 #include "mojo/public/interfaces/shell/shell.mojom.h"
12
13 namespace IPC {
14 class Message;
15 }
16
17 namespace content {
18
19 // MojoApplication represents the code needed to setup a child process as a
20 // Mojo application via Chrome IPC. Instantiate MojoApplication and call its
21 // OnMessageReceived method to give it a shot at handling Chrome IPC messages.
22 // It makes the mojo::Shell interface available and calls methods on the given
23 // mojo::ShellClient interface as calls come in.
24 class MojoApplication {
25 public:
26 // The ShellClient pointer must remain valid for the lifetime of the
27 // MojoApplication instance.
28 explicit MojoApplication(mojo::ShellClient* shell_client);
29 ~MojoApplication();
30
31 bool OnMessageReceived(const IPC::Message& msg);
32
33 mojo::Shell* shell() { return shell_.get(); }
34
35 private:
36 void OnActivate(const IPC::PlatformFileForTransit& file);
37
38 mojo::common::ChannelInit channel_init_;
39 mojo::RemotePtr<mojo::Shell> shell_;
40 mojo::ShellClient* shell_client_;
41
42 DISALLOW_COPY_AND_ASSIGN(MojoApplication);
43 };
44
45 } // namespace content
46
47 #endif // CONTENT_CHILD_MOJO_MOJO_APPLICATION_H_
OLDNEW
« no previous file with comments | « content/child/child_thread.cc ('k') | content/child/mojo/mojo_application.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698