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

Side by Side Diff: net/nqe/network_quality_estimator.h

Issue 1879743002: Expose cellular signal strength on Android to native (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Paul's comments Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 5 #ifndef NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 6 #define NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 436
437 // Notify observers of a change in effective connection type. 437 // Notify observers of a change in effective connection type.
438 void NotifyObserversOfEffectiveConnectionTypeChanged(); 438 void NotifyObserversOfEffectiveConnectionTypeChanged();
439 439
440 // Records NQE accuracy metrics. |measuring_duration| should belong to the 440 // Records NQE accuracy metrics. |measuring_duration| should belong to the
441 // vector returned by AccuracyRecordingIntervals(). 441 // vector returned by AccuracyRecordingIntervals().
442 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a 442 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a
443 // main frame request is observed. 443 // main frame request is observed.
444 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const; 444 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const;
445 445
446 // Obtains the current cellular RSSI value and updates
447 // |min_rssi_since_connection_change_| and
448 // |max_rssi_since_connection_change_|.
449 void UpdateSignalStrength();
450
446 // Values of external estimate provider status. This enum must remain 451 // Values of external estimate provider status. This enum must remain
447 // synchronized with the enum of the same name in 452 // synchronized with the enum of the same name in
448 // metrics/histograms/histograms.xml. 453 // metrics/histograms/histograms.xml.
449 enum NQEExternalEstimateProviderStatus { 454 enum NQEExternalEstimateProviderStatus {
450 EXTERNAL_ESTIMATE_PROVIDER_STATUS_NOT_AVAILABLE, 455 EXTERNAL_ESTIMATE_PROVIDER_STATUS_NOT_AVAILABLE,
451 EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE, 456 EXTERNAL_ESTIMATE_PROVIDER_STATUS_AVAILABLE,
452 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED, 457 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERIED,
453 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL, 458 EXTERNAL_ESTIMATE_PROVIDER_STATUS_QUERY_SUCCESSFUL,
454 EXTERNAL_ESTIMATE_PROVIDER_STATUS_CALLBACK, 459 EXTERNAL_ESTIMATE_PROVIDER_STATUS_CALLBACK,
455 EXTERNAL_ESTIMATE_PROVIDER_STATUS_RTT_AVAILABLE, 460 EXTERNAL_ESTIMATE_PROVIDER_STATUS_RTT_AVAILABLE,
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 // |downstream_throughput_kbps_observations_|, which are later used for 555 // |downstream_throughput_kbps_observations_|, which are later used for
551 // estimating the throughput. 556 // estimating the throughput.
552 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_; 557 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_;
553 558
554 // Current effective connection type. It is updated on connection change 559 // Current effective connection type. It is updated on connection change
555 // events. It is also updated every time there is network traffic (provided 560 // events. It is also updated every time there is network traffic (provided
556 // the last computation was more than 561 // the last computation was more than
557 // |effective_connection_type_recomputation_interval_| ago). 562 // |effective_connection_type_recomputation_interval_| ago).
558 EffectiveConnectionType effective_connection_type_; 563 EffectiveConnectionType effective_connection_type_;
559 564
565 // Minimum and Maximum RSSI observed since last connection change. Updated
566 // on connection change and main frame requests.
567 int32_t min_rssi_since_connection_change_;
568 int32_t max_rssi_since_connection_change_;
569
560 base::ThreadChecker thread_checker_; 570 base::ThreadChecker thread_checker_;
561 571
562 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 572 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
563 573
564 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 574 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
565 }; 575 };
566 576
567 } // namespace net 577 } // namespace net
568 578
569 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 579 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698