blob: 26814dd6003247ef32bedf42b7885392aa1eae17 [file] [log] [blame]
Ben Chanfad4a0b2012-04-18 15:49:59 -07001// Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Chris Masone7aa5f902011-07-11 11:13:35 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "shill/ephemeral_profile.h"
6
Chris Masone7aa5f902011-07-11 11:13:35 -07007#include <chromeos/dbus/service_constants.h>
8
9#include "shill/adaptor_interfaces.h"
10#include "shill/control_interface.h"
Christopher Wileyb691efd2012-08-09 13:51:51 -070011#include "shill/logging.h"
Chris Masone7aa5f902011-07-11 11:13:35 -070012#include "shill/manager.h"
13
Chris Masone7aa5f902011-07-11 11:13:35 -070014namespace shill {
15
16EphemeralProfile::EphemeralProfile(ControlInterface *control_interface,
Thieu Le5133b712013-02-19 14:47:21 -080017 Metrics *metrics,
Chris Masone7aa5f902011-07-11 11:13:35 -070018 Manager *manager)
Thieu Le5133b712013-02-19 14:47:21 -080019 : Profile(control_interface, metrics, manager, Identifier(), "", false) {
Chris Masone7aa5f902011-07-11 11:13:35 -070020}
21
22EphemeralProfile::~EphemeralProfile() {}
23
Chris Masone6515aab2011-10-12 16:19:09 -070024bool EphemeralProfile::AdoptService(const ServiceRefPtr &service) {
Darin Petkov457728b2013-01-09 09:49:08 +010025 SLOG(Profile, 2) << "Adding service " << service->unique_name()
Ben Chanfad4a0b2012-04-18 15:49:59 -070026 << " to ephemeral profile.";
Philipp Neubeck79173602012-11-13 21:10:09 +010027 service->SetProfile(this);
Chris Masone6515aab2011-10-12 16:19:09 -070028 return true;
29}
30
31bool EphemeralProfile::AbandonService(const ServiceRefPtr &service) {
32 if (service->profile() == this)
Philipp Neubeck79173602012-11-13 21:10:09 +010033 service->SetProfile(NULL);
Darin Petkov457728b2013-01-09 09:49:08 +010034 SLOG(Profile, 2) << "Removing service " << service->unique_name()
Ben Chanfad4a0b2012-04-18 15:49:59 -070035 << " from ephemeral profile.";
Chris Masone6515aab2011-10-12 16:19:09 -070036 return true;
Chris Masone7aa5f902011-07-11 11:13:35 -070037}
38
Chris Masoneb9c00592011-10-06 13:10:39 -070039bool EphemeralProfile::Save() {
Chris Masone9d779932011-08-25 16:33:41 -070040 NOTREACHED();
41 return false;
42}
43
Chris Masone7aa5f902011-07-11 11:13:35 -070044} // namespace shill