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

Side by Side Diff: dbus/exported_object.cc

Issue 16012018: Cleanup: Put DBus unit tests in the dbus namespace, so one does not need to write dbus:: everywhere… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 6 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 | « dbus/end_to_end_sync_unittest.cc ('k') | dbus/message.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 "dbus/exported_object.h" 5 #include "dbus/exported_object.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/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 response ? 1 : 0, 273 response ? 1 : 0,
274 kSuccessRatioHistogramMaxValue); 274 kSuccessRatioHistogramMaxValue);
275 275
276 // Check if the bus is still connected. If the method takes long to 276 // Check if the bus is still connected. If the method takes long to
277 // complete, the bus may be shut down meanwhile. 277 // complete, the bus may be shut down meanwhile.
278 if (!bus_->is_connected()) 278 if (!bus_->is_connected())
279 return; 279 return;
280 280
281 if (!response) { 281 if (!response) {
282 // Something bad happened in the method call. 282 // Something bad happened in the method call.
283 scoped_ptr<dbus::ErrorResponse> error_response( 283 scoped_ptr<ErrorResponse> error_response(
284 ErrorResponse::FromMethodCall( 284 ErrorResponse::FromMethodCall(
285 method_call.get(), 285 method_call.get(),
286 DBUS_ERROR_FAILED, 286 DBUS_ERROR_FAILED,
287 "error occurred in " + method_call->GetMember())); 287 "error occurred in " + method_call->GetMember()));
288 bus_->Send(error_response->raw_message(), NULL); 288 bus_->Send(error_response->raw_message(), NULL);
289 return; 289 return;
290 } 290 }
291 291
292 // The method call was successful. 292 // The method call was successful.
293 bus_->Send(response->raw_message(), NULL); 293 bus_->Send(response->raw_message(), NULL);
(...skipping 14 matching lines...) Expand all
308 return self->HandleMessage(connection, raw_message); 308 return self->HandleMessage(connection, raw_message);
309 } 309 }
310 310
311 void ExportedObject::OnUnregisteredThunk(DBusConnection *connection, 311 void ExportedObject::OnUnregisteredThunk(DBusConnection *connection,
312 void* user_data) { 312 void* user_data) {
313 ExportedObject* self = reinterpret_cast<ExportedObject*>(user_data); 313 ExportedObject* self = reinterpret_cast<ExportedObject*>(user_data);
314 return self->OnUnregistered(connection); 314 return self->OnUnregistered(connection);
315 } 315 }
316 316
317 } // namespace dbus 317 } // namespace dbus
OLDNEW
« no previous file with comments | « dbus/end_to_end_sync_unittest.cc ('k') | dbus/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698