| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/fake_permission_broker_client.h" | 5 #include "chromeos/dbus/fake_permission_broker_client.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "dbus/file_descriptor.h" |
| 8 | 9 |
| 9 namespace chromeos { | 10 namespace chromeos { |
| 10 | 11 |
| 11 FakePermissionBrokerClient::FakePermissionBrokerClient() {} | 12 FakePermissionBrokerClient::FakePermissionBrokerClient() {} |
| 12 | 13 |
| 13 FakePermissionBrokerClient::~FakePermissionBrokerClient() {} | 14 FakePermissionBrokerClient::~FakePermissionBrokerClient() {} |
| 14 | 15 |
| 15 void FakePermissionBrokerClient::Init(dbus::Bus* bus) {} | 16 void FakePermissionBrokerClient::Init(dbus::Bus* bus) {} |
| 16 | 17 |
| 17 void FakePermissionBrokerClient::RequestPathAccess( | 18 void FakePermissionBrokerClient::RequestPathAccess( |
| 18 const std::string& path, | 19 const std::string& path, |
| 19 int interface_id, | 20 int interface_id, |
| 20 const ResultCallback& callback) { | 21 const ResultCallback& callback) { |
| 21 callback.Run(false); | 22 callback.Run(false); |
| 22 } | 23 } |
| 23 | 24 |
| 24 void FakePermissionBrokerClient::RequestTcpPortAccess( | 25 void FakePermissionBrokerClient::RequestTcpPortAccess( |
| 25 uint16 port, | 26 uint16 port, |
| 26 const std::string& interface, | 27 const std::string& interface, |
| 27 const dbus::FileDescriptor& lifeline_fd, | 28 const dbus::FileDescriptor& lifeline_fd, |
| 28 const ResultCallback& callback) { | 29 const ResultCallback& callback) { |
| 29 callback.Run(false); | 30 DCHECK(lifeline_fd.is_valid()); |
| 31 callback.Run(true); |
| 30 } | 32 } |
| 31 | 33 |
| 32 void FakePermissionBrokerClient::RequestUdpPortAccess( | 34 void FakePermissionBrokerClient::RequestUdpPortAccess( |
| 33 uint16 port, | 35 uint16 port, |
| 34 const std::string& interface, | 36 const std::string& interface, |
| 35 const dbus::FileDescriptor& lifeline_fd, | 37 const dbus::FileDescriptor& lifeline_fd, |
| 36 const ResultCallback& callback) { | 38 const ResultCallback& callback) { |
| 37 callback.Run(false); | 39 DCHECK(lifeline_fd.is_valid()); |
| 40 callback.Run(true); |
| 38 } | 41 } |
| 39 | 42 |
| 40 void FakePermissionBrokerClient::ReleaseTcpPort( | 43 void FakePermissionBrokerClient::ReleaseTcpPort( |
| 41 uint16 port, | 44 uint16 port, |
| 42 const std::string& interface, | 45 const std::string& interface, |
| 43 const ResultCallback& callback) { | 46 const ResultCallback& callback) { |
| 44 callback.Run(false); | 47 callback.Run(true); |
| 45 } | 48 } |
| 46 | 49 |
| 47 void FakePermissionBrokerClient::ReleaseUdpPort( | 50 void FakePermissionBrokerClient::ReleaseUdpPort( |
| 48 uint16 port, | 51 uint16 port, |
| 49 const std::string& interface, | 52 const std::string& interface, |
| 50 const ResultCallback& callback) { | 53 const ResultCallback& callback) { |
| 51 callback.Run(false); | 54 callback.Run(true); |
| 52 } | 55 } |
| 53 | 56 |
| 54 } // namespace chromeos | 57 } // namespace chromeos |
| OLD | NEW |