OLD | NEW |
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 "chromecast/app/android/crash_handler.h" | 5 #include "chromecast/app/android/crash_handler.h" |
6 | 6 |
7 #include <jni.h> | 7 #include <jni.h> |
8 #include <stdlib.h> | 8 #include <stdlib.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 g_crash_handler->Initialize(); | 52 g_crash_handler->Initialize(); |
53 } | 53 } |
54 | 54 |
55 // static | 55 // static |
56 bool CrashHandler::GetCrashDumpLocation(base::FilePath* crash_dir) { | 56 bool CrashHandler::GetCrashDumpLocation(base::FilePath* crash_dir) { |
57 DCHECK(g_crash_handler); | 57 DCHECK(g_crash_handler); |
58 return g_crash_handler->crash_reporter_client_->GetCrashDumpLocation( | 58 return g_crash_handler->crash_reporter_client_->GetCrashDumpLocation( |
59 crash_dir); | 59 crash_dir); |
60 } | 60 } |
61 | 61 |
62 // static | |
63 bool CrashHandler::RegisterCastCrashJni(JNIEnv* env) { | |
64 return RegisterNativesImpl(env); | |
65 } | |
66 | |
67 CrashHandler::CrashHandler(const std::string& process_type, | 62 CrashHandler::CrashHandler(const std::string& process_type, |
68 const base::FilePath& log_file_path) | 63 const base::FilePath& log_file_path) |
69 : log_file_path_(log_file_path), | 64 : log_file_path_(log_file_path), |
70 process_type_(process_type), | 65 process_type_(process_type), |
71 crash_reporter_client_(new CastCrashReporterClientAndroid(process_type)) { | 66 crash_reporter_client_(new CastCrashReporterClientAndroid(process_type)) { |
72 if (!crash_reporter_client_->GetCrashDumpLocation(&crash_dump_path_)) { | 67 if (!crash_reporter_client_->GetCrashDumpLocation(&crash_dump_path_)) { |
73 LOG(ERROR) << "Could not get crash dump location"; | 68 LOG(ERROR) << "Could not get crash dump location"; |
74 } | 69 } |
75 SetCrashReporterClient(crash_reporter_client_.get()); | 70 SetCrashReporterClient(crash_reporter_client_.get()); |
76 } | 71 } |
(...skipping 20 matching lines...) Expand all Loading... |
97 base::android::ScopedJavaLocalRef<jstring> crash_dump_path_java = | 92 base::android::ScopedJavaLocalRef<jstring> crash_dump_path_java = |
98 base::android::ConvertUTF8ToJavaString(env, crash_dump_path_.value()); | 93 base::android::ConvertUTF8ToJavaString(env, crash_dump_path_.value()); |
99 Java_CastCrashHandler_initializeUploader( | 94 Java_CastCrashHandler_initializeUploader( |
100 env, | 95 env, |
101 base::android::GetApplicationContext(), | 96 base::android::GetApplicationContext(), |
102 crash_dump_path_java.obj(), | 97 crash_dump_path_java.obj(), |
103 UploadCrashToStaging()); | 98 UploadCrashToStaging()); |
104 } | 99 } |
105 | 100 |
106 } // namespace chromecast | 101 } // namespace chromecast |
OLD | NEW |