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 <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <stdint.h> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/location.h" | 12 #include "base/location.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/posix/eintr_wrapper.h" | 14 #include "base/posix/eintr_wrapper.h" |
14 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
15 #include "base/threading/worker_pool.h" | 16 #include "base/threading/worker_pool.h" |
16 #include "dbus/file_descriptor.h" | 17 #include "dbus/file_descriptor.h" |
17 | 18 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 void FakePermissionBrokerClient::OpenPath(const std::string& path, | 64 void FakePermissionBrokerClient::OpenPath(const std::string& path, |
64 const OpenPathCallback& callback) { | 65 const OpenPathCallback& callback) { |
65 base::WorkerPool::PostTask(FROM_HERE, | 66 base::WorkerPool::PostTask(FROM_HERE, |
66 base::Bind(&OpenPathAndValidate, path, callback, | 67 base::Bind(&OpenPathAndValidate, path, callback, |
67 base::ThreadTaskRunnerHandle::Get()), | 68 base::ThreadTaskRunnerHandle::Get()), |
68 false); | 69 false); |
69 } | 70 } |
70 | 71 |
71 void FakePermissionBrokerClient::RequestTcpPortAccess( | 72 void FakePermissionBrokerClient::RequestTcpPortAccess( |
72 uint16 port, | 73 uint16_t port, |
73 const std::string& interface, | 74 const std::string& interface, |
74 const dbus::FileDescriptor& lifeline_fd, | 75 const dbus::FileDescriptor& lifeline_fd, |
75 const ResultCallback& callback) { | 76 const ResultCallback& callback) { |
76 DCHECK(lifeline_fd.is_valid()); | 77 DCHECK(lifeline_fd.is_valid()); |
77 callback.Run(true); | 78 callback.Run(true); |
78 } | 79 } |
79 | 80 |
80 void FakePermissionBrokerClient::RequestUdpPortAccess( | 81 void FakePermissionBrokerClient::RequestUdpPortAccess( |
81 uint16 port, | 82 uint16_t port, |
82 const std::string& interface, | 83 const std::string& interface, |
83 const dbus::FileDescriptor& lifeline_fd, | 84 const dbus::FileDescriptor& lifeline_fd, |
84 const ResultCallback& callback) { | 85 const ResultCallback& callback) { |
85 DCHECK(lifeline_fd.is_valid()); | 86 DCHECK(lifeline_fd.is_valid()); |
86 callback.Run(true); | 87 callback.Run(true); |
87 } | 88 } |
88 | 89 |
89 void FakePermissionBrokerClient::ReleaseTcpPort( | 90 void FakePermissionBrokerClient::ReleaseTcpPort( |
90 uint16 port, | 91 uint16_t port, |
91 const std::string& interface, | 92 const std::string& interface, |
92 const ResultCallback& callback) { | 93 const ResultCallback& callback) { |
93 callback.Run(true); | 94 callback.Run(true); |
94 } | 95 } |
95 | 96 |
96 void FakePermissionBrokerClient::ReleaseUdpPort( | 97 void FakePermissionBrokerClient::ReleaseUdpPort( |
97 uint16 port, | 98 uint16_t port, |
98 const std::string& interface, | 99 const std::string& interface, |
99 const ResultCallback& callback) { | 100 const ResultCallback& callback) { |
100 callback.Run(true); | 101 callback.Run(true); |
101 } | 102 } |
102 | 103 |
103 } // namespace chromeos | 104 } // namespace chromeos |
OLD | NEW |