OLD | NEW |
---|---|
(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 | |
OLD | NEW |