Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(217)

Side by Side Diff: chromeos/dbus/shill_ipconfig_client.cc

Issue 23658053: Track active references in ShillClientHelper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Feedback Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/shill_device_client.cc ('k') | chromeos/dbus/shill_manager_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/shill_ipconfig_client.h" 5 #include "chromeos/dbus/shill_ipconfig_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // Returns the corresponding ShillClientHelper for the profile. 64 // Returns the corresponding ShillClientHelper for the profile.
65 ShillClientHelper* GetHelper(const dbus::ObjectPath& ipconfig_path) { 65 ShillClientHelper* GetHelper(const dbus::ObjectPath& ipconfig_path) {
66 HelperMap::iterator it = helpers_.find(ipconfig_path.value()); 66 HelperMap::iterator it = helpers_.find(ipconfig_path.value());
67 if (it != helpers_.end()) 67 if (it != helpers_.end())
68 return it->second; 68 return it->second;
69 69
70 // There is no helper for the profile, create it. 70 // There is no helper for the profile, create it.
71 dbus::ObjectProxy* object_proxy = 71 dbus::ObjectProxy* object_proxy =
72 bus_->GetObjectProxy(flimflam::kFlimflamServiceName, ipconfig_path); 72 bus_->GetObjectProxy(flimflam::kFlimflamServiceName, ipconfig_path);
73 ShillClientHelper* helper = new ShillClientHelper(bus_, object_proxy); 73 ShillClientHelper* helper = new ShillClientHelper(object_proxy);
74 helper->MonitorPropertyChanged(flimflam::kFlimflamIPConfigInterface); 74 helper->MonitorPropertyChanged(flimflam::kFlimflamIPConfigInterface);
75 helpers_.insert(HelperMap::value_type(ipconfig_path.value(), helper)); 75 helpers_.insert(HelperMap::value_type(ipconfig_path.value(), helper));
76 return helper; 76 return helper;
77 } 77 }
78 78
79 dbus::Bus* bus_; 79 dbus::Bus* bus_;
80 HelperMap helpers_; 80 HelperMap helpers_;
81 STLValueDeleter<HelperMap> helpers_deleter_; 81 STLValueDeleter<HelperMap> helpers_deleter_;
82 82
83 DISALLOW_COPY_AND_ASSIGN(ShillIPConfigClientImpl); 83 DISALLOW_COPY_AND_ASSIGN(ShillIPConfigClientImpl);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 // static 174 // static
175 ShillIPConfigClient* ShillIPConfigClient::Create( 175 ShillIPConfigClient* ShillIPConfigClient::Create(
176 DBusClientImplementationType type) { 176 DBusClientImplementationType type) {
177 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION) 177 if (type == REAL_DBUS_CLIENT_IMPLEMENTATION)
178 return new ShillIPConfigClientImpl(); 178 return new ShillIPConfigClientImpl();
179 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type); 179 DCHECK_EQ(STUB_DBUS_CLIENT_IMPLEMENTATION, type);
180 return new ShillIPConfigClientStub(); 180 return new ShillIPConfigClientStub();
181 } 181 }
182 182
183 } // namespace chromeos 183 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_device_client.cc ('k') | chromeos/dbus/shill_manager_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698