OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chromecast/base/android/dumpstate_writer.h" | 5 #include "chromecast/base/android/dumpstate_writer.h" |
6 | 6 |
7 #include "base/android/jni_android.h" | 7 #include "base/android/jni_android.h" |
8 #include "base/android/jni_string.h" | 8 #include "base/android/jni_string.h" |
9 #include "jni/DumpstateWriter_jni.h" | 9 #include "jni/DumpstateWriter_jni.h" |
10 | 10 |
11 namespace chromecast { | 11 namespace chromecast { |
12 | 12 |
13 // static | 13 // static |
14 bool DumpstateWriter::RegisterJni(JNIEnv* env) { | |
15 return RegisterNativesImpl(env); | |
16 } | |
17 | |
18 // static | |
19 void DumpstateWriter::AddDumpValue(const std::string& name, | 14 void DumpstateWriter::AddDumpValue(const std::string& name, |
20 const std::string& value) { | 15 const std::string& value) { |
21 JNIEnv* env = base::android::AttachCurrentThread(); | 16 JNIEnv* env = base::android::AttachCurrentThread(); |
22 Java_DumpstateWriter_addDumpValue( | 17 Java_DumpstateWriter_addDumpValue( |
23 env, | 18 env, |
24 base::android::ConvertUTF8ToJavaString(env, name).obj(), | 19 base::android::ConvertUTF8ToJavaString(env, name).obj(), |
25 base::android::ConvertUTF8ToJavaString(env, value).obj()); | 20 base::android::ConvertUTF8ToJavaString(env, value).obj()); |
26 } | 21 } |
27 | 22 |
28 } // namespace chromecast | 23 } // namespace chromecast |
OLD | NEW |