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

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

Issue 2855233002: Use constexpr TaskTraits constructor in device. (Closed)
Patch Set: Created 3 years, 7 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 | « no previous file | device/usb/usb_service.cc » ('j') | device/usb/usb_service_impl.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "device/bluetooth/dbus/fake_bluetooth_device_client.h" 5 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h"
6 6
7 #include <fcntl.h> 7 #include <fcntl.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <sys/socket.h> 9 #include <sys/socket.h>
10 #include <sys/types.h> 10 #include <sys/types.h>
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 return; 512 return;
513 } 513 }
514 514
515 args |= O_NONBLOCK; 515 args |= O_NONBLOCK;
516 if (fcntl(fds[1], F_SETFL, args) < 0) { 516 if (fcntl(fds[1], F_SETFL, args) < 0) {
517 error_callback.Run(kNoResponseError, "failed to set socket non-blocking"); 517 error_callback.Run(kNoResponseError, "failed to set socket non-blocking");
518 return; 518 return;
519 } 519 }
520 520
521 base::PostTaskWithTraits( 521 base::PostTaskWithTraits(
522 FROM_HERE, base::TaskTraits() 522 FROM_HERE,
523 .WithShutdownBehavior( 523 {base::MayBlock(), base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN},
524 base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN)
525 .MayBlock(),
526 base::Bind(&SimulatedProfileSocket, fds[0])); 524 base::Bind(&SimulatedProfileSocket, fds[0]));
527 525
528 base::ScopedFD fd(fds[1]); 526 base::ScopedFD fd(fds[1]);
529 527
530 // Post the new connection to the service provider. 528 // Post the new connection to the service provider.
531 BluetoothProfileServiceProvider::Delegate::Options options; 529 BluetoothProfileServiceProvider::Delegate::Options options;
532 530
533 profile_service_provider->NewConnection( 531 profile_service_provider->NewConnection(
534 object_path, std::move(fd), options, 532 object_path, std::move(fd), options,
535 base::Bind(&FakeBluetoothDeviceClient::ConnectionCallback, 533 base::Bind(&FakeBluetoothDeviceClient::ConnectionCallback,
(...skipping 1311 matching lines...) Expand 10 before | Expand all | Expand 10 after
1847 properties->service_data.set_valid(true); 1845 properties->service_data.set_valid(true);
1848 } 1846 }
1849 1847
1850 properties_map_.insert(std::make_pair(device_path, std::move(properties))); 1848 properties_map_.insert(std::make_pair(device_path, std::move(properties)));
1851 device_list_.push_back(device_path); 1849 device_list_.push_back(device_path);
1852 for (auto& observer : observers_) 1850 for (auto& observer : observers_)
1853 observer.DeviceAdded(device_path); 1851 observer.DeviceAdded(device_path);
1854 } 1852 }
1855 1853
1856 } // namespace bluez 1854 } // namespace bluez
OLDNEW
« no previous file with comments | « no previous file | device/usb/usb_service.cc » ('j') | device/usb/usb_service_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698