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

Side by Side Diff: device/bluetooth/bluetooth_adapter.h

Issue 848613003: bluetooth: Shutdown BluetoothAdapter before DBus on ChromeOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: --set-upstream-to=origin/master Created 5 years, 11 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 // asynchronous initialization is complete. 185 // asynchronous initialization is complete.
186 // Caution: The returned pointer also transfers ownership of the adapter. The 186 // Caution: The returned pointer also transfers ownership of the adapter. The
187 // caller is expected to call |AddRef()| on the returned pointer, typically by 187 // caller is expected to call |AddRef()| on the returned pointer, typically by
188 // storing it into a |scoped_refptr|. 188 // storing it into a |scoped_refptr|.
189 static base::WeakPtr<BluetoothAdapter> CreateAdapter( 189 static base::WeakPtr<BluetoothAdapter> CreateAdapter(
190 const InitCallback& init_callback); 190 const InitCallback& init_callback);
191 191
192 // Returns a weak pointer to an existing adapter for testing purposes only. 192 // Returns a weak pointer to an existing adapter for testing purposes only.
193 base::WeakPtr<BluetoothAdapter> GetWeakPtrForTesting(); 193 base::WeakPtr<BluetoothAdapter> GetWeakPtrForTesting();
194 194
195 #if defined(OS_CHROMEOS)
196 // Shutdown the adapter: tear down and clean up all objects owned by
197 // BluetoothAdapter. After this call, the BluetoothAdapter will behave as if
198 // no Bluetooth controller exists in the local system. |IsPresent| will return
199 // false.
200 void Shutdown();
201 #endif
202
195 // Adds and removes observers for events on this bluetooth adapter. If 203 // Adds and removes observers for events on this bluetooth adapter. If
196 // monitoring multiple adapters, check the |adapter| parameter of observer 204 // monitoring multiple adapters, check the |adapter| parameter of observer
197 // methods to determine which adapter is issuing the event. 205 // methods to determine which adapter is issuing the event.
198 virtual void AddObserver(BluetoothAdapter::Observer* observer) = 0; 206 virtual void AddObserver(BluetoothAdapter::Observer* observer) = 0;
199 virtual void RemoveObserver( 207 virtual void RemoveObserver(
200 BluetoothAdapter::Observer* observer) = 0; 208 BluetoothAdapter::Observer* observer) = 0;
201 209
202 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX", 210 // The address of this adapter. The address format is "XX:XX:XX:XX:XX:XX",
203 // where each XX is a hexadecimal number. 211 // where each XX is a hexadecimal number.
204 virtual std::string GetAddress() const = 0; 212 virtual std::string GetAddress() const = 0;
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 // Trait for RefCountedThreadSafe that deletes BluetoothAdapter. 451 // Trait for RefCountedThreadSafe that deletes BluetoothAdapter.
444 struct BluetoothAdapterDeleter { 452 struct BluetoothAdapterDeleter {
445 static void Destruct(const BluetoothAdapter* adapter) { 453 static void Destruct(const BluetoothAdapter* adapter) {
446 adapter->DeleteOnCorrectThread(); 454 adapter->DeleteOnCorrectThread();
447 } 455 }
448 }; 456 };
449 457
450 } // namespace device 458 } // namespace device
451 459
452 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_ 460 #endif // DEVICE_BLUETOOTH_BLUETOOTH_ADAPTER_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_browser_main_chromeos.cc ('k') | device/bluetooth/bluetooth_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698