[Password Generation] Don't generate passwords for custom passphrase users.
[chromium-blink-merge.git] / base / test / statistics_delta_reader.h
blob4921d61d076a8ca68a40bf625574d69f41e12f7c
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_TEST_STATISTICS_DELTA_READER_H_
6 #define BASE_TEST_STATISTICS_DELTA_READER_H_
8 #include <map>
9 #include <string>
11 #include "base/basictypes.h"
12 #include "base/memory/scoped_ptr.h"
14 namespace base {
16 class HistogramSamples;
18 // This class acts as a differential reader for histogram samples, enabling
19 // tests to check that metrics were recorded as they should be.
20 class StatisticsDeltaReader {
21 public:
22 StatisticsDeltaReader();
23 ~StatisticsDeltaReader();
25 // Returns the histogram data accumulated since this instance was created.
26 // Returns NULL if no samples are available.
27 scoped_ptr<HistogramSamples> GetHistogramSamplesSinceCreation(
28 const std::string& histogram_name);
30 private:
31 // Used to determine the histogram changes made during this instance's
32 // lifecycle. This instance takes ownership of the samples, which are deleted
33 // when the instance is destroyed.
34 std::map<std::string, HistogramSamples*> original_samples_;
36 DISALLOW_COPY_AND_ASSIGN(StatisticsDeltaReader);
39 } // namespace base
41 #endif // BASE_TEST_STATISTICS_DELTA_READER_H_