1*6777b538SAndroid Build Coastguard Worker // Copyright 2014 The Chromium Authors 2*6777b538SAndroid Build Coastguard Worker // Use of this source code is governed by a BSD-style license that can be 3*6777b538SAndroid Build Coastguard Worker // found in the LICENSE file. 4*6777b538SAndroid Build Coastguard Worker 5*6777b538SAndroid Build Coastguard Worker // This file defines an utility function that records any changes in a given 6*6777b538SAndroid Build Coastguard Worker // histogram for transmission. 7*6777b538SAndroid Build Coastguard Worker 8*6777b538SAndroid Build Coastguard Worker #ifndef COMPONENTS_METRICS_HISTOGRAM_ENCODER_H_ 9*6777b538SAndroid Build Coastguard Worker #define COMPONENTS_METRICS_HISTOGRAM_ENCODER_H_ 10*6777b538SAndroid Build Coastguard Worker 11*6777b538SAndroid Build Coastguard Worker #include <string> 12*6777b538SAndroid Build Coastguard Worker 13*6777b538SAndroid Build Coastguard Worker #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h" 14*6777b538SAndroid Build Coastguard Worker 15*6777b538SAndroid Build Coastguard Worker namespace base { 16*6777b538SAndroid Build Coastguard Worker class HistogramSamples; 17*6777b538SAndroid Build Coastguard Worker } 18*6777b538SAndroid Build Coastguard Worker 19*6777b538SAndroid Build Coastguard Worker namespace metrics { 20*6777b538SAndroid Build Coastguard Worker 21*6777b538SAndroid Build Coastguard Worker // Record any changes (histogram deltas of counts from |snapshot|) into 22*6777b538SAndroid Build Coastguard Worker // |uma_proto| for the given histogram (|histogram_name|). 23*6777b538SAndroid Build Coastguard Worker void EncodeHistogramDelta(const std::string& histogram_name, 24*6777b538SAndroid Build Coastguard Worker const base::HistogramSamples& snapshot, 25*6777b538SAndroid Build Coastguard Worker ChromeUserMetricsExtension* uma_proto); 26*6777b538SAndroid Build Coastguard Worker 27*6777b538SAndroid Build Coastguard Worker } // namespace metrics 28*6777b538SAndroid Build Coastguard Worker 29*6777b538SAndroid Build Coastguard Worker #endif // COMPONENTS_METRICS_HISTOGRAM_ENCODER_H_ 30