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: content/common/zygote_fork_delegate.h

Issue 6995121: New NaCl zygote implementation 2 (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Use IPC::Channel directly instead of ChildProcess Created 9 years, 6 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
OLDNEW
(Empty)
1 // Copyright (c) 2011 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_COMMON_ZYGOTE_FORK_DELEGATE_H_
6 #define CONTENT_COMMON_ZYGOTE_FORK_DELEGATE_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10
11 class ZygoteForkDelegate {
12 public:
13 // A ZygoteForkDelegate is created during Chrome linux zygote
14 // initialization, and provides "fork()" functionality with
15 // as an alternative to forking the zygote. A new delegate is
16 // passed in as an argument to ZygoteMain().
17 ZygoteForkDelegate() {};
jam 2011/06/21 20:54:08 nit: no need for semicolon
Brad Chen 2011/06/21 23:43:48 Done.
18 virtual ~ZygoteForkDelegate() {};
19 // Initialization happens in the zygote after it has been
20 // started by ZygoteMain.
21 virtual void Init(const bool sandboxed,
22 const int browserdesc,
23 const int sandboxdesc) = 0;
24 // Returns 'true' if the delegate would like to handle a given
25 // fork request. Otherwise returns false.
26 virtual bool CanHelp(const std::string& process_type) = 0;
27 // Delegate forks, returning a -1 on failure. Outside the
28 // suid sandbox, Fork() returns the Linux process ID. Inside
29 // the sandbox, returns a positive integer, with PID discovery
30 // handled by the sandbox.
31 virtual pid_t Fork(const std::vector<int>& fds) = 0;
32 };
33
34 class NullForkDelegate : public ZygoteForkDelegate {
35 public:
36 NullForkDelegate() {};
37 ~NullForkDelegate() {};
38 virtual void Init(const bool sandboxed,
39 const int browserdesc,
40 const int sandboxdesc) {};
41 virtual bool CanHelp(const std::string& process_type) { return false; };
42 virtual pid_t Fork(const std::vector<int>& fds) { return -1; };
43 };
44
45 #endif // CONTENT_COMMON_ZYGOTE_FORK_DELEGATE_H_
OLDNEW
« chrome/nacl/nacl_main.cc ('K') | « content/common/sandbox_methods_linux.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698