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

Side by Side Diff: dbus/bus.cc

Issue 8201023: Make ExportedObject and ObjectProxy own Bus as scoped_refptr. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address comments Created 9 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 | « no previous file | dbus/bus_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // TODO(satorux): 5 // TODO(satorux):
6 // - Handle "disconnected" signal. 6 // - Handle "disconnected" signal.
7 7
8 #include "dbus/bus.h" 8 #include "dbus/bus.h"
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 LOG(ERROR) << "Failed to release all service names. # of services left: " 286 LOG(ERROR) << "Failed to release all service names. # of services left: "
287 << owned_service_names_.size(); 287 << owned_service_names_.size();
288 } 288 }
289 289
290 // Detach from the remote objects. 290 // Detach from the remote objects.
291 for (ObjectProxyTable::iterator iter = object_proxy_table_.begin(); 291 for (ObjectProxyTable::iterator iter = object_proxy_table_.begin();
292 iter != object_proxy_table_.end(); ++iter) { 292 iter != object_proxy_table_.end(); ++iter) {
293 iter->second->Detach(); 293 iter->second->Detach();
294 } 294 }
295 295
296 // Release object proxies and exported objects here. We should do this
297 // here rather than in the destructor to avoid memory leaks due to
298 // cyclic references.
299 object_proxy_table_.clear();
300 exported_object_table_.clear();
301
296 // Private connection should be closed. 302 // Private connection should be closed.
297 if (connection_) { 303 if (connection_) {
298 if (connection_type_ == PRIVATE) 304 if (connection_type_ == PRIVATE)
299 dbus_connection_close(connection_); 305 dbus_connection_close(connection_);
300 // dbus_connection_close() won't unref. 306 // dbus_connection_close() won't unref.
301 dbus_connection_unref(connection_); 307 dbus_connection_unref(connection_);
302 } 308 }
303 309
304 connection_ = NULL; 310 connection_ = NULL;
305 shutdown_completed_ = true; 311 shutdown_completed_ = true;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 } 745 }
740 746
741 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection, 747 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection,
742 DBusDispatchStatus status, 748 DBusDispatchStatus status,
743 void* data) { 749 void* data) {
744 Bus* self = static_cast<Bus*>(data); 750 Bus* self = static_cast<Bus*>(data);
745 return self->OnDispatchStatusChanged(connection, status); 751 return self->OnDispatchStatusChanged(connection, status);
746 } 752 }
747 753
748 } // namespace dbus 754 } // namespace dbus
OLDNEW
« no previous file with comments | « no previous file | dbus/bus_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698