OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium OS 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 // Some portions Copyright (c) 2009 The Chromium Authors. |
| 5 // |
| 6 // Abstract interface for implementing minijails |
| 7 |
| 8 #ifndef __CHROMEOS_MINIJAIL_INTERFACE_H |
| 9 #define __CHROMEOS_MINIJAIL_INTERFACE_H |
| 10 |
| 11 #include <base/basictypes.h> |
| 12 #include <base/scoped_ptr.h> |
| 13 |
| 14 namespace chromeos { |
| 15 namespace minijail { |
| 16 |
| 17 class Options; |
| 18 |
| 19 class Interface { |
| 20 public: |
| 21 Interface() : options_(NULL) { } // new default |
| 22 virtual ~Interface() { } |
| 23 virtual bool Initialize(const Options *options) |
| 24 { set_options(options); return true; } |
| 25 virtual const Options *options() const { return options_; } |
| 26 virtual void set_options(const Options *options) { options_ = options; } |
| 27 |
| 28 // To be overriden. |
| 29 virtual const char *name() { return "minijail::Interface"; } |
| 30 // Implements the jail logic |
| 31 virtual bool Jail() const = 0; |
| 32 // Performs the execution step. It isn't required to return. |
| 33 virtual bool Run() const; |
| 34 |
| 35 private: |
| 36 const Options *options_; |
| 37 |
| 38 DISALLOW_COPY_AND_ASSIGN(Interface); |
| 39 }; |
| 40 |
| 41 } // namespace minijail |
| 42 } // namespace chromeos |
| 43 |
| 44 #endif // __CHROMEOS_MINIJAIL_INTERFACE_H |
OLD | NEW |