diff options
author | reillyg <reillyg@chromium.org> | 2016-02-09 17:53:06 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 01:54:06 +0000 |
commit | ef3511f30c78a2e286c7dc427b2af18ec54cb0c9 (patch) | |
tree | 94a65626c095623eace0cc194b30b3304bdf0764 /chromeos/dbus/permission_broker_client.h | |
parent | 3c445925095b8b5620c590a199f512ca3b652613 (diff) | |
download | chromium_src-ef3511f30c78a2e286c7dc427b2af18ec54cb0c9.zip chromium_src-ef3511f30c78a2e286c7dc427b2af18ec54cb0c9.tar.gz chromium_src-ef3511f30c78a2e286c7dc427b2af18ec54cb0c9.tar.bz2 |
Add path open errors from the permission broker to the device log.
This change adds an additional ErrorCallback parameter to the permission
broker client so that the caller can get a better log message when its
request to open a device node fails.
This will hopefully help to determine the cause of the many "Did not get
valid device handle from permission broker" errors that some users are
seeing.
BUG=570784
Review URL: https://codereview.chromium.org/1681383002
Cr-Commit-Position: refs/heads/master@{#374571}
Diffstat (limited to 'chromeos/dbus/permission_broker_client.h')
-rw-r--r-- | chromeos/dbus/permission_broker_client.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/chromeos/dbus/permission_broker_client.h b/chromeos/dbus/permission_broker_client.h index 276bfba..f56bfcc 100644 --- a/chromeos/dbus/permission_broker_client.h +++ b/chromeos/dbus/permission_broker_client.h @@ -34,6 +34,12 @@ class CHROMEOS_EXPORT PermissionBrokerClient : public DBusClient { // An OpenPathCallback callback is run when an OpenPath request is completed. typedef base::Callback<void(dbus::FileDescriptor)> OpenPathCallback; + // An ErrorCallback callback is run when an error is returned by the + // permission broker. + typedef base::Callback<void(const std::string& error_name, + const std::string& message)> + ErrorCallback; + ~PermissionBrokerClient() override; static PermissionBrokerClient* Create(); @@ -46,9 +52,11 @@ class CHROMEOS_EXPORT PermissionBrokerClient : public DBusClient { const ResultCallback& callback) = 0; // OpenPath requests that the permission broker open the device node - // identified by |path| and return the resulting file descriptor. + // identified by |path| and return the resulting file descriptor. One of + // |callback| or |error_callback| is called. virtual void OpenPath(const std::string& path, - const OpenPathCallback& callback) = 0; + const OpenPathCallback& callback, + const ErrorCallback& error_callback) = 0; // Requests the |port| be opened on the firewall for incoming TCP/IP // connections received on |interface| (an empty string indicates all |