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

Unified Diff: dbus/bus.cc

Issue 7745044: Minor cleanups and improvements for the D-Bus library. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dbus/bus.h ('k') | dbus/dbus.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.cc
diff --git a/dbus/bus.cc b/dbus/bus.cc
index a259bc0eb164a9aa129d23b2aa7a8fbafd5530e7..550f390d77ff08d1f90b942606e0fd4fa87a2222 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -182,7 +182,7 @@ Bus::Bus(const Options& options)
origin_loop_(MessageLoop::current()),
origin_thread_id_(base::PlatformThread::CurrentId()),
dbus_thread_id_(base::kInvalidThreadId),
- async_operations_are_set_up_(false),
+ async_operations_set_up_(false),
num_pending_watches_(0),
num_pending_timeouts_(0) {
if (dbus_thread_) {
@@ -370,7 +370,7 @@ bool Bus::SetUpAsyncOperations() {
DCHECK(connection_);
AssertOnDBusThread();
- if (async_operations_are_set_up_)
+ if (async_operations_set_up_)
return true;
// Process all the incoming data if any, so that OnDispatchStatus() will
@@ -400,7 +400,7 @@ bool Bus::SetUpAsyncOperations() {
this,
NULL);
- async_operations_are_set_up_ = true;
+ async_operations_set_up_ = true;
return true;
}
@@ -500,9 +500,11 @@ bool Bus::TryRegisterObjectPath(const std::string& object_path,
DCHECK(connection_);
AssertOnDBusThread();
- DCHECK(registered_object_paths_.find(object_path) ==
- registered_object_paths_.end())
- << "Object path already registered: " << object_path;
+ if (registered_object_paths_.find(object_path) !=
+ registered_object_paths_.end()) {
+ LOG(ERROR) << "Object path already registered: " << object_path;
+ return false;
+ }
const bool success = dbus_connection_try_register_object_path(
connection_,
@@ -519,9 +521,12 @@ void Bus::UnregisterObjectPath(const std::string& object_path) {
DCHECK(connection_);
AssertOnDBusThread();
- DCHECK(registered_object_paths_.find(object_path) !=
- registered_object_paths_.end())
- << "Requested to unregister an unknown object path: " << object_path;
+ if (registered_object_paths_.find(object_path) ==
+ registered_object_paths_.end()) {
+ LOG(ERROR) << "Requested to unregister an unknown object path: "
+ << object_path;
+ return;
+ }
const bool success = dbus_connection_unregister_object_path(
connection_,
« no previous file with comments | « dbus/bus.h ('k') | dbus/dbus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698