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

Side by Side Diff: device/bluetooth/bluez/bluetooth_socket_bluez.cc

Issue 2031743005: Remove use of deprecated MessageLoop methods in device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/bluetooth_remote_gatt_descriptor_android.cc ('k') | device/hid/hid_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "device/bluetooth/bluez/bluetooth_socket_bluez.h" 5 #include "device/bluetooth/bluez/bluetooth_socket_bluez.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <queue> 10 #include <queue>
11 #include <string> 11 #include <string>
12 #include <utility> 12 #include <utility>
13 13
14 #include "base/bind.h" 14 #include "base/bind.h"
15 #include "base/callback.h" 15 #include "base/callback.h"
16 #include "base/location.h"
16 #include "base/logging.h" 17 #include "base/logging.h"
17 #include "base/memory/linked_ptr.h" 18 #include "base/memory/linked_ptr.h"
18 #include "base/memory/ref_counted.h" 19 #include "base/memory/ref_counted.h"
19 #include "base/message_loop/message_loop.h"
20 #include "base/sequenced_task_runner.h" 20 #include "base/sequenced_task_runner.h"
21 #include "base/single_thread_task_runner.h"
21 #include "base/strings/string_util.h" 22 #include "base/strings/string_util.h"
22 #include "base/task_runner_util.h" 23 #include "base/task_runner_util.h"
23 #include "base/threading/thread_restrictions.h" 24 #include "base/threading/thread_restrictions.h"
25 #include "base/threading/thread_task_runner_handle.h"
24 #include "base/threading/worker_pool.h" 26 #include "base/threading/worker_pool.h"
25 #include "dbus/bus.h" 27 #include "dbus/bus.h"
26 #include "dbus/file_descriptor.h" 28 #include "dbus/file_descriptor.h"
27 #include "dbus/object_path.h" 29 #include "dbus/object_path.h"
28 #include "device/bluetooth/bluetooth_adapter.h" 30 #include "device/bluetooth/bluetooth_adapter.h"
29 #include "device/bluetooth/bluetooth_device.h" 31 #include "device/bluetooth/bluetooth_device.h"
30 #include "device/bluetooth/bluetooth_socket.h" 32 #include "device/bluetooth/bluetooth_socket.h"
31 #include "device/bluetooth/bluetooth_socket_net.h" 33 #include "device/bluetooth/bluetooth_socket_net.h"
32 #include "device/bluetooth/bluetooth_socket_thread.h" 34 #include "device/bluetooth/bluetooth_socket_thread.h"
33 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h" 35 #include "device/bluetooth/bluez/bluetooth_adapter_bluez.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 DCHECK(ui_task_runner()->RunsTasksOnCurrentThread()); 225 DCHECK(ui_task_runner()->RunsTasksOnCurrentThread());
224 DCHECK(!profile_); 226 DCHECK(!profile_);
225 DCHECK(adapter); 227 DCHECK(adapter);
226 228
227 // If the adapter is not present, this is a listening socket and the 229 // If the adapter is not present, this is a listening socket and the
228 // adapter isn't running yet. Report success and carry on; 230 // adapter isn't running yet. Report success and carry on;
229 // the profile will be registered when the daemon becomes available. 231 // the profile will be registered when the daemon becomes available.
230 if (!adapter->IsPresent()) { 232 if (!adapter->IsPresent()) {
231 VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value() 233 VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
232 << ": Delaying profile registration."; 234 << ": Delaying profile registration.";
233 base::MessageLoop::current()->PostTask(FROM_HERE, success_callback); 235 base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, success_callback);
234 return; 236 return;
235 } 237 }
236 238
237 VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value() 239 VLOG(1) << uuid_.canonical_value() << " on " << device_path_.value()
238 << ": Acquiring profile."; 240 << ": Acquiring profile.";
239 241
240 adapter->UseProfile(uuid_, device_path_, *options_, this, 242 adapter->UseProfile(uuid_, device_path_, *options_, this,
241 base::Bind(&BluetoothSocketBlueZ::OnRegisterProfile, this, 243 base::Bind(&BluetoothSocketBlueZ::OnRegisterProfile, this,
242 success_callback, error_callback), 244 success_callback, error_callback),
243 base::Bind(&BluetoothSocketBlueZ::OnRegisterProfileError, 245 base::Bind(&BluetoothSocketBlueZ::OnRegisterProfileError,
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 DCHECK(profile_); 535 DCHECK(profile_);
534 536
535 VLOG(1) << profile_->object_path().value() << ": Release profile"; 537 VLOG(1) << profile_->object_path().value() << ": Release profile";
536 538
537 static_cast<BluetoothAdapterBlueZ*>(adapter_.get()) 539 static_cast<BluetoothAdapterBlueZ*>(adapter_.get())
538 ->ReleaseProfile(device_path_, profile_); 540 ->ReleaseProfile(device_path_, profile_);
539 profile_ = nullptr; 541 profile_ = nullptr;
540 } 542 }
541 543
542 } // namespace bluez 544 } // namespace bluez
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_remote_gatt_descriptor_android.cc ('k') | device/hid/hid_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698