|
|
Chromium Code Reviews|
Created:
5 years, 6 months ago by krstnmnlsn Modified:
5 years, 6 months ago CC:
chromium-reviews, scheib+watch_chromium.org Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionAdding support for Low Energy device discovery to BluetoothAdapterMac.
Modified BluetoothAdapterMac so that AddDiscoverySession can start low
energy discovery sessions in addition to classic. Note that the adapter
cannot yet add LE devices found to |devices_| because the ability to
distinguish LE and classic devices, when they are stored as
BluetoothDevice, is not yet implemented.
Also added corresponding tests to bluetooth_adapter_mac_unittest.mm and
created class MockCentralManager.
BUG=496987
Committed: https://crrev.com/c08decbd80f568e4177a4f82942e2ed04c97735e
Cr-Commit-Position: refs/heads/master@{#336062}
Patch Set 1 : #
Total comments: 20
Patch Set 2 : Scheib fixes #Patch Set 3 : adding issue # #
Total comments: 10
Patch Set 4 : trying to fix upstream #Patch Set 5 : trying new selector #Patch Set 6 : removing references to CBCentralManager #
Total comments: 15
Patch Set 7 : scheib fixes #2, also adding delegate property to mock #Patch Set 8 : Working around CBCentralManager dealloc bug by leaking |manager_| #Patch Set 9 : comment nit on SetManagerForTesting. #
Total comments: 4
Patch Set 10 : comment fixes #Dependent Patchsets: Messages
Total messages: 144 (94 generated)
Patchset #1 (id:1) has been deleted
Patchset #1 (id:20001) has been deleted
krstnmnlsn@chromium.org changed reviewers: + armansito@chromium.org, scheib@chromium.org
Hey, here is the first of (at least) 2 cls to allow LE device discovery on mac. Sorry there are so many files, a lot of those have very minor changes. Also 3 of the files are testing-related. Please look over it whenever you have a chance, thanks!
The CQ bit was checked by scheib@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/40001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
1/2 way through review, but have to stop for now, here's a few items: https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/BUILD.gn File device/bluetooth/BUILD.gn (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/BUILD.... device/bluetooth/BUILD.gn:220: "test/mock_bluetooth_central_manager.h", Mac specific files should only be built on that platform. The build systems can do this implicitly by either having a file suffix _mac, be in a mac directory, or it can be done explicitly with conditional sections of build files. In GN the conditionals look like "if (is_mac)". In GYP: """ 'conditions': [ ['OS=="mac"', { """ https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac.h (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.h:115: Comment. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac.mm (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:178: bool BluetoothAdapterMac::StartDiscovery( Move to after SetDiscoveryFilter. "Method definitions in the corresponding .cc file should be the same as the declaration order, as much as possible." http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Declaration_O... https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:186: if ((transport & BluetoothDiscoveryFilter::Transport::TRANSPORT_CLASSIC) && We should find a mix of classic and LE devices and test that starting discovery on both APIs at the same time will work. I can help with that a bit. Or, if there's more info already known about this we should document it here in comments. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:385: // handle instances of LowEnergyBluetoothDevice in |devices_|. Add a reference to the issue number to do that work. Just a crbug.com/000000 after the sentence. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:390: NOTIMPLEMENTED(); We expect LE sessions will be started, so we can't throw an error here because we haven't implemented this yet. Just remove NOTIMPLEMENTED for now. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:394: // instances of BluetoothDeviceMac. Add support for low energy devices. issue number.
https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac.mm (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:213: if (!StartDiscovery(discovery_filter)) { Without seeing the plans for how differing filters will be handled I'm uncertain about this. Previously if multiple AddDiscoverSessions happen the system was only asked to scan once. I don't know if the OSX APIs care, but I also don't see a need to call them more than once unless we have a reason to. Adding Classic and LE simultaneously gives us a reason to do something if first a discovery session requested only one, but another AddDiscoverySession requested another one. Perhaps num_discovery_sessions_ should be duplicated for both Classic and LE counts? If filters later try to support scanning for differing sets of service UUIDs in LE, we'll need e.g. merging logic for the filer, or postponing or failing a new discovery session if one is already under way. After clearing up the design intent (put it in the design doc, and add comments here explaining anything (especially the 'why' that isn't obvious from code)) Then add tests for the different scenarios of multiple AddDiscoverySessions. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac_unittest.mm (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac_unittest.mm:26: // Helper methods for access BluetoothAdapterMacTest's members. access to https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac_unittest.mm:106: [mock_central_manager_ setScanForPeripheralsWasCalled:NO]; Would it be easier and perhaps measure behavior more specifically to track call counts, e.g. setScanForPeripheralCallCount?
Thanks! https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/BUILD.gn File device/bluetooth/BUILD.gn (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/BUILD.... device/bluetooth/BUILD.gn:220: "test/mock_bluetooth_central_manager.h", On 2015/06/05 18:10:20, scheib wrote: > Mac specific files should only be built on that platform. The build systems can > do this implicitly by either having a file suffix _mac, be in a mac directory, > or it can be done explicitly with conditional sections of build files. In GN the > conditionals look like "if (is_mac)". In GYP: > """ > 'conditions': [ > ['OS=="mac"', { > """ Alright, please check if I've got it correct now. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac.h (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.h:115: On 2015/06/05 18:10:20, scheib wrote: > Comment. Done. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac.mm (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:178: bool BluetoothAdapterMac::StartDiscovery( On 2015/06/05 18:10:20, scheib wrote: > Move to after SetDiscoveryFilter. "Method definitions in the corresponding .cc > file should be the same as the declaration order, as much as possible." > http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Declaration_O... Right. I went ahead and moved RemovePairingDelegateInteral as well. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:186: if ((transport & BluetoothDiscoveryFilter::Transport::TRANSPORT_CLASSIC) && On 2015/06/05 18:10:20, scheib wrote: > We should find a mix of classic and LE devices and test that starting discovery > on both APIs at the same time will work. I can help with that a bit. > > Or, if there's more info already known about this we should document it here in > comments. Manually tested and added a short comment (cannot find any information online). https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:213: if (!StartDiscovery(discovery_filter)) { On 2015/06/06 05:09:48, scheib wrote: > Without seeing the plans for how differing filters will be handled I'm uncertain > about this. Previously if multiple AddDiscoverSessions happen the system was > only asked to scan once. I don't know if the OSX APIs care, but I also don't see > a need to call them more than once unless we have a reason to. > > Adding Classic and LE simultaneously gives us a reason to do something if first > a discovery session requested only one, but another AddDiscoverySession > requested another one. Perhaps num_discovery_sessions_ should be duplicated for > both Classic and LE counts? > > If filters later try to support scanning for differing sets of service UUIDs in > LE, we'll need e.g. merging logic for the filer, or postponing or failing a new > discovery session if one is already under way. > > After clearing up the design intent (put it in the design doc, and add comments > here explaining anything (especially the 'why' that isn't obvious from code)) > Then add tests for the different scenarios of multiple AddDiscoverySessions. Recap/continuing of offline discussion: The plans for handling of differing filters have mostly already been made in the BluetoothAdapter class (see: GetMergedDiscoveryFilter). We can handle merging (and editing) the set of filters, and notifying the system of a filter change will be consistent with Chromeos and what (I was interpreting to be) the desired cross-platform behavior. The LE API does not mind repeated calls to start bluetooth/peripheral discovery, the classic API might. That is why the classic part of StartDiscovery currently does nothing on a repeated call (this was the previous behavior as well). Issue: crbug.com/498056 https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:385: // handle instances of LowEnergyBluetoothDevice in |devices_|. On 2015/06/05 18:10:20, scheib wrote: > Add a reference to the issue number to do that work. Just a crbug.com/000000 > after the sentence. Done. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:390: NOTIMPLEMENTED(); On 2015/06/05 18:10:20, scheib wrote: > We expect LE sessions will be started, so we can't throw an error here because > we haven't implemented this yet. Just remove NOTIMPLEMENTED for now. Done. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac.mm:394: // instances of BluetoothDeviceMac. Add support for low energy devices. On 2015/06/05 18:10:20, scheib wrote: > issue number. Done. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter_mac_unittest.mm (right): https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac_unittest.mm:26: // Helper methods for access BluetoothAdapterMacTest's members. On 2015/06/06 05:09:48, scheib wrote: > access to Done. https://codereview.chromium.org/1165053003/diff/40001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter_mac_unittest.mm:106: [mock_central_manager_ setScanForPeripheralsWasCalled:NO]; On 2015/06/06 05:09:48, scheib wrote: > Would it be easier and perhaps measure behavior more specifically to track call > counts, e.g. setScanForPeripheralCallCount? Sure, I was already debating switching it.
lgtm with a few nits. The code is getting cleaner already! https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/BUILD.gn File device/bluetooth/BUILD.gn (right): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/BUILD.... device/bluetooth/BUILD.gn:245: if (is_mac) { I don't think you need the is_mac check here. The *_mac.* part of the file name should take care of that, no (see src/build/config/BUILDCONFIG.gn)? https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... File device/bluetooth/bluetooth.gyp (right): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth.gyp:235: ['OS=="mac"', { Is this check needed? https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter.h (left): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter.h:435: const ErrorCallback& error_callback) = 0; nit: New line before the comment block (keeps things visually easier to parse). https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter.h:426: // greater than 0 and AddDiscoverySession (RemoveDiscoverySession) is called I'm confused by the parentheses? Do you mean "AddDiscoverySession or RemoveDiscoverySession is called"? https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter.h:439: // bluetooth controller. nit: s/bluetooth/Bluetooth/
nits done, thanks Arman https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/BUILD.gn File device/bluetooth/BUILD.gn (right): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/BUILD.... device/bluetooth/BUILD.gn:245: if (is_mac) { On 2015/06/09 19:32:58, armansito wrote: > I don't think you need the is_mac check here. The *_mac.* part of the file name > should take care of that, no (see src/build/config/BUILDCONFIG.gn)? Done. https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... File device/bluetooth/bluetooth.gyp (right): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth.gyp:235: ['OS=="mac"', { On 2015/06/09 19:32:58, armansito wrote: > Is this check needed? Nope, apparently not :) https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter.h (left): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter.h:435: const ErrorCallback& error_callback) = 0; On 2015/06/09 19:32:59, armansito wrote: > nit: New line before the comment block (keeps things visually easier to parse). Done. https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... File device/bluetooth/bluetooth_adapter.h (right): https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter.h:426: // greater than 0 and AddDiscoverySession (RemoveDiscoverySession) is called On 2015/06/09 19:32:58, armansito wrote: > I'm confused by the parentheses? Do you mean "AddDiscoverySession or > RemoveDiscoverySession is called"? Yep, switched. https://codereview.chromium.org/1165053003/diff/80001/device/bluetooth/blueto... device/bluetooth/bluetooth_adapter.h:439: // bluetooth controller. On 2015/06/09 19:32:59, armansito wrote: > nit: s/bluetooth/Bluetooth/ Done.
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps100001 (title: "arman nits")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: CLs for remote refs other than refs/pending/heads/master must contain NOTRY=true and NOPRESUBMIT=true in order for the CQ to process them
The CQ bit was checked by scheib@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/100001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: CLs for remote refs other than refs/pending/heads/master must contain NOTRY=true and NOPRESUBMIT=true in order for the CQ to process them
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps120001 (title: "trying to fix upstream")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/120001
Patchset #4 (id:100001) has been deleted
LGTM
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps140001 (title: "importing CoreBluetooth to the discovery manager")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/140001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
Patchset #5 (id:140001) has been deleted
Patchset #5 (id:160001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps180001 (title: "trying new selector")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/180001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps200001 (title: "should now compile on < 10.7")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/200001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps220001 (title: "test, please ignore.")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/220001
Patchset #7 (id:220001) has been deleted
Patchset #7 (id:240001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps260001 (title: "try 1million")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/260001
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps240002 (title: "3billionth time's the charm")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/240002
Patchset #8 (id:240002) has been deleted
Patchset #7 (id:260001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps290001 (title: "???")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/290001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps310001 (title: "adding sdk_forward_declarations to the gyp & gn")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/310001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
Patchset #8 (id:310001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps330001 (title: "adding sdk_forward_decl to mock target")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/330001
Patchset #8 (id:330001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps350001 (title: "adding sdk_forward_declarations to gyp & gn")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/350001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_comp...)
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps370001 (title: "fixing gyp and gn paths")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/370001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
Patchset #9 (id:370001) has been deleted
Patchset #8 (id:350001) has been deleted
Patchset #7 (id:290001) has been deleted
Patchset #6 (id:200001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps390001 (title: "removing references to CBCentralManager")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/390001
So I think it's finally going to compile on 10.6 (still waiting on a few of the try bots). Tried to use OCMockObject but ran into some trouble (commented in the change) so a slightly ugly workaround was employed instead.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_gn_rel on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_adapter_mac_unittest.mm (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:33: // Cannot use a OCMockObject because mocking 'state' property gives a I haven't seen OCMockObject use yet, is this comment better placed at the definition of MockCentralManager? https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:34: // compiler warning when mock_central_manager of type id (multiple methods "when mock_central_manager of type id" confuses me a bit. Should this read "when mock_central_manager is of type id" https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:38: adapter_mac_->low_energy_discovery_manager_->SetManager( I think the logic should clearly skip the test if the manager can't be set. We can either have SetManagerForTesting return a bool if it is successfull, or just add the base::mac::IsOSLionOrLater() logic check here up above and emit the warning and return false. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h:74: virtual void SetManager(CBCentralManager* manager); If it is only called in tests, rename to SetManagerForTesting. https://www.chromium.org/developers/coding-style#Naming https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:143: // This method should not be called on OS X < 10.7. How about, "setDelegate is only available in OSX 10.7 and later." https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:148: } Either return a bool indicating if this was successful, or maybe simpler, Comment that it's LionOrLater and add a CHECK(base::mac::IsOSLionOrLater()) here, remove the 'if'. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/test/... File device/bluetooth/test/mock_bluetooth_central_manager_mac.h (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/test/... device/bluetooth/test/mock_bluetooth_central_manager_mac.h:16: @interface MockCentralManager : NSObject // Mocks a CBCentralManager
Patchset #7 (id:410001) has been deleted
Thanks Vincent! https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_adapter_mac_unittest.mm (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:33: // Cannot use a OCMockObject because mocking 'state' property gives a On 2015/06/17 16:55:08, scheib wrote: > I haven't seen OCMockObject use yet, is this comment better placed at the > definition of MockCentralManager? Done. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:34: // compiler warning when mock_central_manager of type id (multiple methods On 2015/06/17 16:55:08, scheib wrote: > "when mock_central_manager of type id" confuses me a bit. Should this read "when > mock_central_manager is of type id" Done. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:38: adapter_mac_->low_energy_discovery_manager_->SetManager( On 2015/06/17 16:55:08, scheib wrote: > I think the logic should clearly skip the test if the manager can't be set. We > can either have SetManagerForTesting return a bool if it is successfull, or just > add the base::mac::IsOSLionOrLater() logic check here up above and emit the > warning and return false. The check in SetManagerForTesting() is redundant with the one already here (I think checking CBCentralManager != nil is actually stronger because Apple might deprecate CBCentralManager is some OS that is LionOrLater). I added it in case some other function calls SetManagerForTesting() without already checking CoreBluetooth is available. But yes in that case giving some indication of the failed manager would be a good idea. Changing the if statement to a CHECK(LionOrLater) should handle that (?) https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h:74: virtual void SetManager(CBCentralManager* manager); On 2015/06/17 16:55:08, scheib wrote: > If it is only called in tests, rename to SetManagerForTesting. > https://www.chromium.org/developers/coding-style#Naming Done. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:143: // This method should not be called on OS X < 10.7. On 2015/06/17 16:55:08, scheib wrote: > How about, "setDelegate is only available in OSX 10.7 and later." Done. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:148: } On 2015/06/17 16:55:08, scheib wrote: > Either return a bool indicating if this was successful, or maybe simpler, > Comment that it's LionOrLater and add a CHECK(base::mac::IsOSLionOrLater()) > here, remove the 'if'. I like the CHECK idea. https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/test/... File device/bluetooth/test/mock_bluetooth_central_manager_mac.h (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/test/... device/bluetooth/test/mock_bluetooth_central_manager_mac.h:16: @interface MockCentralManager : NSObject On 2015/06/17 16:55:08, scheib wrote: > // Mocks a CBCentralManager Done.
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps430001 (title: "scheib fixes #2, also adding delegate property to mock ")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/430001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
LGTM again https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... File device/bluetooth/bluetooth_adapter_mac_unittest.mm (right): https://codereview.chromium.org/1165053003/diff/390001/device/bluetooth/bluet... device/bluetooth/bluetooth_adapter_mac_unittest.mm:38: adapter_mac_->low_energy_discovery_manager_->SetManager( On 2015/06/17 20:18:41, krstnmnlsn wrote: > On 2015/06/17 16:55:08, scheib wrote: > > I think the logic should clearly skip the test if the manager can't be set. We > > can either have SetManagerForTesting return a bool if it is successfull, or > just > > add the base::mac::IsOSLionOrLater() logic check here up above and emit the > > warning and return false. > > The check in SetManagerForTesting() is redundant with the one already here (I > think checking CBCentralManager != nil is actually stronger because Apple might > deprecate CBCentralManager is some OS that is LionOrLater). I added it in case > some other function calls SetManagerForTesting() without already checking > CoreBluetooth is available. But yes in that case giving some indication of the > failed manager would be a good idea. Changing the if statement to a > CHECK(LionOrLater) should handle that (?) CHECK handles it. Wouldn't hurt to mention in the .h comment for SetManagerForTesting the requirement of IsOSLionOrLater.
Patchset #9 (id:470001) has been deleted
Patchset #8 (id:450001) has been deleted
Patchset #8 (id:490001) has been deleted
Patchset #8 (id:510001) has been deleted
Patchset #8 (id:530001) has been deleted
Patchset #9 (id:570001) has been deleted
Patchset #8 (id:550001) has been deleted
Patchset #26 (id:930001) has been deleted
Patchset #25 (id:910001) has been deleted
Patchset #24 (id:890001) has been deleted
Patchset #23 (id:870001) has been deleted
Patchset #22 (id:850001) has been deleted
Patchset #21 (id:760002) has been deleted
Patchset #18 (id:780001) has been deleted
Patchset #19 (id:820001) has been deleted
Patchset #17 (id:760001) has been deleted
Patchset #17 (id:800001) has been deleted
Patchset #16 (id:750001) has been deleted
Patchset #15 (id:730001) has been deleted
Patchset #14 (id:710001) has been deleted
Patchset #13 (id:690001) has been deleted
Patchset #11 (id:650001) has been deleted
Patchset #9 (id:610001) has been deleted
Patchset #10 (id:670001) has been deleted
Patchset #9 (id:630001) has been deleted
Patchset #8 (id:590001) has been deleted
Patchset #8 (id:950001) has been deleted
The CQ bit was checked by krstnmnlsn@chromium.org to run a CQ dry run
The patchset sent to the CQ was uploaded after l-g-t-m from scheib@chromium.org, armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps990001 (title: "comment nit on SetManagerForTesting.")
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/990001
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Exceeded global retry quota
https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h (right): https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h:83: // Underlying CoreBluetooth central manager. Deallocating CBCentralManager // Underlying CoreBluetooth central manager. // // Note: Intentionally leaked. Deallocating CBCentralManager // results in a crash, at least when running OSX 10.9.5 on a // mac_chromuim_rel_ng trybot. On the other hand, restricting |manager_| use // to 10.10 and later would mean the code is unrun and untested by the current // trybots. To work around this we call retain on |manager_| after allocation, // so that the object is leaked. https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm (right): https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:174: [manager_ retain]; Add a comment here referencing the explanation in the header. // Increment reference count, see comment at declaration.
comments fixed! https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h (right): https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.h:83: // Underlying CoreBluetooth central manager. Deallocating CBCentralManager On 2015/06/24 23:24:24, scheib wrote: > // Underlying CoreBluetooth central manager. > // > // Note: Intentionally leaked. Deallocating CBCentralManager > // results in a crash, at least when running OSX 10.9.5 on a > // mac_chromuim_rel_ng trybot. On the other hand, restricting |manager_| use > // to 10.10 and later would mean the code is unrun and untested by the current > // trybots. To work around this we call retain on |manager_| after allocation, > // so that the object is leaked. Done. https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... File device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm (right): https://codereview.chromium.org/1165053003/diff/990001/device/bluetooth/bluet... device/bluetooth/bluetooth_low_energy_discovery_manager_mac.mm:174: [manager_ retain]; On 2015/06/24 23:24:25, scheib wrote: > Add a comment here referencing the explanation in the header. > // Increment reference count, see comment at declaration. Done.
LGTM
The CQ bit was checked by krstnmnlsn@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from armansito@chromium.org Link to the patchset: https://codereview.chromium.org/1165053003/#ps1010001 (title: "comment fixes")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1165053003/1010001
Message was sent while issue was closed.
Committed patchset #10 (id:1010001)
Message was sent while issue was closed.
Patchset 10 (id:??) landed as https://crrev.com/c08decbd80f568e4177a4f82942e2ed04c97735e Cr-Commit-Position: refs/heads/master@{#336062} |
