Correctly track texture cleared state for sharing
[chromium-blink-merge.git] / components / cronet / android / histogram_manager.cc
blob5ad7bb8f4b863415a3d6adc0c12478ea3434ed93
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.
5 #include "components/cronet/android/histogram_manager.h"
7 #include <string>
8 #include <vector>
10 #include "base/android/jni_array.h"
11 #include "components/metrics/histogram_manager.h"
13 #include "jni/HistogramManager_jni.h"
15 namespace cronet {
17 // Explicitly register static JNI functions.
18 bool HistogramManagerRegisterJni(JNIEnv* env) {
19 return RegisterNativesImpl(env);
22 static jbyteArray GetHistogramDeltas(JNIEnv* env, jobject jcaller) {
23 std::vector<uint8> data;
24 if (!metrics::HistogramManager::GetInstance()->GetDeltas(&data))
25 return NULL;
26 return base::android::ToJavaByteArray(env, &data[0], data.size()).Release();
29 } // namespace cronet