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

Issue 11819007: Changed DefaultAdapter to RunCallbackOnAdapterReady function. (Closed)

Created:
7 years, 11 months ago by youngki
Modified:
7 years, 11 months ago
CC:
chromium-reviews, dbeam+watch-options_chromium.org, nkostylev+watch_chromium.org, Aaron Boodman, oshima+watch_chromium.org, chromium-apps-reviews_chromium.org, stevenjb+watch_chromium.org, davemoore+watch_chromium.org, jennyz, kevers, bryeung, deymo
Visibility:
Public.

Description

Changed 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. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+373 lines, -241 lines) Patch
M chrome/browser/chromeos/system/ash_system_tray_delegate.cc View 1 2 3 4 5 1 chunk +9 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_event_router.h View 1 2 3 4 5 4 chunks +11 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_event_router.cc View 1 2 3 4 5 3 chunks +24 lines, -8 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.h View 1 2 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/bluetooth/bluetooth_extension_function.cc View 1 2 3 4 5 2 chunks +24 lines, -8 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/webui/options/chromeos/bluetooth_options_handler.cc View 1 2 2 chunks +10 lines, -3 lines 0 comments Download
M chrome/common/extensions/permissions/bluetooth_device_permission.cc View 1 chunk +1 line, -1 line 0 comments Download
M device/bluetooth/bluetooth_adapter_chromeos_unittest.cc View 1 2 3 65 chunks +246 lines, -208 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_devices_chromeos_unittest.cc View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_factory.h View 1 2 3 4 5 2 chunks +16 lines, -6 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_factory.cc View 1 2 3 4 5 2 chunks +15 lines, -1 line 0 comments Download

Messages

Total messages: 19 (0 generated)
youngki
Hi Scott, I just changed DefaultAdapter to receive callback and also changed the function name. ...
7 years, 11 months ago (2013-01-08 21:26:17 UTC) #1
bryeung
drive by... https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode275 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:275: base::Unretained(this))); Remind me why using an Unretained ...
7 years, 11 months ago (2013-01-08 22:24:26 UTC) #2
youngki
https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode275 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:275: base::Unretained(this))); On 2013/01/08 22:24:27, bryeung wrote: > Remind me ...
7 years, 11 months ago (2013-01-09 15:12:03 UTC) #3
bryeung
lgtm https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode275 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:275: base::Unretained(this))); On 2013/01/09 15:12:03, youngki wrote: > On ...
7 years, 11 months ago (2013-01-09 15:28:01 UTC) #4
keybuk
lgtm
7 years, 11 months ago (2013-01-09 17:54:04 UTC) #5
youngki
Unittests are coming soon... https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://chromiumcodereview.appspot.com/11819007/diff/1/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode275 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:275: base::Unretained(this))); On 2013/01/09 15:28:01, bryeung ...
7 years, 11 months ago (2013-01-09 19:32:24 UTC) #6
youngki
Actually all the tests are passing and there is no change in terms of functionalities, ...
7 years, 11 months ago (2013-01-09 22:03:18 UTC) #7
Nikita (slow)
https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:281: CHECK(bluetooth_adapter_); You're passing adapter as a weak pointer so ...
7 years, 11 months ago (2013-01-10 10:29:54 UTC) #8
youngki
https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:281: CHECK(bluetooth_adapter_); On 2013/01/10 10:29:55, Nikita Kostylev wrote: > You're ...
7 years, 11 months ago (2013-01-10 18:58:54 UTC) #9
Nikita (slow)
https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:281: CHECK(bluetooth_adapter_); On 2013/01/10 18:58:54, youngki wrote: > On 2013/01/10 ...
7 years, 11 months ago (2013-01-11 11:15:09 UTC) #10
youngki
https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:281: CHECK(bluetooth_adapter_); On 2013/01/11 11:15:09, Nikita Kostylev wrote: > On ...
7 years, 11 months ago (2013-01-11 13:18:46 UTC) #11
miket_OOO
> Mike, could you review the extension changes for OWNERS approval? > chrome/browser/extensions/* > chrome/common/extensions/* ...
7 years, 11 months ago (2013-01-11 14:52:30 UTC) #12
Nikita (slow)
https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:281: CHECK(bluetooth_adapter_); On 2013/01/11 13:18:47, youngki wrote: > On 2013/01/11 ...
7 years, 11 months ago (2013-01-11 15:34:20 UTC) #13
youngki
https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 chrome/browser/chromeos/system/ash_system_tray_delegate.cc:281: CHECK(bluetooth_adapter_); On 2013/01/11 15:34:21, Nikita Kostylev wrote: > On ...
7 years, 11 months ago (2013-01-11 16:47:56 UTC) #14
Nikita (slow)
On 2013/01/11 16:47:56, youngki wrote: > https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc > File chrome/browser/chromeos/system/ash_system_tray_delegate.cc (right): > > https://codereview.chromium.org/11819007/diff/19001/chrome/browser/chromeos/system/ash_system_tray_delegate.cc#newcode281 > ...
7 years, 11 months ago (2013-01-11 17:53:35 UTC) #15
Nikita (slow)
lgtm
7 years, 11 months ago (2013-01-11 17:53:40 UTC) #16
youngki
Thanks for the reviews..! All the try jobs are passing, so I am putting this ...
7 years, 11 months ago (2013-01-11 20:23:26 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/youngki@chromium.org/11819007/28001
7 years, 11 months ago (2013-01-11 20:27:34 UTC) #18
commit-bot: I haz the power
7 years, 11 months ago (2013-01-12 09:14:10 UTC) #19
Message was sent while issue was closed.
Change committed as 176523

Powered by Google App Engine
This is Rietveld 408576698