• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2019 The Chromium Authors
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 "base/android/java_heap_dump_generator.h"
6 
7 #include <jni.h>
8 
9 #include "base/android/jni_string.h"
10 #include "base/base_jni_headers/JavaHeapDumpGenerator_jni.h"
11 
12 namespace base {
13 namespace android {
14 
WriteJavaHeapDumpToPath(base::StringPiece filePath)15 bool WriteJavaHeapDumpToPath(base::StringPiece filePath) {
16   JNIEnv* env = AttachCurrentThread();
17   return Java_JavaHeapDumpGenerator_generateHprof(
18       env, base::android::ConvertUTF8ToJavaString(env, filePath));
19 }
20 
21 }  // namespace android
22 }  // namespace base
23