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

Unified Diff: chromeos/components/tether/host_scan_cache.cc

Issue 2913313002: Tether: Persist if first-time setup is required to HostScanCache. (Closed)
Patch Set: khorimoto@ comments. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/components/tether/host_scan_cache.cc
diff --git a/chromeos/components/tether/host_scan_cache.cc b/chromeos/components/tether/host_scan_cache.cc
index 38a7aae5762c510ba49718b05ff7d64d724f403c..86f4c9e48e0426a5935f555251c69ebd867568a5 100644
--- a/chromeos/components/tether/host_scan_cache.cc
+++ b/chromeos/components/tether/host_scan_cache.cc
@@ -55,7 +55,8 @@ void HostScanCache::SetHostScanResult(const std::string& tether_network_guid,
const std::string& device_name,
const std::string& carrier,
int battery_percentage,
- int signal_strength) {
+ int signal_strength,
+ bool setup_required) {
DCHECK(!tether_network_guid.empty());
auto found_iter = tether_guid_to_timer_map_.find(tether_network_guid);
@@ -86,6 +87,11 @@ void HostScanCache::SetHostScanResult(const std::string& tether_network_guid,
<< "new signal strength: " << signal_strength;
}
+ if (setup_required)
Kyle Horimoto 2017/05/31 23:01:19 Previously, you forgot to add this if(), but the t
Ryan Hansberry 2017/06/01 01:07:51 Mentioned this on the past commit: This was actual
+ setup_required_tether_guids_.insert(tether_network_guid);
+ else
+ setup_required_tether_guids_.erase(tether_network_guid);
+
StartTimer(tether_network_guid);
}
@@ -109,6 +115,7 @@ bool HostScanCache::RemoveHostScanResult(
}
tether_guid_to_timer_map_.erase(it);
+ setup_required_tether_guids_.erase(tether_network_guid);
return network_state_handler_->RemoveTetherNetworkState(tether_network_guid);
}
@@ -147,6 +154,12 @@ void HostScanCache::ClearCacheExceptForActiveHost() {
}
}
+bool HostScanCache::DoesHostRequireSetup(
+ const std::string& tether_network_guid) {
+ return setup_required_tether_guids_.find(tether_network_guid) !=
+ setup_required_tether_guids_.end();
+}
+
void HostScanCache::OnPreviouslyConnectedHostIdsChanged() {
for (auto& map_entry : tether_guid_to_timer_map_) {
const std::string& tether_network_guid = map_entry.first;

Powered by Google App Engine
This is Rietveld 408576698