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 "chrome/browser/android/history_report/history_report_jni_bridge.h" | 5 #include "chrome/browser/android/history_report/history_report_jni_bridge.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 21 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
23 #include "chrome/browser/history/history_service_factory.h" | 23 #include "chrome/browser/history/history_service_factory.h" |
24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/profiles/profile_manager.h" | 25 #include "chrome/browser/profiles/profile_manager.h" |
26 #include "components/bookmarks/browser/bookmark_model.h" | 26 #include "components/bookmarks/browser/bookmark_model.h" |
27 #include "components/history/core/browser/history_service.h" | 27 #include "components/history/core/browser/history_service.h" |
28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
29 #include "jni/HistoryReportJniBridge_jni.h" | 29 #include "jni/HistoryReportJniBridge_jni.h" |
30 | 30 |
| 31 using base::android::JavaParamRef; |
| 32 using base::android::ScopedJavaLocalRef; |
| 33 |
31 namespace history_report { | 34 namespace history_report { |
32 | 35 |
33 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 36 static jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
34 HistoryReportJniBridge* bridge = new HistoryReportJniBridge(env, obj); | 37 HistoryReportJniBridge* bridge = new HistoryReportJniBridge(env, obj); |
35 return reinterpret_cast<intptr_t>(bridge); | 38 return reinterpret_cast<intptr_t>(bridge); |
36 } | 39 } |
37 | 40 |
38 bool RegisterHistoryReportJniBridge(JNIEnv* env) { | 41 bool RegisterHistoryReportJniBridge(JNIEnv* env) { |
39 return RegisterNativesImpl(env); | 42 return RegisterNativesImpl(env); |
40 } | 43 } |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 base::android::ScopedJavaLocalRef<jstring> HistoryReportJniBridge::Dump( | 192 base::android::ScopedJavaLocalRef<jstring> HistoryReportJniBridge::Dump( |
190 JNIEnv* env, | 193 JNIEnv* env, |
191 const JavaParamRef<jobject>& obj) { | 194 const JavaParamRef<jobject>& obj) { |
192 std::string dump; | 195 std::string dump; |
193 dump.append(delta_file_service_->Dump()); | 196 dump.append(delta_file_service_->Dump()); |
194 dump.append(usage_reports_buffer_service_->Dump()); | 197 dump.append(usage_reports_buffer_service_->Dump()); |
195 return base::android::ConvertUTF8ToJavaString(env, dump); | 198 return base::android::ConvertUTF8ToJavaString(env, dump); |
196 } | 199 } |
197 | 200 |
198 } // namespace history_report | 201 } // namespace history_report |
OLD | NEW |