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

Unified Diff: src/platform/minijail/interface.h

Issue 466049: Baseline minijail with a commandline switch driven main. (Closed)
Patch Set: fix overly long lines Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/minijail/env.cc ('k') | src/platform/minijail/interface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/minijail/interface.h
diff --git a/src/platform/minijail/interface.h b/src/platform/minijail/interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..d4d108b22c0289876175850e97eb2dced5e8a258
--- /dev/null
+++ b/src/platform/minijail/interface.h
@@ -0,0 +1,44 @@
+// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+// Some portions Copyright (c) 2009 The Chromium Authors.
+//
+// Abstract interface for implementing minijails
+
+#ifndef __CHROMEOS_MINIJAIL_INTERFACE_H
+#define __CHROMEOS_MINIJAIL_INTERFACE_H
+
+#include <base/basictypes.h>
+#include <base/scoped_ptr.h>
+
+namespace chromeos {
+namespace minijail {
+
+class Options;
+
+class Interface {
+ public:
+ Interface() : options_(NULL) { } // new default
+ virtual ~Interface() { }
+ virtual bool Initialize(const Options *options)
+ { set_options(options); return true; }
+ virtual const Options *options() const { return options_; }
+ virtual void set_options(const Options *options) { options_ = options; }
+
+ // To be overriden.
+ virtual const char *name() { return "minijail::Interface"; }
+ // Implements the jail logic
+ virtual bool Jail() const = 0;
+ // Performs the execution step. It isn't required to return.
+ virtual bool Run() const;
+
+ private:
+ const Options *options_;
+
+ DISALLOW_COPY_AND_ASSIGN(Interface);
+};
+
+} // namespace minijail
+} // namespace chromeos
+
+#endif // __CHROMEOS_MINIJAIL_INTERFACE_H
« no previous file with comments | « src/platform/minijail/env.cc ('k') | src/platform/minijail/interface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698