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

Issue 2820863002: Geolocation: cleanup NetworkLocationProvider (Closed)

Created:
3 years, 8 months ago by mcasas
Modified:
3 years, 8 months ago
Reviewers:
dougt, scheib
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Geolocation: cleanup NetworkLocationProvider This CL: - makes NetworkLocationProvider use ThreadChecker instead of being a base::NonThreadSafe. - removes unnecessary OnWifiDataUpdated() method, the contents being merged into OnWifiDataUpdate() which is called instead of semi-duplicated code in RequestPosition(), clarifying the logic. - clarifies the logic in RequestPosition(), were some checks were redundant, in particular: we don't need to test nor invalidate the weak pointers. Rationale: RequestPosition() can be called from OnPermissionGranted(), the new OnWifiDataUpdate() (ToT's OnWifiDataUpdated()) and from the PostDelayedTask in StartUpdate(); |weak_factory_|'s HasWeakPointers() was used to differentiate those call sites; but this can be done via the |is_...| variables: if (!is_new_data_available_ || !is_wifi_data_complete_) and |weak_factory_|'s pointers are only used to launch the delayed RequestPosition() from StartProvider(). Test-wise: network_location_provider_unittest.cc is pretty extensive and it's still passing. BUG=629158 Review-Url: https://codereview.chromium.org/2820863002 Cr-Commit-Position: refs/heads/master@{#465280} Committed: https://chromium.googlesource.com/chromium/src/+/1361d4b18439259e34712495ad154cdff1d548a7

Patch Set 1 #

Total comments: 8

Patch Set 2 : dougt@ comments #

Patch Set 3 : restoring returning in StartProvider() if (!request_->url().is_valid()), used in components_browsertests #

Total comments: 3

Patch Set 4 : scheib@ comment, method order restored #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -68 lines) Patch
M device/geolocation/network_location_provider.h View 1 5 chunks +11 lines, -12 lines 0 comments Download
M device/geolocation/network_location_provider.cc View 1 2 3 5 chunks +44 lines, -56 lines 0 comments Download

Messages

Total messages: 36 (24 generated)
mcasas
dougt@ PTAL
3 years, 8 months ago (2017-04-17 16:59:00 UTC) #10
dougt
ooc, why not add thread_checker DCHECKs to all public methods? https://codereview.chromium.org/2820863002/diff/1/device/geolocation/network_location_provider.cc File device/geolocation/network_location_provider.cc (right): https://codereview.chromium.org/2820863002/diff/1/device/geolocation/network_location_provider.cc#newcode146 ...
3 years, 8 months ago (2017-04-17 18:58:53 UTC) #11
mcasas
ptal https://codereview.chromium.org/2820863002/diff/1/device/geolocation/network_location_provider.cc File device/geolocation/network_location_provider.cc (right): https://codereview.chromium.org/2820863002/diff/1/device/geolocation/network_location_provider.cc#newcode146 device/geolocation/network_location_provider.cc:146: if (!request_->url().is_valid()) // Already DLOG() in constructor. On ...
3 years, 8 months ago (2017-04-17 20:47:55 UTC) #13
dougt
lgtm
3 years, 8 months ago (2017-04-17 21:06:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2820863002/60001
3 years, 8 months ago (2017-04-17 23:50:00 UTC) #17
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started once the ...
3 years, 8 months ago (2017-04-17 23:50:01 UTC) #19
mcasas
scheib@ ptal/ rs plz
3 years, 8 months ago (2017-04-18 00:11:42 UTC) #23
scheib
In the future, please keep code moves (definitions to match declarations order) in stand alone ...
3 years, 8 months ago (2017-04-18 03:33:17 UTC) #26
mcasas
Also rewritten CL description. https://codereview.chromium.org/2820863002/diff/60001/device/geolocation/network_location_provider.cc File device/geolocation/network_location_provider.cc (right): https://codereview.chromium.org/2820863002/diff/60001/device/geolocation/network_location_provider.cc#newcode127 device/geolocation/network_location_provider.cc:127: DLOG_IF(WARNING, url.is_valid()) On 2017/04/18 03:33:17, ...
3 years, 8 months ago (2017-04-18 05:39:02 UTC) #29
scheib
Thanks. LGTM
3 years, 8 months ago (2017-04-18 16:47:53 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2820863002/80001
3 years, 8 months ago (2017-04-18 16:48:56 UTC) #33
commit-bot: I haz the power
3 years, 8 months ago (2017-04-18 17:35:29 UTC) #36
Message was sent while issue was closed.
Committed patchset #4 (id:80001) as
https://chromium.googlesource.com/chromium/src/+/1361d4b18439259e34712495ad15...

Powered by Google App Engine
This is Rietveld 408576698