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

Issue 11411130: Implemented BluetoothTaskManagerWin class. (Closed)

Created:
8 years, 1 month ago by youngki
Modified:
7 years, 11 months ago
CC:
chromium-reviews, keybuk, grt (UTC plus 2), jam
Base URL:
http://git.chromium.org/chromium/src.git@master
Visibility:
Public.

Description

Implemented BluetoothTaskManagerWin class. BluetoothAdapterWin owns BluetoothTaskManagerWin and registers itself as an observer to BluetoothTaskManagerWin. The BluetoothTaskManagerWin polls the Bluetooth Windows API to get the up-to-date adapter status, and notifies BluetoothAdapterWin upon changes. BUG=135470 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=177024

Patch Set 1 #

Patch Set 2 : Added comment #

Patch Set 3 : Fixed merge error #

Patch Set 4 : Updated bluetooth_adapter_win_unittest.cc. #

Patch Set 5 : Removed unnecessary lines. #

Total comments: 10

Patch Set 6 : Use Observer pattern #

Total comments: 12

Patch Set 7 : Have all Windows API calls run on BluetoothPollingThread. #

Total comments: 2

Patch Set 8 : Renamed properties to adapter state #

Total comments: 11

Patch Set 9 : Made AdapterStateChange() private. #

Patch Set 10 : Turned thread_checker_ and cancellation_flag_ from pointer to value. #

Patch Set 11 : Changed ThreadChecker to base::ThreadChecker #

Patch Set 12 : Turned thread_checker_ to value in polling thread. #

Total comments: 22

Patch Set 13 : Put GetAdapterState into anonymous namespace #

Total comments: 5

Patch Set 14 : Added BluetoothTaskManagerWin class #

Total comments: 28

Patch Set 15 : Added BluetoothPollingThreadWin::StartPolling() #

Patch Set 16 : Replace naked MessageLoop pointer with SequencedTaskRunner refcounted pointer #

Total comments: 1

Patch Set 17 : Implemented Unittests #

Total comments: 2

Patch Set 18 : Replaced BluetoothPollingThreadWin with SequencedWorkerPool. #

Patch Set 19 : Reverted DEPS #

Total comments: 16

Patch Set 20 : Fixed some style issues. #

Total comments: 16

Patch Set 21 : Use ScopedHandle #

Patch Set 22 : Removed content dependency. #

Patch Set 23 : updated device.gyp #

Patch Set 24 : added back DEPS #

Patch Set 25 : added back content dependency due to Device Test Suite. #

Total comments: 2

Patch Set 26 : changed to const char[] #

Unified diffs Side-by-side diffs Delta from patch set Stats (+445 lines, -190 lines) Patch
M device/bluetooth/bluetooth_adapter_factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 4 chunks +10 lines, -0 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +14 lines, -9 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 3 chunks +17 lines, -99 lines 0 comments Download
M device/bluetooth/bluetooth_adapter_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 chunk +20 lines, -82 lines 0 comments Download
A device/bluetooth/bluetooth_task_manager_win.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +98 lines, -0 lines 0 comments Download
A device/bluetooth/bluetooth_task_manager_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +182 lines, -0 lines 0 comments Download
A device/bluetooth/bluetooth_task_manager_win_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +101 lines, -0 lines 0 comments Download
M device/device.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 23 24 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
youngki
8 years, 1 month ago (2012-11-22 00:30:24 UTC) #1
bryeung
https://chromiumcodereview.appspot.com/11411130/diff/2010/device/bluetooth/bluetooth_adapter_win.cc File device/bluetooth/bluetooth_adapter_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/2010/device/bluetooth/bluetooth_adapter_win.cc#newcode103 device/bluetooth/bluetooth_adapter_win.cc:103: if (ERROR_SUCCESS == BluetoothGetRadioInfo(adapter_handle_, I think we should move ...
8 years, 1 month ago (2012-11-22 18:13:25 UTC) #2
youngki
https://chromiumcodereview.appspot.com/11411130/diff/2010/device/bluetooth/bluetooth_adapter_win.cc File device/bluetooth/bluetooth_adapter_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/2010/device/bluetooth/bluetooth_adapter_win.cc#newcode103 device/bluetooth/bluetooth_adapter_win.cc:103: if (ERROR_SUCCESS == BluetoothGetRadioInfo(adapter_handle_, On 2012/11/22 18:13:25, bryeung wrote: ...
8 years, 1 month ago (2012-11-23 01:50:47 UTC) #3
youngki
I haven't updated the unittest yet; let me know if the change is good enough ...
8 years, 1 month ago (2012-11-23 01:53:04 UTC) #4
bryeung
https://chromiumcodereview.appspot.com/11411130/diff/9002/device/bluetooth/bluetooth_adapter_win.cc File device/bluetooth/bluetooth_adapter_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/9002/device/bluetooth/bluetooth_adapter_win.cc#newcode85 device/bluetooth/bluetooth_adapter_win.cc:85: const BluetoothPollingThreadWin::Properties& properties) { CHECK the thread here https://chromiumcodereview.appspot.com/11411130/diff/9002/device/bluetooth/bluetooth_polling_thread_win.cc ...
8 years, 1 month ago (2012-11-23 13:32:22 UTC) #5
youngki
https://chromiumcodereview.appspot.com/11411130/diff/9002/device/bluetooth/bluetooth_adapter_win.cc File device/bluetooth/bluetooth_adapter_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/9002/device/bluetooth/bluetooth_adapter_win.cc#newcode85 device/bluetooth/bluetooth_adapter_win.cc:85: const BluetoothPollingThreadWin::Properties& properties) { On 2012/11/23 13:32:22, bryeung wrote: ...
8 years, 1 month ago (2012-11-23 18:26:38 UTC) #6
keybuk
https://chromiumcodereview.appspot.com/11411130/diff/3014/device/bluetooth/bluetooth_polling_thread_win.h File device/bluetooth/bluetooth_polling_thread_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/3014/device/bluetooth/bluetooth_polling_thread_win.h#newcode27 device/bluetooth/bluetooth_polling_thread_win.h:27: }; Confused about this - it appears to "emulate" ...
8 years ago (2012-11-26 18:36:13 UTC) #7
youngki
https://chromiumcodereview.appspot.com/11411130/diff/3014/device/bluetooth/bluetooth_polling_thread_win.h File device/bluetooth/bluetooth_polling_thread_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/3014/device/bluetooth/bluetooth_polling_thread_win.h#newcode27 device/bluetooth/bluetooth_polling_thread_win.h:27: }; On 2012/11/26 18:36:13, keybuk wrote: > Confused about ...
8 years ago (2012-11-26 23:01:26 UTC) #8
bryeung
Didn't have time to get through the whole CL...but thought I'd send along these comments ...
8 years ago (2012-11-27 20:37:04 UTC) #9
youngki
https://chromiumcodereview.appspot.com/11411130/diff/1014/device/bluetooth/bluetooth_adapter_win.h File device/bluetooth/bluetooth_adapter_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/1014/device/bluetooth/bluetooth_adapter_win.h#newcode52 device/bluetooth/bluetooth_adapter_win.h:52: // BluetoothPollingThreadWin override On 2012/11/27 20:37:04, bryeung wrote: > ...
8 years ago (2012-11-27 21:43:34 UTC) #10
bryeung
https://chromiumcodereview.appspot.com/11411130/diff/1014/device/bluetooth/bluetooth_adapter_win.h File device/bluetooth/bluetooth_adapter_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/1014/device/bluetooth/bluetooth_adapter_win.h#newcode75 device/bluetooth/bluetooth_adapter_win.h:75: scoped_ptr<base::ThreadChecker> thread_checker_; On 2012/11/27 21:43:34, youngki wrote: > On ...
8 years ago (2012-11-28 13:41:11 UTC) #11
youngki
https://chromiumcodereview.appspot.com/11411130/diff/1014/device/bluetooth/bluetooth_adapter_win.h File device/bluetooth/bluetooth_adapter_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/1014/device/bluetooth/bluetooth_adapter_win.h#newcode75 device/bluetooth/bluetooth_adapter_win.h:75: scoped_ptr<base::ThreadChecker> thread_checker_; On 2012/11/28 13:41:11, bryeung wrote: > On ...
8 years ago (2012-11-28 15:04:39 UTC) #12
bryeung
https://chromiumcodereview.appspot.com/11411130/diff/10006/device/bluetooth/bluetooth_adapter_win.h File device/bluetooth/bluetooth_adapter_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/10006/device/bluetooth/bluetooth_adapter_win.h#newcode18 device/bluetooth/bluetooth_adapter_win.h:18: class ThreadChecker; no longer necessary now that you have ...
8 years ago (2012-11-28 16:26:08 UTC) #13
youngki
https://chromiumcodereview.appspot.com/11411130/diff/10006/device/bluetooth/bluetooth_adapter_win.h File device/bluetooth/bluetooth_adapter_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/10006/device/bluetooth/bluetooth_adapter_win.h#newcode18 device/bluetooth/bluetooth_adapter_win.h:18: class ThreadChecker; On 2012/11/28 16:26:08, bryeung wrote: > no ...
8 years ago (2012-11-28 19:19:13 UTC) #14
youngki
Bryan, I looked at several other examples how the separate threads are managed, and I ...
8 years ago (2012-11-29 22:07:23 UTC) #15
youngki
ping
8 years ago (2012-12-10 17:05:38 UTC) #16
bryeung
Please ignore these! (These are a bunch of old drafts that probably no longer apply...but ...
8 years ago (2012-12-10 19:15:35 UTC) #17
bryeung
https://chromiumcodereview.appspot.com/11411130/diff/16001/device/bluetooth/bluetooth_adapter_win.cc File device/bluetooth/bluetooth_adapter_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/16001/device/bluetooth/bluetooth_adapter_win.cc#newcode26 device/bluetooth/bluetooth_adapter_win.cc:26: // destructor because it is reference counted. who else ...
8 years ago (2012-12-10 19:51:27 UTC) #18
keybuk
https://chromiumcodereview.appspot.com/11411130/diff/16001/device/bluetooth/bluetooth_adapter_win.h File device/bluetooth/bluetooth_adapter_win.h (right): https://chromiumcodereview.appspot.com/11411130/diff/16001/device/bluetooth/bluetooth_adapter_win.h#newcode23 device/bluetooth/bluetooth_adapter_win.h:23: private BluetoothTaskManagerWin::Observer { you'll probably want this public so ...
8 years ago (2012-12-12 18:01:53 UTC) #19
youngki
Thanks for the reviews. Please take another look. https://chromiumcodereview.appspot.com/11411130/diff/16001/device/bluetooth/bluetooth_adapter_win.cc File device/bluetooth/bluetooth_adapter_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/16001/device/bluetooth/bluetooth_adapter_win.cc#newcode26 device/bluetooth/bluetooth_adapter_win.cc:26: // ...
8 years ago (2012-12-17 17:17:22 UTC) #20
youngki
I replaced raw MessageLoop* pointer with safer SequencedTaskRunner refcounted pointer. Please take a look.
8 years ago (2012-12-18 17:32:05 UTC) #21
youngki
ping?
8 years ago (2012-12-19 16:25:34 UTC) #22
keybuk
lgtm
8 years ago (2012-12-19 18:55:51 UTC) #23
bryeung
lgtm https://chromiumcodereview.appspot.com/11411130/diff/30001/device/bluetooth/bluetooth_polling_thread_win.cc File device/bluetooth/bluetooth_polling_thread_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/30001/device/bluetooth/bluetooth_polling_thread_win.cc#newcode30 device/bluetooth/bluetooth_polling_thread_win.cc:30: // A frame-based exception handler filter functionj for ...
8 years ago (2012-12-19 19:15:41 UTC) #24
youngki
The following unittests are implemented: bluetooth_adapter_win_unittest.cc bluetooth_task_manager_win_unittest.cc bluetooth_polling_thread_win_unittest.cc Please take a look at the unittests ...
8 years ago (2012-12-21 19:25:30 UTC) #25
brettw
Sorry if I don't have a lot of background on this before now. Just to ...
7 years, 11 months ago (2013-01-04 22:05:34 UTC) #26
youngki
Thanks for the detailed review Brett..! I am implementing a new patch based on your ...
7 years, 11 months ago (2013-01-07 16:20:22 UTC) #27
brettw
The blocking pool is the name (in browser_thread.h) for an instance of a SequencedWorkerPool in ...
7 years, 11 months ago (2013-01-07 18:38:07 UTC) #28
youngki
Hey Brett, could you take another look? I implemented BluetoothTaskManager using SequencedWorkerPool and removed BluetoothPollingThreadWin ...
7 years, 11 months ago (2013-01-07 23:56:34 UTC) #29
youngki
On 2013/01/07 23:56:34, youngki wrote: > Hey Brett, could you take another look? I implemented ...
7 years, 11 months ago (2013-01-09 16:33:12 UTC) #30
brettw
Thread stuff looks good. I have a few general comments. We should try to get ...
7 years, 11 months ago (2013-01-09 20:06:04 UTC) #31
youngki
Greg, could you answer Brett's question? He's asking if we could remove exception and just ...
7 years, 11 months ago (2013-01-09 22:20:14 UTC) #32
grt (UTC plus 2)
https://chromiumcodereview.appspot.com/11411130/diff/46001/device/bluetooth/bluetooth_task_manager_win.cc File device/bluetooth/bluetooth_task_manager_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/46001/device/bluetooth/bluetooth_task_manager_win.cc#newcode24 device/bluetooth/bluetooth_task_manager_win.cc:24: #pragma comment(lib, "delayimp.lib") On 2013/01/09 22:20:14, youngki wrote: > ...
7 years, 11 months ago (2013-01-10 04:01:46 UTC) #33
brettw
If you're going to be adding a bunch more bluetooth function calls, I think the ...
7 years, 11 months ago (2013-01-10 04:10:39 UTC) #34
youngki
https://chromiumcodereview.appspot.com/11411130/diff/46001/device/bluetooth/bluetooth_task_manager_win.cc File device/bluetooth/bluetooth_task_manager_win.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/46001/device/bluetooth/bluetooth_task_manager_win.cc#newcode24 device/bluetooth/bluetooth_task_manager_win.cc:24: #pragma comment(lib, "delayimp.lib") On 2013/01/10 04:01:47, grt wrote: > ...
7 years, 11 months ago (2013-01-10 18:52:00 UTC) #35
youngki
I didn't know Greg had further comments on the code; I just addressed all of ...
7 years, 11 months ago (2013-01-11 20:00:25 UTC) #36
grt (UTC plus 2)
lgtm
7 years, 11 months ago (2013-01-11 20:15:41 UTC) #37
youngki
Thanks Greg..! Brett, let me know if you are okay with this change. I'd like ...
7 years, 11 months ago (2013-01-11 20:18:27 UTC) #38
jam
On 2013/01/09 16:33:12, youngki wrote: > On 2013/01/07 23:56:34, youngki wrote: > > Hey Brett, ...
7 years, 11 months ago (2013-01-11 23:40:53 UTC) #39
youngki
Done. I removed content dependency entirely from testing as well by making ui and bluetooth ...
7 years, 11 months ago (2013-01-14 18:49:11 UTC) #40
youngki
Actually I had to put back DEPS and also content dependency to device.gyp because this ...
7 years, 11 months ago (2013-01-15 15:57:05 UTC) #41
keybuk
lgtm, with one nit https://chromiumcodereview.appspot.com/11411130/diff/65004/device/bluetooth/bluetooth_adapter_win_unittest.cc File device/bluetooth/bluetooth_adapter_win_unittest.cc (right): https://chromiumcodereview.appspot.com/11411130/diff/65004/device/bluetooth/bluetooth_adapter_win_unittest.cc#newcode17 device/bluetooth/bluetooth_adapter_win_unittest.cc:17: const char* kAdapterName = "Bluetooth ...
7 years, 11 months ago (2013-01-15 19:34:07 UTC) #42
jam
On 2013/01/15 15:57:05, youngki wrote: > Actually I had to put back DEPS and also ...
7 years, 11 months ago (2013-01-15 21:17:30 UTC) #43
brettw
LGTM for the general thread approach. I didn't look at the details.
7 years, 11 months ago (2013-01-15 21:22:09 UTC) #44
youngki
Thanks for the review everyone..! I am putting this into CQ. https://chromiumcodereview.appspot.com/11411130/diff/65004/device/bluetooth/bluetooth_adapter_win_unittest.cc File device/bluetooth/bluetooth_adapter_win_unittest.cc (right): ...
7 years, 11 months ago (2013-01-15 21:27:08 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/youngki@chromium.org/11411130/89001
7 years, 11 months ago (2013-01-15 21:29:46 UTC) #46
commit-bot: I haz the power
7 years, 11 months ago (2013-01-16 00:28:21 UTC) #47
Message was sent while issue was closed.
Change committed as 177024

Powered by Google App Engine
This is Rietveld 408576698