blob: 04acab67053ab20a8162da90abec52f478db8572 [file] [log] [blame]
Chris Masone7aa5f902011-07-11 11:13:35 -07001// 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 Chanc45688b2014-07-02 23:50:45 -07005#ifndef SHILL_EPHEMERAL_PROFILE_H_
6#define SHILL_EPHEMERAL_PROFILE_H_
Chris Masone7aa5f902011-07-11 11:13:35 -07007
8#include <string>
9#include <vector>
10
Paul Stewart26b327e2011-10-19 11:38:09 -070011#include "shill/event_dispatcher.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070012#include "shill/profile.h"
13#include "shill/property_store.h"
14#include "shill/refptr_types.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070015
16namespace shill {
17
18class ControlInterface;
Chris Masone6791a432011-07-12 13:23:19 -070019class Manager;
Chris Masone9d779932011-08-25 16:33:41 -070020class StoreInterface;
Chris Masone7aa5f902011-07-11 11:13:35 -070021
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.
24class EphemeralProfile : public Profile {
25 public:
Paul Stewarta794cd62015-06-16 13:13:10 -070026 EphemeralProfile(ControlInterface* control_interface,
27 Metrics* metrics,
28 Manager* manager);
Ben Chan5ea763b2014-08-13 11:07:54 -070029 ~EphemeralProfile() override;
Chris Masone7aa5f902011-07-11 11:13:35 -070030
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070031 std::string GetFriendlyName() override;
Paul Stewarta794cd62015-06-16 13:13:10 -070032 bool AdoptService(const ServiceRefPtr& service) override;
33 bool AbandonService(const ServiceRefPtr& service) override;
Chris Masone9d779932011-08-25 16:33:41 -070034
35 // Should not be called.
Alex Vakulenko016fa0e2014-08-11 15:59:58 -070036 bool Save() override;
Chris Masone9d779932011-08-25 16:33:41 -070037
38 // Leaves |path| untouched and returns false.
Paul Stewarta794cd62015-06-16 13:13:10 -070039 bool GetStoragePath(base::FilePath* /*path*/) override {
mukesh agrawal86a22592014-07-25 14:58:40 -070040 return false;
41 }
Chris Masone7aa5f902011-07-11 11:13:35 -070042
43 private:
mukesh agrawal86a22592014-07-25 14:58:40 -070044 static const char kFriendlyName[];
45
Chris Masone7aa5f902011-07-11 11:13:35 -070046 DISALLOW_COPY_AND_ASSIGN(EphemeralProfile);
47};
48
49} // namespace shill
50
Ben Chanc45688b2014-07-02 23:50:45 -070051#endif // SHILL_EPHEMERAL_PROFILE_H_