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

Side by Side Diff: device/bluetooth/dbus/dbus_thread_manager_linux.h

Issue 1367663002: Add Linux support for the Bluetooth API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor_dbus
Patch Set: rebase Created 5 years, 2 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_DBUS_LINUX_DBUS_MANAGER_H_
6 #define DEVICE_BLUETOOTH_DBUS_LINUX_DBUS_MANAGER_H_
7
8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "device/bluetooth/bluetooth_export.h"
12
13 namespace base {
14 class Thread;
15 } // namespace base
16
17 namespace dbus {
18 class Bus;
19 } // namespace dbus
20
21 namespace bluez {
22
23 // LinuxDBusManager manages the D-Bus thread, the thread dedicated to
24 // handling asynchronous D-Bus operations.
25 class DEVICE_BLUETOOTH_EXPORT DBusThreadManagerLinux {
26 public:
27 // Sets the global instance. Must be called before any calls to Get().
28 // We explicitly initialize and shut down the global object, rather than
29 // making it a Singleton, to ensure clean startup and shutdown.
30 static void Initialize();
31
32 // Destroys the global instance.
33 static void Shutdown();
34
35 // Gets the global instance. Initialize() must be called first.
36 static DBusThreadManagerLinux* Get();
37
38 // Returns various D-Bus bus instances, owned by LinuxDBusManager.
39 dbus::Bus* GetSystemBus();
40
41 private:
42 explicit DBusThreadManagerLinux();
43 ~DBusThreadManagerLinux();
44
45 // Creates a global instance of LinuxDBusManager with the real
46 // implementations for all clients that are listed in |unstub_client_mask| and
47 // stub implementations for all clients that are not included. Cannot be
48 // called more than once.
49 static void CreateGlobalInstance();
50
51 scoped_ptr<base::Thread> dbus_thread_;
52 scoped_refptr<dbus::Bus> system_bus_;
53
54 DISALLOW_COPY_AND_ASSIGN(DBusThreadManagerLinux);
55 };
56
57 } // namespace bluez
58
59 #endif // DEVICE_BLUETOOTH_DBUS_LINUX_DBUS_MANAGER_H_
OLDNEW
« no previous file with comments | « device/bluetooth/dbus/bluez_dbus_manager.h ('k') | device/bluetooth/dbus/dbus_thread_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698