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

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

Issue 2731333003: Record UMA only when network quality is eligible for caching (Closed)
Patch Set: rebase, ryansturm comment Created 3 years, 9 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/nqe/network_quality_estimator_unittest.cc ('k') | net/nqe/network_quality_store.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_STORE_H_ 5 #ifndef NET_NQE_NETWORK_QUALITY_STORE_H_
6 #define NET_NQE_NETWORK_QUALITY_STORE_H_ 6 #define NET_NQE_NETWORK_QUALITY_STORE_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 nqe::internal::CachedNetworkQuality* cached_network_quality); 60 nqe::internal::CachedNetworkQuality* cached_network_quality);
61 61
62 // Adds and removes |observer| from the list of cache observers. The 62 // Adds and removes |observer| from the list of cache observers. The
63 // observers are notified on the same thread on which it was added. Addition 63 // observers are notified on the same thread on which it was added. Addition
64 // and removal of the observer must happen on the same thread. 64 // and removal of the observer must happen on the same thread.
65 void AddNetworkQualitiesCacheObserver( 65 void AddNetworkQualitiesCacheObserver(
66 NetworkQualitiesCacheObserver* observer); 66 NetworkQualitiesCacheObserver* observer);
67 void RemoveNetworkQualitiesCacheObserver( 67 void RemoveNetworkQualitiesCacheObserver(
68 NetworkQualitiesCacheObserver* observer); 68 NetworkQualitiesCacheObserver* observer);
69 69
70 // Returns true if network quality for |network_id| can be cached.
71 bool EligibleForCaching(const NetworkID& network_id) const;
72
70 // If |disable_offline_check| is set to true, the offline check is disabled 73 // If |disable_offline_check| is set to true, the offline check is disabled
71 // when storing the network quality. 74 // when storing the network quality.
72 void DisableOfflineCheckForTesting(bool disable_offline_check); 75 void DisableOfflineCheckForTesting(bool disable_offline_check);
73 76
74 private: 77 private:
75 // Maximum size of the store that holds network quality estimates. 78 // Maximum size of the store that holds network quality estimates.
76 // A smaller size may reduce the cache hit rate due to frequent evictions. 79 // A smaller size may reduce the cache hit rate due to frequent evictions.
77 // A larger size may affect performance. 80 // A larger size may affect performance.
78 static const size_t kMaximumNetworkQualityCacheSize = 10; 81 static const size_t kMaximumNetworkQualityCacheSize = 10;
79 82
(...skipping 27 matching lines...) Expand all
107 DISALLOW_COPY_AND_ASSIGN(NetworkQualityStore); 110 DISALLOW_COPY_AND_ASSIGN(NetworkQualityStore);
108 }; 111 };
109 112
110 } // namespace internal 113 } // namespace internal
111 114
112 } // namespace nqe 115 } // namespace nqe
113 116
114 } // namespace net 117 } // namespace net
115 118
116 #endif // NET_NQE_NETWORK_QUALITY_STORE_H_ 119 #endif // NET_NQE_NETWORK_QUALITY_STORE_H_
OLDNEW
« no previous file with comments | « net/nqe/network_quality_estimator_unittest.cc ('k') | net/nqe/network_quality_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698