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

Side by Side Diff: components/metrics/metrics_log.cc

Issue 502173002: Move more metrics classes to metrics namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test compile. Created 6 years, 3 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 | « components/metrics/metrics_log.h ('k') | components/metrics/metrics_reporting_scheduler.h » ('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 #include "components/metrics/metrics_log.h" 5 #include "components/metrics/metrics_log.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 25 matching lines...) Expand all
36 #endif 36 #endif
37 37
38 #if defined(OS_WIN) 38 #if defined(OS_WIN)
39 #include "base/win/metro.h" 39 #include "base/win/metro.h"
40 40
41 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx 41 // http://blogs.msdn.com/oldnewthing/archive/2004/10/25/247180.aspx
42 extern "C" IMAGE_DOS_HEADER __ImageBase; 42 extern "C" IMAGE_DOS_HEADER __ImageBase;
43 #endif 43 #endif
44 44
45 using base::SampleCountIterator; 45 using base::SampleCountIterator;
46 using metrics::HistogramEventProto;
47 using metrics::ProfilerEventProto;
48 using metrics::SystemProfileProto;
49 using metrics::UserActionEventProto;
50 typedef variations::ActiveGroupId ActiveGroupId; 46 typedef variations::ActiveGroupId ActiveGroupId;
51 47
48 namespace metrics {
49
52 namespace { 50 namespace {
53 51
54 // Any id less than 16 bytes is considered to be a testing id. 52 // Any id less than 16 bytes is considered to be a testing id.
55 bool IsTestingID(const std::string& id) { 53 bool IsTestingID(const std::string& id) {
56 return id.size() < 16; 54 return id.size() < 16;
57 } 55 }
58 56
59 // Returns the date at which the current metrics client ID was created as 57 // Returns the date at which the current metrics client ID was created as
60 // a string containing seconds since the epoch, or "0" if none was found. 58 // a string containing seconds since the epoch, or "0" if none was found.
61 std::string GetMetricsEnabledDate(PrefService* pref) { 59 std::string GetMetricsEnabledDate(PrefService* pref) {
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 426
429 void MetricsLog::CloseLog() { 427 void MetricsLog::CloseLog() {
430 DCHECK(!closed_); 428 DCHECK(!closed_);
431 closed_ = true; 429 closed_ = true;
432 } 430 }
433 431
434 void MetricsLog::GetEncodedLog(std::string* encoded_log) { 432 void MetricsLog::GetEncodedLog(std::string* encoded_log) {
435 DCHECK(closed_); 433 DCHECK(closed_);
436 uma_proto_.SerializeToString(encoded_log); 434 uma_proto_.SerializeToString(encoded_log);
437 } 435 }
436
437 } // namespace metrics
OLDNEW
« no previous file with comments | « components/metrics/metrics_log.h ('k') | components/metrics/metrics_reporting_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698