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

Side by Side Diff: components/metrics/export/useraction_sample.cc

Issue 227873002: Create a histogram serialization mechanism in components/metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Running tests only for chromeos. Created 6 years, 8 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
OLDNEW
(Empty)
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.
4
5 #include "components/metrics/export/useraction_sample.h"
6
7 #include <string>
8
9 #include "base/strings/stringprintf.h"
10 #include "components/metrics/export/metric_sample.h"
11
12 using base::StringPrintf;
13 using std::string;
14
15 namespace metrics {
16
17 UserActionSample::UserActionSample(const std::string& action_name)
18 : MetricSample(MetricSample::USER_ACTION, action_name) {}
19
20 UserActionSample::~UserActionSample() {}
21
22 string UserActionSample::ToString() const {
23 return StringPrintf("useraction%c%s%c", '\0', name().c_str(), '\0');
24 }
25
26 // static
27 UserActionSample* UserActionSample::ReadUserAction(const std::string& action) {
28 return new UserActionSample(action);
Alexei Svitkine (slow) 2014/04/30 15:25:24 I believe the best practice for APIs that transfer
bsimonnet 2014/04/30 20:28:40 Done.
bsimonnet 2014/04/30 20:28:40 Yes, it is probably much cleaner.
29 }
30
31 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698