OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/bluetooth/dbus/fake_bluetooth_media_transport_client.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_media_transport_client.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 | 316 |
317 int fds[2]; | 317 int fds[2]; |
318 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { | 318 if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) < 0) { |
319 transport->input_fd.reset(); | 319 transport->input_fd.reset(); |
320 error_callback.Run(kFailed, ""); | 320 error_callback.Run(kFailed, ""); |
321 return; | 321 return; |
322 } | 322 } |
323 DCHECK((fds[0] > kInvalidFd) && (fds[1] > kInvalidFd)); | 323 DCHECK((fds[0] > kInvalidFd) && (fds[1] > kInvalidFd)); |
324 transport->input_fd.reset(new base::File(fds[0])); | 324 transport->input_fd.reset(new base::File(fds[0])); |
325 | 325 |
326 dbus::FileDescriptor out_fd(fds[1]); | 326 base::ScopedFD out_fd(fds[1]); |
327 callback.Run(&out_fd, kDefaultReadMtu, kDefaultWriteMtu); | 327 callback.Run(std::move(out_fd), kDefaultReadMtu, kDefaultWriteMtu); |
328 SetState(endpoint_path, "active"); | 328 SetState(endpoint_path, "active"); |
329 } | 329 } |
330 | 330 |
331 } // namespace bluez | 331 } // namespace bluez |
OLD | NEW |