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

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: Test Created 4 years, 5 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
« no previous file with comments | « net/net.gypi ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 470
471 // Notify observers of a change in effective connection type. 471 // Notify observers of a change in effective connection type.
472 void NotifyObserversOfEffectiveConnectionTypeChanged(); 472 void NotifyObserversOfEffectiveConnectionTypeChanged();
473 473
474 // Records NQE accuracy metrics. |measuring_duration| should belong to the 474 // Records NQE accuracy metrics. |measuring_duration| should belong to the
475 // vector returned by AccuracyRecordingIntervals(). 475 // vector returned by AccuracyRecordingIntervals().
476 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a 476 // RecordAccuracyAfterMainFrame should be called |measuring_duration| after a
477 // main frame request is observed. 477 // main frame request is observed.
478 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const; 478 void RecordAccuracyAfterMainFrame(base::TimeDelta measuring_duration) const;
479 479
480 // Obtains the current cellular signal strength value and updates
481 // |min_signal_strength_since_connection_change_| and
482 // |max_signal_strength_since_connection_change_|.
483 void UpdateSignalStrength();
484
480 // Returns the effective type of the current connection based on only the 485 // Returns the effective type of the current connection based on only the
481 // samples observed after |start_time|. Uses HTTP RTT and downstream 486 // samples observed after |start_time|. Uses HTTP RTT and downstream
482 // throughput to compute the effective connection type, and requires both of 487 // throughput to compute the effective connection type, and requires both of
483 // them to have a valid value. 488 // them to have a valid value.
484 EffectiveConnectionType 489 EffectiveConnectionType
485 GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput( 490 GetRecentEffectiveConnectionTypeHttpRTTAndDownstreamThroughput(
486 const base::TimeTicks& start_time) const; 491 const base::TimeTicks& start_time) const;
487 492
488 // Values of external estimate provider status. This enum must remain 493 // Values of external estimate provider status. This enum must remain
489 // synchronized with the enum of the same name in 494 // synchronized with the enum of the same name in
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 // |downstream_throughput_kbps_observations_|, which are later used for 604 // |downstream_throughput_kbps_observations_|, which are later used for
600 // estimating the throughput. 605 // estimating the throughput.
601 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_; 606 std::unique_ptr<nqe::internal::ThroughputAnalyzer> throughput_analyzer_;
602 607
603 // Current effective connection type. It is updated on connection change 608 // Current effective connection type. It is updated on connection change
604 // events. It is also updated every time there is network traffic (provided 609 // events. It is also updated every time there is network traffic (provided
605 // the last computation was more than 610 // the last computation was more than
606 // |effective_connection_type_recomputation_interval_| ago). 611 // |effective_connection_type_recomputation_interval_| ago).
607 EffectiveConnectionType effective_connection_type_; 612 EffectiveConnectionType effective_connection_type_;
608 613
614 // Minimum and Maximum signal strength (in dbM) observed since last connection
615 // change. Updated on connection change and main frame requests.
616 int32_t min_signal_strength_since_connection_change_;
617 int32_t max_signal_strength_since_connection_change_;
618
609 base::ThreadChecker thread_checker_; 619 base::ThreadChecker thread_checker_;
610 620
611 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 621 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
612 622
613 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 623 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
614 }; 624 };
615 625
616 } // namespace net 626 } // namespace net
617 627
618 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 628 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW
« no previous file with comments | « net/net.gypi ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698