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

Issue 2564653004: CrOS Tether: Create HostScanScheduler, which schedules scans for devices which can serve as tether … (Closed)

Created:
4 years ago by Kyle Horimoto
Modified:
4 years ago
CC:
chromium-reviews, jlklein+watch-tether_chromium.org, droger+watchlist_chromium.org, tengs+watch-tether_chromium.org, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, hansberry+watch-tether_chromium.org, jhawkins+watch-tether_chromium.org, oshima+watch_chromium.org, khorimoto+watch-tether_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

CrOS Tether: Create HostScanScheduler, which schedules scans for devices which can serve as tether hotspots. Scans can be triggered manually (via a function call) or automatically (when conditions change such that a scan should be performed). These conditions are: (1) Must be logged in and active. (2) Must not have a current Internet connection. (3) Must have synced CryptAuth tether host devices. Note that this CL does not integrate this code yet. In order to do that, a CryptAuthService must be created to provide the CryptAuthDeviceManager. Once that code is in place, the scheduler will be created an initialized by the Initializer. BUG=672263 Committed: https://crrev.com/e74a10c8ed2571d066f5901c8d28b3ea89e7eea4 Cr-Commit-Position: refs/heads/master@{#439307}

Patch Set 1 #

Total comments: 6

Patch Set 2 : hansberry@ comments. #

Patch Set 3 : Use PA_LOG(). #

Total comments: 24

Patch Set 4 : hansberry@ comment. #

Patch Set 5 : Add missing BUILD dependencies. #

Patch Set 6 : Add another dependency. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+543 lines, -1 line) Patch
M chromeos/components/tether/BUILD.gn View 1 2 3 4 5 2 chunks +17 lines, -1 line 0 comments Download
A chromeos/components/tether/DEPS View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
A chromeos/components/tether/host_scan_scheduler.h View 1 chunk +112 lines, -0 lines 0 comments Download
A chromeos/components/tether/host_scan_scheduler.cc View 1 2 3 1 chunk +138 lines, -0 lines 0 comments Download
A chromeos/components/tether/host_scan_scheduler_unittest.cc View 1 chunk +227 lines, -0 lines 0 comments Download
A chromeos/components/tether/host_scanner.h View 1 chunk +26 lines, -0 lines 0 comments Download
A chromeos/components/tether/host_scanner.cc View 1 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 27 (13 generated)
Kyle Horimoto
4 years ago (2016-12-10 00:01:20 UTC) #2
Ryan Hansberry
https://codereview.chromium.org/2564653004/diff/1/chromeos/components/tether/host_scan_scheduler.cc File chromeos/components/tether/host_scan_scheduler.cc (right): https://codereview.chromium.org/2564653004/diff/1/chromeos/components/tether/host_scan_scheduler.cc#newcode39 chromeos/components/tether/host_scan_scheduler.cc:39: LoginState::Get()->AddObserver(host_scan_scheduler); RemoveObserver is calling AddObserver methods. https://codereview.chromium.org/2564653004/diff/1/chromeos/components/tether/host_scan_scheduler_unittest.cc File chromeos/components/tether/host_scan_scheduler_unittest.cc ...
4 years ago (2016-12-12 19:18:28 UTC) #4
Kyle Horimoto
https://codereview.chromium.org/2564653004/diff/1/chromeos/components/tether/host_scan_scheduler.cc File chromeos/components/tether/host_scan_scheduler.cc (right): https://codereview.chromium.org/2564653004/diff/1/chromeos/components/tether/host_scan_scheduler.cc#newcode39 chromeos/components/tether/host_scan_scheduler.cc:39: LoginState::Get()->AddObserver(host_scan_scheduler); On 2016/12/12 19:18:27, Ryan Hansberry wrote: > RemoveObserver ...
4 years ago (2016-12-12 19:22:13 UTC) #5
Ryan Hansberry
lgtm https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tether/host_scan_scheduler.cc File chromeos/components/tether/host_scan_scheduler.cc (right): https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tether/host_scan_scheduler.cc#newcode21 chromeos/components/tether/host_scan_scheduler.cc:21: namespace {} // namespace Is this needed?
4 years ago (2016-12-17 00:57:11 UTC) #6
Kyle Horimoto
https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tether/host_scan_scheduler.cc File chromeos/components/tether/host_scan_scheduler.cc (right): https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tether/host_scan_scheduler.cc#newcode21 chromeos/components/tether/host_scan_scheduler.cc:21: namespace {} // namespace On 2016/12/17 00:57:11, Ryan Hansberry ...
4 years ago (2016-12-17 01:18:14 UTC) #7
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/2564653004/60001
4 years ago (2016-12-17 01:19:01 UTC) #10
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_daisy_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_daisy_chromium_compile_only_ng/builds/253536)
4 years ago (2016-12-17 01:25:00 UTC) #12
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/2564653004/80001
4 years ago (2016-12-17 01:40:09 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/291024) linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years ago (2016-12-17 01:46:34 UTC) #17
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/2564653004/100001
4 years ago (2016-12-17 01:55:06 UTC) #20
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years ago (2016-12-17 03:30:33 UTC) #23
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/e74a10c8ed2571d066f5901c8d28b3ea89e7eea4 Cr-Commit-Position: refs/heads/master@{#439307}
4 years ago (2016-12-17 03:32:27 UTC) #25
Tim Song
https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tether/host_scan_scheduler.h File chromeos/components/tether/host_scan_scheduler.h (right): https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tether/host_scan_scheduler.h#newcode33 chromeos/components/tether/host_scan_scheduler.h:33: // (1) The user has just started using the ...
4 years ago (2016-12-17 05:13:42 UTC) #26
Kyle Horimoto
4 years ago (2016-12-19 21:10:48 UTC) #27
Message was sent while issue was closed.
The requested changes have been implemented in
https://codereview.chromium.org/2587783003. Thanks!

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
File chromeos/components/tether/host_scan_scheduler.h (right):

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler.h:33: //   (1) The user has just
started using the device; specifically, the user has
On 2016/12/17 05:13:41, Tim Song wrote:
> "started using the device" is a bit confusing, due to multi-profile use cases.
I
> would just delete this sentence.

Done.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler.h:73: device_change_result)
override;
On 2016/12/17 05:13:41, Tim Song wrote:
> indenting issue

This was intentional since it doesn't fit on the previous line.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler.h:78: class Context {
On 2016/12/17 05:13:41, Tim Song wrote:
> A more conventional name for this would be Delegate.

Done.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler.h:80: virtual void
AddObserver(HostScanScheduler* host_scan_scheduler) = 0;
On 2016/12/17 05:13:41, Tim Song wrote:
> Maybe a better name would be observeSystemEvents(). AddObserver() is a bit
> confusing.

I'd like to keep Add/Remove since we really are just observing events from the
delegate.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler.h:87: class ContextImpl : public
Context {
On 2016/12/17 05:13:41, Tim Song wrote:
> You can move this to the .cc file.

This isn't possible since it extends Context, which is a private class.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler.h:98:
HostScanScheduler(std::unique_ptr<Context> context_,
On 2016/12/17 05:13:41, Tim Song wrote:
> nit: no trailing underscore.

Done.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
File chromeos/components/tether/host_scan_scheduler_unittest.cc (right):

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler_unittest.cc:60: observer_ ==
test_->host_scan_scheduler_.get();
On 2016/12/17 05:13:41, Tim Song wrote:
> Assert this condition instead.

This function is called in both EXPECT_FALSE() and EXPECT_TRUE(), so I'm leaving
as-is.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler_unittest.cc:71: void
AreTetherHostsSynced(bool value) { are_tether_hosts_synced = value; }
On 2016/12/17 05:13:41, Tim Song wrote:
> rename to set_are_thether_hosts_synced()

Done.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scan_scheduler_unittest.cc:82: class
MockHostScanner : public HostScanner {
On 2016/12/17 05:13:41, Tim Song wrote:
> This should be FakeHostScanner, as there are no mock functions.

Done.

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
File chromeos/components/tether/host_scanner.cc (right):

https://codereview.chromium.org/2564653004/diff/40001/chromeos/components/tet...
chromeos/components/tether/host_scanner.cc:1: // Copyright 2014 The Chromium
Authors. All rights reserved.
On 2016/12/17 05:13:41, Tim Song wrote:
> 2016

Done.

Powered by Google App Engine
This is Rietveld 408576698