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 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 5 | #ifndef SHILL_EPHEMERAL_PROFILE_H_ |
| 6 | #define SHILL_EPHEMERAL_PROFILE_H_ |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
Paul Stewart | 26b327e | 2011-10-19 11:38:09 -0700 | [diff] [blame] | 11 | #include "shill/event_dispatcher.h" |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 12 | #include "shill/profile.h" |
| 13 | #include "shill/property_store.h" |
| 14 | #include "shill/refptr_types.h" |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 15 | |
| 16 | namespace shill { |
| 17 | |
| 18 | class ControlInterface; |
Chris Masone | 6791a43 | 2011-07-12 13:23:19 -0700 | [diff] [blame] | 19 | class Manager; |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 20 | class StoreInterface; |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 21 | |
| 22 | // An in-memory profile that is not persisted to disk, but allows the |
| 23 | // promotion of entries contained herein to the currently active profile. |
| 24 | class EphemeralProfile : public Profile { |
| 25 | public: |
Thieu Le | 5133b71 | 2013-02-19 14:47:21 -0800 | [diff] [blame] | 26 | EphemeralProfile(ControlInterface *control_interface, |
| 27 | Metrics *metrics, |
| 28 | Manager *manager); |
Ben Chan | 5ea763b | 2014-08-13 11:07:54 -0700 | [diff] [blame] | 29 | ~EphemeralProfile() override; |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 30 | |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 31 | std::string GetFriendlyName() override; |
| 32 | bool AdoptService(const ServiceRefPtr &service) override; |
| 33 | bool AbandonService(const ServiceRefPtr &service) override; |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 34 | |
| 35 | // Should not be called. |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 36 | bool Save() override; |
Chris Masone | 9d77993 | 2011-08-25 16:33:41 -0700 | [diff] [blame] | 37 | |
| 38 | // Leaves |path| untouched and returns false. |
Alex Vakulenko | 016fa0e | 2014-08-11 15:59:58 -0700 | [diff] [blame] | 39 | bool GetStoragePath(base::FilePath */*path*/) override { |
mukesh agrawal | 86a2259 | 2014-07-25 14:58:40 -0700 | [diff] [blame] | 40 | return false; |
| 41 | } |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 42 | |
| 43 | private: |
mukesh agrawal | 86a2259 | 2014-07-25 14:58:40 -0700 | [diff] [blame] | 44 | static const char kFriendlyName[]; |
| 45 | |
Chris Masone | 7aa5f90 | 2011-07-11 11:13:35 -0700 | [diff] [blame] | 46 | DISALLOW_COPY_AND_ASSIGN(EphemeralProfile); |
| 47 | }; |
| 48 | |
| 49 | } // namespace shill |
| 50 | |
Ben Chan | c45688b | 2014-07-02 23:50:45 -0700 | [diff] [blame] | 51 | #endif // SHILL_EPHEMERAL_PROFILE_H_ |