Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 1 | // Copyright (c) 2011 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 | |
| 5 | #ifndef SHILL_EPHEMERAL_PROFILE_ |
| 6 | #define SHILL_EPHEMERAL_PROFILE_ |
| 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <base/memory/scoped_ptr.h> |
| 12 | |
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 13 | #include "shill/event_dispatcher.h" |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 14 | #include "shill/profile.h" |
| 15 | #include "shill/property_store.h" |
| 16 | #include "shill/refptr_types.h" |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 17 | |
| 18 | namespace shill { |
| 19 | |
| 20 | class ControlInterface; |
Chris Masone | 6791a43 | 2011-07-12 13:23:19 -0700 | [diff] [blame] | 21 | class Manager; |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 22 | class StoreInterface; |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 23 | |
| 24 | // An in-memory profile that is not persisted to disk, but allows the |
| 25 | // promotion of entries contained herein to the currently active profile. |
| 26 | class EphemeralProfile : public Profile { |
| 27 | public: |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 28 | EphemeralProfile(ControlInterface *control_interface, Manager *manager); |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 29 | virtual ~EphemeralProfile(); |
| 30 | |
Chris Masone | 6515aab | 2011-10-12 16:19:09 -0700 | [diff] [blame] | 31 | virtual bool AdoptService(const ServiceRefPtr &service); |
| 32 | virtual bool AbandonService(const ServiceRefPtr &service); |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 33 | |
| 34 | // Should not be called. |
Chris Masone | b9c0059 | 2011-10-06 13:10:39 -0700 | [diff] [blame] | 35 | virtual bool Save(); |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 36 | |
| 37 | // Leaves |path| untouched and returns false. |
mukesh agrawal | 1830fa1 | 2011-09-26 14:31:40 -0700 | [diff] [blame] | 38 | virtual bool GetStoragePath(FilePath */*path*/) { return false; } |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 39 | |
| 40 | private: |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 41 | DISALLOW_COPY_AND_ASSIGN(EphemeralProfile); |
| 42 | }; |
| 43 | |
| 44 | } // namespace shill |
| 45 | |
| 46 | #endif // SHILL_EPHEMERAL_PROFILE_ |