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

Side by Side Diff: base/android/record_histogram.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 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
« no previous file with comments | « base/android/java_handler_thread.h ('k') | base/base_paths_posix.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 "base/android/record_histogram.h" 5 #include "base/android/record_histogram.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 const JavaParamRef<jclass>& clazz, 307 const JavaParamRef<jclass>& clazz,
308 const JavaParamRef<jstring>& histogram_name, 308 const JavaParamRef<jstring>& histogram_name,
309 jint sample) { 309 jint sample) {
310 HistogramBase* histogram = StatisticsRecorder::FindHistogram( 310 HistogramBase* histogram = StatisticsRecorder::FindHistogram(
311 android::ConvertJavaStringToUTF8(env, histogram_name)); 311 android::ConvertJavaStringToUTF8(env, histogram_name));
312 if (histogram == nullptr) { 312 if (histogram == nullptr) {
313 // No samples have been recorded for this histogram (yet?). 313 // No samples have been recorded for this histogram (yet?).
314 return 0; 314 return 0;
315 } 315 }
316 316
317 scoped_ptr<HistogramSamples> samples = histogram->SnapshotSamples(); 317 std::unique_ptr<HistogramSamples> samples = histogram->SnapshotSamples();
318 return samples->GetCount(static_cast<int>(sample)); 318 return samples->GetCount(static_cast<int>(sample));
319 } 319 }
320 320
321 bool RegisterRecordHistogram(JNIEnv* env) { 321 bool RegisterRecordHistogram(JNIEnv* env) {
322 return RegisterNativesImpl(env); 322 return RegisterNativesImpl(env);
323 } 323 }
324 324
325 } // namespace android 325 } // namespace android
326 } // namespace base 326 } // namespace base
OLDNEW
« no previous file with comments | « base/android/java_handler_thread.h ('k') | base/base_paths_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698