Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Side by Side Diff: device/bluetooth/dbus/fake_bluetooth_media_transport_client.cc

Issue 2317593002: dbus: No dbus::FileDescriptor in BluetoothMediaTransportClient (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « device/bluetooth/dbus/bluetooth_media_transport_client.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/bluetooth_media_transport_client.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698