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

Side by Side Diff: components/metrics/daily_event.h

Issue 2691803002: Remove ScopedVector in //component/metrics (Closed)
Patch Set: code rebase Created 3 years, 10 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 | « chromecast/browser/metrics/external_metrics.cc ('k') | components/metrics/daily_event.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 2014 The Chromium Authors. All rights reserved. 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 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 COMPONENTS_METRICS_DAILY_EVENT_H_ 5 #ifndef COMPONENTS_METRICS_DAILY_EVENT_H_
6 #define COMPONENTS_METRICS_DAILY_EVENT_H_ 6 #define COMPONENTS_METRICS_DAILY_EVENT_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <vector>
9 10
10 #include "base/macros.h" 11 #include "base/macros.h"
11 #include "base/memory/scoped_vector.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 13
14 class PrefRegistrySimple; 14 class PrefRegistrySimple;
15 class PrefService; 15 class PrefService;
16 16
17 namespace metrics { 17 namespace metrics {
18 18
19 // DailyEvent is used for throttling an event to about once per day, even if 19 // DailyEvent is used for throttling an event to about once per day, even if
20 // the program is restarted more frequently. It is based on local machine 20 // the program is restarted more frequently. It is based on local machine
21 // time, so it could be fired more often if the clock is changed. 21 // time, so it could be fired more often if the clock is changed.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 PrefService* pref_service_; 73 PrefService* pref_service_;
74 74
75 // The name of the preference to store the last fired time in. 75 // The name of the preference to store the last fired time in.
76 // Calling code should ensure this outlives the DailyEvent. 76 // Calling code should ensure this outlives the DailyEvent.
77 const char* pref_name_; 77 const char* pref_name_;
78 78
79 // The name of the histogram to record intervals. 79 // The name of the histogram to record intervals.
80 std::string histogram_name_; 80 std::string histogram_name_;
81 81
82 // A list of observers. 82 // A list of observers.
83 ScopedVector<Observer> observers_; 83 std::vector<std::unique_ptr<Observer>> observers_;
84 84
85 // The time that the daily event was last fired. 85 // The time that the daily event was last fired.
86 base::Time last_fired_; 86 base::Time last_fired_;
87 87
88 DISALLOW_COPY_AND_ASSIGN(DailyEvent); 88 DISALLOW_COPY_AND_ASSIGN(DailyEvent);
89 }; 89 };
90 90
91 } // namespace metrics 91 } // namespace metrics
92 92
93 #endif // COMPONENTS_METRICS_DAILY_EVENT_H_ 93 #endif // COMPONENTS_METRICS_DAILY_EVENT_H_
OLDNEW
« no previous file with comments | « chromecast/browser/metrics/external_metrics.cc ('k') | components/metrics/daily_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698