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

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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 459
460 // Notify observers of a change in effective connection type. 460 // Notify observers of a change in effective connection type.
461 void NotifyObserversOfEffectiveConnectionTypeChanged(); 461 void NotifyObserversOfEffectiveConnectionTypeChanged();
462 462
463 // Records NQE accuracy metrics. |measuring_duration| should belong to the 463 // Records NQE accuracy metrics. |measuring_duration| should belong to the
464 // vector returned by AccuracyRecordingIntervals(). 464 // vector returned by AccuracyRecordingIntervals().
465 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a 465 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a
466 // main frame request is observed. 466 // main frame request is observed.
467 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const; 467 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const;
468 468
469 // Obtains the current cellular RSSI value and updates
bengr 2016/06/27 01:36:22 I would avoid using the term RSSI.
tbansal1 2016/06/27 19:01:17 Done.
470 // |min_signal_strength_since_connection_change_| and
471 // |max_signal_strength_since_connection_change_|.
472 void UpdateSignalStrength();
473
469 // Returns the effective type of the current connection based on only the 474 // Returns the effective type of the current connection based on only the
470 // samples observed after |start_time|. Uses HTTP RTT and downstream 475 // samples observed after |start_time|. Uses HTTP RTT and downstream
471 // throughput to compute the effective connection type, and requires both of 476 // throughput to compute the effective connection type, and requires both of
472 // them to have a valid value. 477 // them to have a valid value.
473 EffectiveConnectionType 478 EffectiveConnectionType
474 GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput( 479 GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput(
475 const base::TimeTicks& start_time) const; 480 const base::TimeTicks& start_time) const;
476 481
477 // Values of external estimate provider status. This enum must remain 482 // Values of external estimate provider status. This enum must remain
478 // synchronized with the enum of the same name in 483 // synchronized with the enum of the same name in
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 // |downstream_throughput_kbps_observations_|, which are later used for 592 // |downstream_throughput_kbps_observations_|, which are later used for
588 // estimating the throughput. 593 // estimating the throughput.
589 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_; 594 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_;
590 595
591 // Current effective connection type. It is updated on connection change 596 // Current effective connection type. It is updated on connection change
592 // events. It is also updated every time there is network traffic (provided 597 // events. It is also updated every time there is network traffic (provided
593 // the last computation was more than 598 // the last computation was more than
594 // |effective_connection_type_recomputation_interval_| ago). 599 // |effective_connection_type_recomputation_interval_| ago).
595 EffectiveConnectionType effective_connection_type_; 600 EffectiveConnectionType effective_connection_type_;
596 601
602 // Minimum and Maximum signal strength (in dbM) observed since last connection
603 // change. Updated on connection change and main frame requests.
604 int32_t min_signal_strength_since_connection_change_;
605 int32_t max_signal_strength_since_connection_change_;
606
597 base::ThreadChecker thread_checker_; 607 base::ThreadChecker thread_checker_;
598 608
599 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 609 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
600 610
601 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 611 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
602 }; 612 };
603 613
604 } // namespace net 614 } // namespace net
605 615
606 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 616 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698