DescriptionChanged DefaultAdapter to RunCallbackOnAdapterReady function.
Instead of returning BluetoothAdapter instance directly, RunCallbackOnAdapterReady will run the callback with the instance of BluetoothAdapter. The idea is that we want to make sure that the BluetoothAdapter is used when it is fully initialized.
Right now the function is still synchronous; the callback will be run immediately after BluetoothAdapter is created within BluetoothAdapterFactory::RunCallbackOnAdapterReady(), so nothing should be broken in BluetoothOptionsHandler and AshSystemTrayDelegate. But later I will eventually change BluetoothAdapterFactory::RunCallbackOnAdapterReady() asynchronous, so we should discuss how we change BluetoothOptionsHandler and AshTryDelegate. Jenny, could you make changes on BluetoothOptionsHandler and AshSystemTrayDelegate to accomodate asynchronous RunCallbackOnAdapterReady() calls? We can also discuss how to make those changes together.
Also is BluetoothAdapterFactory::Create() ever used? Maybe this function will be needed in the future, but currently I don't see this function being called; can we just remove this if it is not used currently and add it back when we actually use it?
I will update unittests soon, but I wanted to send this out so that I can get initial preliminary review first.
BUG=135470
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=176523
Patch Set 1 #
Total comments: 19
Patch Set 2 : RunCallbackOnAdapterReady runs callback regardless of Bluetooth Adapter availability. #
Total comments: 4
Patch Set 3 : Used weak pointer instead of base::Unretained(this) #Patch Set 4 : Fixed device_unittests. #
Total comments: 8
Patch Set 5 : Fixed browser_tests. #Patch Set 6 : Created IsBluetoothSupported in BluetoothEventRouter to fix browser_tests. #Messages
Total messages: 19 (0 generated)
|