Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(579)

Side by Side Diff: chromecast/crash/android/crash_handler.h

Issue 620673003: Chromecast: adds crash handling for Android build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address lei's comments Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 #ifndef CHROMECAST_CRASH_ANDROID_CRASH_HANDLER_H_
6 #define CHROMECAST_CRASH_ANDROID_CRASH_HANDLER_H_
7
8 #include <jni.h>
9 #include <string>
10
11 #include "base/files/file_path.h"
12 #include "base/macros.h"
13 #include "base/memory/scoped_ptr.h"
14
15 namespace google_breakpad {
16 class ExceptionHandler;
17 }
18
19 namespace chromecast {
20 class CastCrashReporterClientAndroid;
21
22 class CrashHandler {
23 public:
24 // Initializes the crash handler for attempting to upload crash dumps with
25 // the current process's log file.
26 // Must not be called more than once.
27 static void Initialize(const std::string& process_type,
28 const base::FilePath& log_file_path);
29
30 // Returns the directory location for crash dumps.
31 static bool GetCrashDumpLocation(base::FilePath* crash_dir);
32
33 // Registers JNI methods for this module.
34 static bool RegisterCastCrashJni(JNIEnv* env);
35
36 // Returns whether or not the user has allowed for uploading crash dumps.
37 bool CanUploadCrashDump();
38
39 // Callback with which to create a breakpad::ExceptionHandler that will
40 // attempt synchronously uploading crash dumps and logs at crash time.
41 void AttemptUploadCrashDump();
42
43 // Callback for breakpad::ExceptionHandler to delete crash dumps created by
44 // the Chrome crash component. Chrome's crash component does not query
45 // for user consent after initializing breakpad.
46 void RemoveCrashDumps();
47
48 private:
49 CrashHandler(const base::FilePath& log_file_path);
50 ~CrashHandler();
51
52 void Initialize(const std::string& process_type);
53
54 // Starts a background thread to look for any past crash dumps and upload them
55 // to the crash server.
56 void UploadCrashDumpsAsync();
57
58 // Path to the current process's log file.
59 base::FilePath log_file_path_;
60
61 // Location to which crash dumps should be written.
62 base::FilePath crash_dump_path_;
63
64 scoped_ptr<CastCrashReporterClientAndroid> crash_reporter_client_;
65 scoped_ptr<google_breakpad::ExceptionHandler> crash_uploader_;
66
67 DISALLOW_COPY_AND_ASSIGN(CrashHandler);
68 };
69
70 } // namespace chromecast
71
72 #endif // CHROMECAST_CRASH_ANDROID_CRASH_HANDLER_H_
OLDNEW
« no previous file with comments | « chromecast/crash/android/cast_crash_reporter_client_android.cc ('k') | chromecast/crash/android/crash_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698