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

Unified Diff: chromeos/components/tether/host_scan_device_prioritizer.h

Issue 2844973002: [CrOS Tether] Create TetherHostResponseRecorder, which records ConnectTetheringResponses and Tether… (Closed)
Patch Set: Removed file that didn't belong in this CL, alphabetized forward declarations. Created 3 years, 8 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_device_prioritizer.h
diff --git a/chromeos/components/tether/host_scan_device_prioritizer.h b/chromeos/components/tether/host_scan_device_prioritizer.h
index b5f22999abd1486faa9add3d6d360e28df4b295a..43997e45572793765463c0f219f7dff873b5a5fa 100644
--- a/chromeos/components/tether/host_scan_device_prioritizer.h
+++ b/chromeos/components/tether/host_scan_device_prioritizer.h
@@ -8,13 +8,12 @@
#include "base/macros.h"
#include "components/cryptauth/remote_device.h"
-class PrefService;
-class PrefRegistrySimple;
-
namespace chromeos {
namespace tether {
+class TetherHostResponseRecorder;
+
// Prioritizes the order of devices when performing a host scan. To optimize for
// the most common tethering operations, this class uses the following rules:
// * The device which has most recently sent a successful
@@ -25,32 +24,16 @@ namespace tether {
// * All other devices are left in the order they are passed.
class HostScanDevicePrioritizer {
public:
- // Note: The PrefService* passed here must be created using the same registry
- // passed to RegisterPrefs().
- HostScanDevicePrioritizer(PrefService* pref_service);
+ HostScanDevicePrioritizer(
+ TetherHostResponseRecorder* tether_host_response_recorder);
virtual ~HostScanDevicePrioritizer();
- // Registers the prefs used by this class to |registry|. Must be called before
- // this class is utilized.
- static void RegisterPrefs(PrefRegistrySimple* registry);
-
- // Records a TetherAvailabilityResponse. This function should be called each
- // time that a response is received from a potential host, even if a
- // connection is not started.
- virtual void RecordSuccessfulTetherAvailabilityResponse(
- const cryptauth::RemoteDevice& remote_device);
-
- // Records a ConnectTetheringResponse. This function should be called each
- // time that a response is received from a host.
- virtual void RecordSuccessfulConnectTetheringResponse(
- const cryptauth::RemoteDevice& remote_device);
-
// Prioritizes |remote_devices| using the rules described above.
virtual void SortByHostScanOrder(
std::vector<cryptauth::RemoteDevice>* remote_devices) const;
private:
- PrefService* pref_service_;
+ TetherHostResponseRecorder* tether_host_response_recorder_;
DISALLOW_COPY_AND_ASSIGN(HostScanDevicePrioritizer);
};

Powered by Google App Engine
This is Rietveld 408576698