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

Unified Diff: chromeos/dbus/blocking_method_caller.cc

Issue 2801993002: Abandon user sign in when policy is retrieved before session started (Closed)
Patch Set: Fixed review comments Created 3 years, 8 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 | « chromeos/dbus/blocking_method_caller.h ('k') | chromeos/dbus/blocking_method_caller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/dbus/blocking_method_caller.cc
diff --git a/chromeos/dbus/blocking_method_caller.cc b/chromeos/dbus/blocking_method_caller.cc
index 8677bea9cd854306758ef497c052738ad304e228..a60cb6e9b02ef274f02b28ba98c2724bd4372f3a 100644
--- a/chromeos/dbus/blocking_method_caller.cc
+++ b/chromeos/dbus/blocking_method_caller.cc
@@ -11,6 +11,7 @@
#include "base/threading/thread_restrictions.h"
#include "dbus/bus.h"
#include "dbus/object_proxy.h"
+#include "dbus/scoped_dbus_error.h"
namespace chromeos {
@@ -20,9 +21,10 @@ namespace {
void CallMethodAndBlockInternal(std::unique_ptr<dbus::Response>* response,
base::ScopedClosureRunner* signaler,
dbus::ObjectProxy* proxy,
- dbus::MethodCall* method_call) {
- *response = proxy->CallMethodAndBlock(
- method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT);
+ dbus::MethodCall* method_call,
+ dbus::ScopedDBusError* error_out) {
+ *response = proxy->CallMethodAndBlockWithErrorDetails(
+ method_call, dbus::ObjectProxy::TIMEOUT_USE_DEFAULT, error_out);
}
} // namespace
@@ -40,6 +42,14 @@ BlockingMethodCaller::~BlockingMethodCaller() {
std::unique_ptr<dbus::Response> BlockingMethodCaller::CallMethodAndBlock(
dbus::MethodCall* method_call) {
+ dbus::ScopedDBusError error;
+ return CallMethodAndBlockWithError(method_call, &error);
+}
+
+std::unique_ptr<dbus::Response>
+BlockingMethodCaller::CallMethodAndBlockWithError(
+ dbus::MethodCall* method_call,
+ dbus::ScopedDBusError* error_out) {
// on_blocking_method_call_->Signal() will be called when |signaler| is
// destroyed.
base::Closure signal_task(
@@ -51,11 +61,8 @@ std::unique_ptr<dbus::Response> BlockingMethodCaller::CallMethodAndBlock(
std::unique_ptr<dbus::Response> response;
bus_->GetDBusTaskRunner()->PostTask(
FROM_HERE,
- base::Bind(&CallMethodAndBlockInternal,
- &response,
- base::Owned(signaler),
- base::Unretained(proxy_),
- method_call));
+ base::Bind(&CallMethodAndBlockInternal, &response, base::Owned(signaler),
+ base::Unretained(proxy_), method_call, error_out));
// http://crbug.com/125360
base::ThreadRestrictions::ScopedAllowWait allow_wait;
on_blocking_method_call_.Wait();
« no previous file with comments | « chromeos/dbus/blocking_method_caller.h ('k') | chromeos/dbus/blocking_method_caller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698