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

Side by Side Diff: dbus/bus.cc

Issue 26289002: Track active references in ShillClientHelper (Take 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 2 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_service_client.cc ('k') | dbus/object_proxy.h » ('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 "dbus/bus.h" 5 #include "dbus/bus.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 const ObjectPath& object_path, 258 const ObjectPath& object_path,
259 int options, 259 int options,
260 const base::Closure& callback) { 260 const base::Closure& callback) {
261 AssertOnOriginThread(); 261 AssertOnOriginThread();
262 262
263 // Check if we have the requested object proxy. 263 // Check if we have the requested object proxy.
264 const ObjectProxyTable::key_type key(service_name + object_path.value(), 264 const ObjectProxyTable::key_type key(service_name + object_path.value(),
265 options); 265 options);
266 ObjectProxyTable::iterator iter = object_proxy_table_.find(key); 266 ObjectProxyTable::iterator iter = object_proxy_table_.find(key);
267 if (iter != object_proxy_table_.end()) { 267 if (iter != object_proxy_table_.end()) {
268 scoped_refptr<ObjectProxy> object_proxy = iter->second;
269 object_proxy_table_.erase(iter);
268 // Object is present. Remove it now and Detach in the DBus thread. 270 // Object is present. Remove it now and Detach in the DBus thread.
269 GetDBusTaskRunner()->PostTask( 271 GetDBusTaskRunner()->PostTask(
270 FROM_HERE, 272 FROM_HERE,
271 base::Bind(&Bus::RemoveObjectProxyInternal, 273 base::Bind(&Bus::RemoveObjectProxyInternal,
272 this, iter->second, callback)); 274 this, object_proxy, callback));
273
274 object_proxy_table_.erase(iter);
275 return true; 275 return true;
276 } 276 }
277 return false; 277 return false;
278 } 278 }
279 279
280 void Bus::RemoveObjectProxyInternal(scoped_refptr<ObjectProxy> object_proxy, 280 void Bus::RemoveObjectProxyInternal(scoped_refptr<ObjectProxy> object_proxy,
281 const base::Closure& callback) { 281 const base::Closure& callback) {
282 AssertOnDBusThread(); 282 AssertOnDBusThread();
283 283
284 object_proxy.get()->Detach(); 284 object_proxy.get()->Detach();
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after
1189 kNameOwnerChangedSignal)) { 1189 kNameOwnerChangedSignal)) {
1190 Bus* self = static_cast<Bus*>(data); 1190 Bus* self = static_cast<Bus*>(data);
1191 self->OnServiceOwnerChanged(message); 1191 self->OnServiceOwnerChanged(message);
1192 } 1192 }
1193 // Always return unhandled to let others, e.g. ObjectProxies, handle the same 1193 // Always return unhandled to let others, e.g. ObjectProxies, handle the same
1194 // signal. 1194 // signal.
1195 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; 1195 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
1196 } 1196 }
1197 1197
1198 } // namespace dbus 1198 } // namespace dbus
OLDNEW
« no previous file with comments | « chromeos/dbus/shill_service_client.cc ('k') | dbus/object_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698