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

Side by Side Diff: components/cronet/histogram_manager.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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/cronet/histogram_manager.h ('k') | components/cronet/histogram_manager_unittest.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 #include "components/cronet/histogram_manager.h" 5 #include "components/cronet/histogram_manager.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 base::HistogramBase::Inconsistency problem) { 44 base::HistogramBase::Inconsistency problem) {
45 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique.Cronet", 45 UMA_HISTOGRAM_ENUMERATION("Histogram.InconsistenciesBrowserUnique.Cronet",
46 problem, base::HistogramBase::NEVER_EXCEEDED_VALUE); 46 problem, base::HistogramBase::NEVER_EXCEEDED_VALUE);
47 } 47 }
48 48
49 void HistogramManager::InconsistencyDetectedInLoggedCount(int amount) { 49 void HistogramManager::InconsistencyDetectedInLoggedCount(int amount) {
50 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser.Cronet", 50 UMA_HISTOGRAM_COUNTS("Histogram.InconsistentSnapshotBrowser.Cronet",
51 std::abs(amount)); 51 std::abs(amount));
52 } 52 }
53 53
54 bool HistogramManager::GetDeltas(std::vector<uint8>* data) { 54 bool HistogramManager::GetDeltas(std::vector<uint8_t>* data) {
55 // Clear the protobuf between calls. 55 // Clear the protobuf between calls.
56 uma_proto_.Clear(); 56 uma_proto_.Clear();
57 histogram_snapshot_manager_.PrepareDeltas( 57 histogram_snapshot_manager_.PrepareDeltas(
58 base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag); 58 base::Histogram::kNoFlags, base::Histogram::kUmaTargetedHistogramFlag);
59 int32_t data_size = uma_proto_.ByteSize(); 59 int32_t data_size = uma_proto_.ByteSize();
60 data->resize(data_size); 60 data->resize(data_size);
61 if (uma_proto_.SerializeToArray(&(*data)[0], data_size)) 61 if (uma_proto_.SerializeToArray(&(*data)[0], data_size))
62 return true; 62 return true;
63 data->clear(); 63 data->clear();
64 return false; 64 return false;
65 } 65 }
66 66
67 } // namespace cronet 67 } // namespace cronet
OLDNEW
« no previous file with comments | « components/cronet/histogram_manager.h ('k') | components/cronet/histogram_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698