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

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

Issue 2763853002: Use Android callback API to obtain cellular signal strength (Closed)
Patch Set: comments Created 3 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
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 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 602
603 // Current estimate of the network quality. 603 // Current estimate of the network quality.
604 nqe::internal::NetworkQuality network_quality_; 604 nqe::internal::NetworkQuality network_quality_;
605 605
606 // Current effective connection type. It is updated on connection change 606 // Current effective connection type. It is updated on connection change
607 // events. It is also updated every time there is network traffic (provided 607 // events. It is also updated every time there is network traffic (provided
608 // the last computation was more than 608 // the last computation was more than
609 // |effective_connection_type_recomputation_interval_| ago). 609 // |effective_connection_type_recomputation_interval_| ago).
610 EffectiveConnectionType effective_connection_type_; 610 EffectiveConnectionType effective_connection_type_;
611 611
612 // Last known value of the wireless signal strength. Set to INT32_MIN if 612 // Last known value of the wireless signal strength level. If the signal
613 // unavailable. |signal_strength_dbm_| is reset to INT32_MIN on connection 613 // strength level is available, the value is set to between 0 and 4, both
614 // change events. 614 // inclusive. If the value is unavailable, |signal_strength_| has null value.
615 int32_t signal_strength_dbm_; 615 base::Optional<int32_t> signal_strength_;
616 616
617 // Minimum and maximum signal strength (in dBm) observed since last connection 617 // Minimum and maximum signal strength level observed since last connection
618 // change. Updated on connection change and main frame requests. 618 // change. Updated on connection change and main frame requests.
619 int32_t min_signal_strength_since_connection_change_; 619 base::Optional<int32_t> min_signal_strength_since_connection_change_;
620 int32_t max_signal_strength_since_connection_change_; 620 base::Optional<int32_t> max_signal_strength_since_connection_change_;
621 621
622 // Stores the qualities of different networks. 622 // Stores the qualities of different networks.
623 std::unique_ptr<nqe::internal::NetworkQualityStore> network_quality_store_; 623 std::unique_ptr<nqe::internal::NetworkQualityStore> network_quality_store_;
624 624
625 base::ThreadChecker thread_checker_; 625 base::ThreadChecker thread_checker_;
626 626
627 // Manages the writing of events to the net log. 627 // Manages the writing of events to the net log.
628 nqe::internal::EventCreator event_creator_; 628 nqe::internal::EventCreator event_creator_;
629 629
630 // Vector that contains observation sources that should not be used when 630 // Vector that contains observation sources that should not be used when
631 // computing the estimate at HTTP layer. 631 // computing the estimate at HTTP layer.
632 const std::vector<NetworkQualityObservationSource> 632 const std::vector<NetworkQualityObservationSource>
633 disallowed_observation_sources_for_http_; 633 disallowed_observation_sources_for_http_;
634 634
635 // Vector that contains observation sources that should not be used when 635 // Vector that contains observation sources that should not be used when
636 // computing the estimate at transport layer. 636 // computing the estimate at transport layer.
637 const std::vector<NetworkQualityObservationSource> 637 const std::vector<NetworkQualityObservationSource>
638 disallowed_observation_sources_for_transport_; 638 disallowed_observation_sources_for_transport_;
639 639
640 NetLogWithSource net_log_; 640 NetLogWithSource net_log_;
641 641
642 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_; 642 base::WeakPtrFactory<NetworkQualityEstimator> weak_ptr_factory_;
643 643
644 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator); 644 DISALLOW_COPY_AND_ASSIGN(NetworkQualityEstimator);
645 }; 645 };
646 646
647 } // namespace net 647 } // namespace net
648 648
649 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_ 649 #endif // NET_NQE_NETWORK_QUALITY_ESTIMATOR_H_
OLDNEW
« no previous file with comments | « net/android/java/src/org/chromium/net/AndroidCellularSignalStrength.java ('k') | net/nqe/network_quality_estimator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698