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

Side by Side Diff: mojo/shell/child_process.h

Issue 775343004: Move //mojo/shell to //shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « mojo/shell/app_child_process_host.cc ('k') | mojo/shell/child_process.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 MOJO_SHELL_CHILD_PROCESS_H_
6 #define MOJO_SHELL_CHILD_PROCESS_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "mojo/edk/embedder/scoped_platform_handle.h"
11
12 namespace base {
13 class CommandLine;
14 }
15
16 namespace mojo {
17 namespace shell {
18
19 // A base class for child processes -- i.e., code that is actually run within
20 // the child process. (Instances are manufactured by |Create()|.)
21 class ChildProcess {
22 public:
23 enum Type {
24 TYPE_TEST,
25 // Hosts a single app (see app_child_process(_host).*).
26 TYPE_APP
27 };
28
29 virtual ~ChildProcess();
30
31 // Returns null if the command line doesn't indicate that this is a child
32 // process. |main()| should call this, and if it returns non-null it should
33 // call |Main()| (without a message loop on the current thread).
34 static scoped_ptr<ChildProcess> Create(const base::CommandLine& command_line);
35
36 // To be implemented by subclasses. This is the "entrypoint" for a child
37 // process. Run with no message loop for the main thread.
38 virtual void Main() = 0;
39
40 protected:
41 ChildProcess();
42
43 embedder::ScopedPlatformHandle* platform_channel() {
44 return &platform_channel_;
45 }
46
47 private:
48 // Available in |Main()| (after a successful |Create()|).
49 embedder::ScopedPlatformHandle platform_channel_;
50
51 DISALLOW_COPY_AND_ASSIGN(ChildProcess);
52 };
53
54 } // namespace shell
55 } // namespace mojo
56
57 #endif // MOJO_SHELL_CHILD_PROCESS_H_
OLDNEW
« no previous file with comments | « mojo/shell/app_child_process_host.cc ('k') | mojo/shell/child_process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698