|
|
Chromium Code Reviews|
Created:
4 years, 3 months ago by malaykeshav Modified:
4 years, 3 months ago CC:
chromium-reviews, kalyank, oshima+watch_chromium.org, sadrul, stevenjb+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionBug fix to toggle Network scanning indicator for WiFi
BUG=617831
COMPONENT=Chrome OS UI, Network
Committed: https://crrev.com/d35fb84631dfe8b92e69418dc270af487a0701af
Cr-Commit-Position: refs/heads/master@{#416744}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Bug fix to toggle Network scanning indicator for WiFi #Patch Set 3 : Bug fix to toggle Network scanning indicator for WiFi #
Total comments: 1
Messages
Total messages: 23 (11 generated)
The CQ bit was checked by malaykeshav@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
malaykeshav@chromium.org changed reviewers: + jdufault@chromium.org, stevenjb@chromium.org
PTAL. Minor bug fix to fix network scanning indicator.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
Thanks for looking into this. https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... File ash/common/system/chromeos/network/network_state_list_detailed_view.cc (right): https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... ash/common/system/chromeos/network/network_state_list_detailed_view.cc:577: if (scanning && list_type_ != LIST_TYPE_VPN) { This logic somehow got convoluted along the way. The list_type test is redundant with line 569. Also, the test for IsSystemTrayMenuMaterial() on line 575 should be moved after line 576, otherwise someone might use wifi_scanning_ elsewhere in the MD code without it updating correctly.
Removed the redundant check for list_type_ https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... File ash/common/system/chromeos/network/network_state_list_detailed_view.cc (right): https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... ash/common/system/chromeos/network/network_state_list_detailed_view.cc:577: if (scanning && list_type_ != LIST_TYPE_VPN) { On 2016/09/06 at 20:13:52, stevenjb wrote: > This logic somehow got convoluted along the way. The list_type test is redundant with line 569. Also, the test for IsSystemTrayMenuMaterial() on line 575 should be moved after line 576, otherwise someone might use wifi_scanning_ elsewhere in the MD code without it updating correctly. Just checked, the list_type_ test is indeed redundant. The value doesnt change once the class object has been initialized. Removing the second check to resolve this. wifi_scanning_ is _only_ used to check whether the scanning state of the device has changed(line 574). It is not being used anywhere else in the code. Should be okay to leave it as is.
On 2016/09/06 21:22:47, malaykeshav wrote: > Removed the redundant check for list_type_ > > https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... > File ash/common/system/chromeos/network/network_state_list_detailed_view.cc > (right): > > https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... > ash/common/system/chromeos/network/network_state_list_detailed_view.cc:577: if > (scanning && list_type_ != LIST_TYPE_VPN) { > On 2016/09/06 at 20:13:52, stevenjb wrote: > > This logic somehow got convoluted along the way. The list_type test is > redundant with line 569. Also, the test for IsSystemTrayMenuMaterial() on line > 575 should be moved after line 576, otherwise someone might use wifi_scanning_ > elsewhere in the MD code without it updating correctly. > > Just checked, the list_type_ test is indeed redundant. The value doesnt change > once the class object has been initialized. Removing the second check to resolve > this. > > wifi_scanning_ is _only_ used to check whether the scanning state of the device > has changed(line 574). It is not being used anywhere else in the code. Should be > okay to leave it as is. It may be OK for now, but if someone else decides to use it elsewhere in the MD version and makes the (not unreasonable) assumption that it accurately reflects the scanning state, we could end up with a subtle bug. I would really prefer that we always just set it accurately. (If we really didn't want to bother setting it we should move all of the logic to a helper function and just not call that for MD, that would at least be more clear). Thanks!
On 2016/09/06 at 21:27:17, stevenjb wrote: > On 2016/09/06 21:22:47, malaykeshav wrote: > > Removed the redundant check for list_type_ > > > > https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... > > File ash/common/system/chromeos/network/network_state_list_detailed_view.cc > > (right): > > > > https://codereview.chromium.org/2311093004/diff/1/ash/common/system/chromeos/... > > ash/common/system/chromeos/network/network_state_list_detailed_view.cc:577: if > > (scanning && list_type_ != LIST_TYPE_VPN) { > > On 2016/09/06 at 20:13:52, stevenjb wrote: > > > This logic somehow got convoluted along the way. The list_type test is > > redundant with line 569. Also, the test for IsSystemTrayMenuMaterial() on line > > 575 should be moved after line 576, otherwise someone might use wifi_scanning_ > > elsewhere in the MD code without it updating correctly. > > > > Just checked, the list_type_ test is indeed redundant. The value doesnt change > > once the class object has been initialized. Removing the second check to resolve > > this. > > > > wifi_scanning_ is _only_ used to check whether the scanning state of the device > > has changed(line 574). It is not being used anywhere else in the code. Should be > > okay to leave it as is. > > It may be OK for now, but if someone else decides to use it elsewhere in the MD version and makes the (not unreasonable) assumption that it accurately reflects the scanning state, we could end up with a subtle bug. I would really prefer that we always just set it accurately. Makes sense. Although I feel it would be better to rename the variable to something that suits its function. (The correct way to get the current wifi_scanning state is to use the NetworkHandler singleton) Renaming the variable to `prev_wifi_scanning_state_` should resolve all of the invalid assumptions? > > (If we really didn't want to bother setting it we should move all of the logic to a helper function and just not call that for MD, that would at least be more clear). > > Thanks!
Renaming the variable makes sense. Also why don't we just move the MaterialDesignController::IsSystemTrayMenuMaterial() to the if at line 569 and skip the GetScanningByType() call entirely. On Tue, Sep 6, 2016 at 2:42 PM, <malaykeshav@chromium.org> wrote: > On 2016/09/06 at 21:27:17, stevenjb wrote: > > On 2016/09/06 21:22:47, malaykeshav wrote: > > > Removed the redundant check for list_type_ > > > > > > > https://codereview.chromium.org/2311093004/diff/1/ash/ > common/system/chromeos/network/network_state_list_detailed_view.cc > > > File ash/common/system/chromeos/network/network_state_list_ > detailed_view.cc > > > (right): > > > > > > > https://codereview.chromium.org/2311093004/diff/1/ash/ > common/system/chromeos/network/network_state_list_ > detailed_view.cc#newcode577 > > > ash/common/system/chromeos/network/network_state_list_ > detailed_view.cc:577: > if > > > (scanning && list_type_ != LIST_TYPE_VPN) { > > > On 2016/09/06 at 20:13:52, stevenjb wrote: > > > > This logic somehow got convoluted along the way. The list_type test > is > > > redundant with line 569. Also, the test for IsSystemTrayMenuMaterial() > on > line > > > 575 should be moved after line 576, otherwise someone might use > wifi_scanning_ > > > elsewhere in the MD code without it updating correctly. > > > > > > Just checked, the list_type_ test is indeed redundant. The value doesnt > change > > > once the class object has been initialized. Removing the second check > to > resolve > > > this. > > > > > > wifi_scanning_ is _only_ used to check whether the scanning state of > the > device > > > has changed(line 574). It is not being used anywhere else in the code. > Should be > > > okay to leave it as is. > > > > It may be OK for now, but if someone else decides to use it elsewhere in > the > MD version and makes the (not unreasonable) assumption that it accurately > reflects the scanning state, we could end up with a subtle bug. I would > really > prefer that we always just set it accurately. > > Makes sense. Although I feel it would be better to rename the variable to > something that suits its function. (The correct way to get the current > wifi_scanning state is to use the NetworkHandler singleton) > Renaming the variable to `prev_wifi_scanning_state_` should resolve all of > the > invalid assumptions? > > > > > (If we really didn't want to bother setting it we should move all of the > logic > to a helper function and just not call that for MD, that would at least be > more > clear). > > > > Thanks! > > > > https://codereview.chromium.org/2311093004/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On 2016/09/06 at 21:46:30, stevenjb wrote: > Renaming the variable makes sense. Also why don't we just move > the MaterialDesignController::IsSystemTrayMenuMaterial() to the if at line > 569 and skip the GetScanningByType() call entirely. > > > On Tue, Sep 6, 2016 at 2:42 PM, <malaykeshav@chromium.org> wrote: > > > On 2016/09/06 at 21:27:17, stevenjb wrote: > > > On 2016/09/06 21:22:47, malaykeshav wrote: > > > > Removed the redundant check for list_type_ > > > > > > > > > > https://codereview.chromium.org/2311093004/diff/1/ash/ > > common/system/chromeos/network/network_state_list_detailed_view.cc > > > > File ash/common/system/chromeos/network/network_state_list_ > > detailed_view.cc > > > > (right): > > > > > > > > > > https://codereview.chromium.org/2311093004/diff/1/ash/ > > common/system/chromeos/network/network_state_list_ > > detailed_view.cc#newcode577 > > > > ash/common/system/chromeos/network/network_state_list_ > > detailed_view.cc:577: > > if > > > > (scanning && list_type_ != LIST_TYPE_VPN) { > > > > On 2016/09/06 at 20:13:52, stevenjb wrote: > > > > > This logic somehow got convoluted along the way. The list_type test > > is > > > > redundant with line 569. Also, the test for IsSystemTrayMenuMaterial() > > on > > line > > > > 575 should be moved after line 576, otherwise someone might use > > wifi_scanning_ > > > > elsewhere in the MD code without it updating correctly. > > > > > > > > Just checked, the list_type_ test is indeed redundant. The value doesnt > > change > > > > once the class object has been initialized. Removing the second check > > to > > resolve > > > > this. > > > > > > > > wifi_scanning_ is _only_ used to check whether the scanning state of > > the > > device > > > > has changed(line 574). It is not being used anywhere else in the code. > > Should be > > > > okay to leave it as is. > > > > > > It may be OK for now, but if someone else decides to use it elsewhere in > > the > > MD version and makes the (not unreasonable) assumption that it accurately > > reflects the scanning state, we could end up with a subtle bug. I would > > really > > prefer that we always just set it accurately. > > > > Makes sense. Although I feel it would be better to rename the variable to > > something that suits its function. (The correct way to get the current > > wifi_scanning state is to use the NetworkHandler singleton) > > Renaming the variable to `prev_wifi_scanning_state_` should resolve all of > > the > > invalid assumptions? > > > > > > > > (If we really didn't want to bother setting it we should move all of the > > logic > > to a helper function and just not call that for MD, that would at least be > > more > > clear). > > > > > > Thanks! > > > > > > > > https://codereview.chromium.org/2311093004/ > > > > -- > You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. > To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org. > Done
The CQ bit was checked by malaykeshav@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Cheers. LGTM
lgtm https://codereview.chromium.org/2311093004/diff/40001/ash/common/system/chrom... File ash/common/system/chromeos/network/network_state_list_detailed_view.cc (right): https://codereview.chromium.org/2311093004/diff/40001/ash/common/system/chrom... ash/common/system/chromeos/network/network_state_list_detailed_view.cc:312: prev_wifi_scanning_state_(false), Since you're already in this file, can you initialize all of these constant values in the header?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by malaykeshav@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Bug fix to toggle Network scanning indicator for WiFi BUG=617831 COMPONENT=Chrome OS UI, Network ========== to ========== Bug fix to toggle Network scanning indicator for WiFi BUG=617831 COMPONENT=Chrome OS UI, Network Committed: https://crrev.com/d35fb84631dfe8b92e69418dc270af487a0701af Cr-Commit-Position: refs/heads/master@{#416744} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/d35fb84631dfe8b92e69418dc270af487a0701af Cr-Commit-Position: refs/heads/master@{#416744} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
