| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_EVENT_CREATOR_H_ | 5 #ifndef NET_NQE_EVENT_CREATOR_H_ |
| 6 #define NET_NQE_EVENT_CREATOR_H_ | 6 #define NET_NQE_EVENT_CREATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 namespace internal { | 24 namespace internal { |
| 25 | 25 |
| 26 // Class that adds net log events for network quality estimator. | 26 // Class that adds net log events for network quality estimator. |
| 27 class NET_EXPORT_PRIVATE EventCreator { | 27 class NET_EXPORT_PRIVATE EventCreator { |
| 28 public: | 28 public: |
| 29 explicit EventCreator(NetLogWithSource net_log); | 29 explicit EventCreator(NetLogWithSource net_log); |
| 30 ~EventCreator(); | 30 ~EventCreator(); |
| 31 | 31 |
| 32 // May add network quality changed event to the net-internals log if there | 32 // May add network quality changed event to the net-internals log if there |
| 33 // is a change in the effective connection type, or if there is a change in | 33 // is a change in the effective connection type, or if there is a meaningful |
| 34 // the availability of HTTP RTT, transport RTT or bandwidth. | 34 // change in the values of HTTP RTT, transport RTT or bandwidth. |
| 35 // |effective_connection_type| is the current effective connection type. | 35 // |effective_connection_type| is the current effective connection type. |
| 36 // |network_quality| is the current network quality. | 36 // |network_quality| is the current network quality. |
| 37 void MaybeAddEffectiveConnectionTypeChangedEventToNetLog( | 37 void MaybeAddNetworkQualityChangedEventToNetLog( |
| 38 EffectiveConnectionType effective_connection_type, | 38 EffectiveConnectionType effective_connection_type, |
| 39 const NetworkQuality& network_quality); | 39 const NetworkQuality& network_quality); |
| 40 | 40 |
| 41 private: | 41 private: |
| 42 NetLogWithSource net_log_; | 42 NetLogWithSource net_log_; |
| 43 | 43 |
| 44 // The effective connection type when the net log event was last added. | 44 // The effective connection type when the net log event was last added. |
| 45 EffectiveConnectionType past_effective_connection_type_; | 45 EffectiveConnectionType past_effective_connection_type_; |
| 46 | 46 |
| 47 // The network quality when the net log event was last added. | 47 // The network quality when the net log event was last added. |
| 48 NetworkQuality past_network_quality_; | 48 NetworkQuality past_network_quality_; |
| 49 | 49 |
| 50 base::ThreadChecker thread_checker_; | 50 base::ThreadChecker thread_checker_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(EventCreator); | 52 DISALLOW_COPY_AND_ASSIGN(EventCreator); |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 } // namespace internal | 55 } // namespace internal |
| 56 | 56 |
| 57 } // namespace nqe | 57 } // namespace nqe |
| 58 | 58 |
| 59 } // namespace net | 59 } // namespace net |
| 60 | 60 |
| 61 #endif // NET_NQE_EVENT_CREATOR_H_ | 61 #endif // NET_NQE_EVENT_CREATOR_H_ |
| OLD | NEW |