| OLD | NEW |
| 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 "chromeos/dbus/permission_broker_client.h" | 5 #include "chromeos/dbus/permission_broker_client.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/bind.h" | 10 #include "base/bind.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 12 #include "dbus/bus.h" | 13 #include "dbus/bus.h" |
| 13 #include "dbus/message.h" | 14 #include "dbus/message.h" |
| 14 #include "dbus/object_proxy.h" | 15 #include "dbus/object_proxy.h" |
| 15 #include "third_party/cros_system_api/dbus/service_constants.h" | 16 #include "third_party/cros_system_api/dbus/service_constants.h" |
| 16 | 17 |
| 17 using permission_broker::kCheckPathAccess; | 18 using permission_broker::kCheckPathAccess; |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 dbus::Response* response) { | 149 dbus::Response* response) { |
| 149 dbus::FileDescriptor fd; | 150 dbus::FileDescriptor fd; |
| 150 if (response) { | 151 if (response) { |
| 151 dbus::MessageReader reader(response); | 152 dbus::MessageReader reader(response); |
| 152 if (!reader.PopFileDescriptor(&fd)) | 153 if (!reader.PopFileDescriptor(&fd)) |
| 153 LOG(WARNING) << "Could not parse response: " << response->ToString(); | 154 LOG(WARNING) << "Could not parse response: " << response->ToString(); |
| 154 } else { | 155 } else { |
| 155 LOG(WARNING) << "Access request method call failed."; | 156 LOG(WARNING) << "Access request method call failed."; |
| 156 } | 157 } |
| 157 | 158 |
| 158 callback.Run(fd.Pass()); | 159 callback.Run(std::move(fd)); |
| 159 } | 160 } |
| 160 | 161 |
| 161 dbus::ObjectProxy* proxy_; | 162 dbus::ObjectProxy* proxy_; |
| 162 | 163 |
| 163 // Note: This should remain the last member so that it will be destroyed | 164 // Note: This should remain the last member so that it will be destroyed |
| 164 // first, invalidating its weak pointers, before the other members are | 165 // first, invalidating its weak pointers, before the other members are |
| 165 // destroyed. | 166 // destroyed. |
| 166 base::WeakPtrFactory<PermissionBrokerClientImpl> weak_ptr_factory_; | 167 base::WeakPtrFactory<PermissionBrokerClientImpl> weak_ptr_factory_; |
| 167 | 168 |
| 168 DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClientImpl); | 169 DISALLOW_COPY_AND_ASSIGN(PermissionBrokerClientImpl); |
| 169 }; | 170 }; |
| 170 | 171 |
| 171 PermissionBrokerClient::PermissionBrokerClient() {} | 172 PermissionBrokerClient::PermissionBrokerClient() {} |
| 172 | 173 |
| 173 PermissionBrokerClient::~PermissionBrokerClient() {} | 174 PermissionBrokerClient::~PermissionBrokerClient() {} |
| 174 | 175 |
| 175 PermissionBrokerClient* PermissionBrokerClient::Create() { | 176 PermissionBrokerClient* PermissionBrokerClient::Create() { |
| 176 return new PermissionBrokerClientImpl(); | 177 return new PermissionBrokerClientImpl(); |
| 177 } | 178 } |
| 178 | 179 |
| 179 } // namespace chromeos | 180 } // namespace chromeos |
| OLD | NEW |