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

Unified Diff: net/nqe/observation_buffer.h

Issue 2889273003: Fix some non-const ref function argument types. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | net/quic/chromium/quic_stream_factory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/nqe/observation_buffer.h
diff --git a/net/nqe/observation_buffer.h b/net/nqe/observation_buffer.h
index 10f600991121c2aff857cab658b80888be6bf710..3fcb9cf70839bc71ebb29db00c087076e27c7e37 100644
--- a/net/nqe/observation_buffer.h
+++ b/net/nqe/observation_buffer.h
@@ -94,7 +94,7 @@ class NET_EXPORT_PRIVATE ObservationBuffer {
double total_weight = 0.0;
ComputeWeightedObservations(begin_timestamp, current_signal_strength_dbm,
- weighted_observations, &total_weight,
+ &weighted_observations, &total_weight,
disallowed_observation_sources);
if (weighted_observations.empty())
return false;
@@ -139,7 +139,7 @@ class NET_EXPORT_PRIVATE ObservationBuffer {
double total_weight = 0.0;
ComputeWeightedObservations(begin_timestamp, current_signal_strength_dbm,
- weighted_observations, &total_weight,
+ &weighted_observations, &total_weight,
disallowed_observation_sources);
if (weighted_observations.empty())
return false;
@@ -176,7 +176,7 @@ class NET_EXPORT_PRIVATE ObservationBuffer {
double total_weight = 0.0;
ComputeWeightedObservations(begin_timestamp, current_signal_strength_dbm,
- weighted_observations, &total_weight,
+ &weighted_observations, &total_weight,
disallowed_observation_sources);
if (weighted_observations.empty())
return false;
@@ -226,13 +226,13 @@ class NET_EXPORT_PRIVATE ObservationBuffer {
void ComputeWeightedObservations(
const base::TimeTicks& begin_timestamp,
int32_t current_signal_strength_dbm,
- std::vector<WeightedObservation<ValueType>>& weighted_observations,
+ std::vector<WeightedObservation<ValueType>>* weighted_observations,
double* total_weight,
const std::vector<NetworkQualityObservationSource>&
disallowed_observation_sources) const {
DCHECK_GE(Capacity(), Size());
- weighted_observations.clear();
+ weighted_observations->clear();
double total_weight_observations = 0.0;
base::TimeTicks now = tick_clock_->NowTicks();
@@ -265,22 +265,22 @@ class NET_EXPORT_PRIVATE ObservationBuffer {
weight = std::max(DBL_MIN, std::min(1.0, weight));
- weighted_observations.push_back(
+ weighted_observations->push_back(
WeightedObservation<ValueType>(observation.value, weight));
total_weight_observations += weight;
}
// Sort the samples by value in ascending order.
- std::sort(weighted_observations.begin(), weighted_observations.end());
+ std::sort(weighted_observations->begin(), weighted_observations->end());
*total_weight = total_weight_observations;
DCHECK_LE(0.0, *total_weight);
- DCHECK(weighted_observations.empty() || 0.0 < *total_weight);
+ DCHECK(weighted_observations->empty() || 0.0 < *total_weight);
// |weighted_observations| may have a smaller size than |observations_|
// since the former contains only the observations later than
// |begin_timestamp|.
- DCHECK_GE(observations_.size(), weighted_observations.size());
+ DCHECK_GE(observations_.size(), weighted_observations->size());
}
// Holds observations sorted by time, with the oldest observation at the
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | net/quic/chromium/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698