Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_DUMP_MANAGER_ANDROID_H_ | 5 #ifndef COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_DUMP_MANAGER_ANDROID_H_ |
| 6 #define COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_DUMP_MANAGER_ANDROID_H_ | 6 #define COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_DUMP_MANAGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 | 41 |
| 42 ~CrashDumpManager() override; | 42 ~CrashDumpManager() override; |
| 43 | 43 |
| 44 // Returns a file that should be used to generate a minidump for the process | 44 // Returns a file that should be used to generate a minidump for the process |
| 45 // |child_process_id|. | 45 // |child_process_id|. |
| 46 base::File CreateMinidumpFile(int child_process_id); | 46 base::File CreateMinidumpFile(int child_process_id); |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 typedef std::map<int, base::FilePath> ChildProcessIDToMinidumpPath; | 49 typedef std::map<int, base::FilePath> ChildProcessIDToMinidumpPath; |
| 50 | 50 |
| 51 // This enum is used to back a UMA histogram, and must be treated as | |
| 52 // append-only. | |
| 53 enum ExitStatus { | |
|
Yaron
2015/11/17 02:02:45
Please use IntDef instead: http://developer.androi
Peter Wen
2015/11/17 19:45:22
Switched to using IntDef in TabWebContentsObserver
| |
| 54 EMPTY_MINIDUMP = 0, | |
| 55 VALID_MINIDUMP = 1, | |
| 56 COUNT = 2 | |
| 57 }; | |
| 58 | |
| 51 static void ProcessMinidump(const base::FilePath& minidump_path, | 59 static void ProcessMinidump(const base::FilePath& minidump_path, |
| 52 base::ProcessHandle pid); | 60 base::ProcessHandle pid, |
| 61 bool recordExitStatus); | |
| 53 | 62 |
| 54 // content::BrowserChildProcessObserver implementation: | 63 // content::BrowserChildProcessObserver implementation: |
| 55 void BrowserChildProcessHostDisconnected( | 64 void BrowserChildProcessHostDisconnected( |
| 56 const content::ChildProcessData& data) override; | 65 const content::ChildProcessData& data) override; |
| 57 void BrowserChildProcessCrashed( | 66 void BrowserChildProcessCrashed( |
| 58 const content::ChildProcessData& data, | 67 const content::ChildProcessData& data, |
| 59 int exit_code) override; | 68 int exit_code) override; |
| 60 | 69 |
| 61 // NotificationObserver implementation: | 70 // NotificationObserver implementation: |
| 62 void Observe(int type, | 71 void Observe(int type, |
| 63 const content::NotificationSource& source, | 72 const content::NotificationSource& source, |
| 64 const content::NotificationDetails& details) override; | 73 const content::NotificationDetails& details) override; |
| 65 | 74 |
| 66 // Called on child process exit (including crash). | 75 // Called on child process exit (including crash). |
| 67 void OnChildExit(int child_process_id, base::ProcessHandle pid); | 76 void OnChildExit(int child_process_id, base::ProcessHandle pid); |
| 77 void OnChildExit(int child_process_id, | |
|
Yaron
2015/11/17 02:02:46
Typically don't overload functions in C++: https:/
Peter Wen
2015/11/17 19:45:22
Done.
| |
| 78 base::ProcessHandle pid, | |
| 79 bool recordExitStatus); | |
| 68 | 80 |
| 69 content::NotificationRegistrar notification_registrar_; | 81 content::NotificationRegistrar notification_registrar_; |
| 70 | 82 |
| 71 // This map should only be accessed with its lock aquired as it is accessed | 83 // This map should only be accessed with its lock aquired as it is accessed |
| 72 // from the PROCESS_LAUNCHER and UI threads. | 84 // from the PROCESS_LAUNCHER and UI threads. |
| 73 base::Lock child_process_id_to_minidump_path_lock_; | 85 base::Lock child_process_id_to_minidump_path_lock_; |
| 74 ChildProcessIDToMinidumpPath child_process_id_to_minidump_path_; | 86 ChildProcessIDToMinidumpPath child_process_id_to_minidump_path_; |
| 75 | 87 |
| 76 base::FilePath crash_dump_dir_; | 88 base::FilePath crash_dump_dir_; |
| 77 | 89 |
| 78 static CrashDumpManager* instance_; | 90 static CrashDumpManager* instance_; |
| 79 | 91 |
| 80 DISALLOW_COPY_AND_ASSIGN(CrashDumpManager); | 92 DISALLOW_COPY_AND_ASSIGN(CrashDumpManager); |
| 81 }; | 93 }; |
| 82 | 94 |
| 83 } // namespace breakpad | 95 } // namespace breakpad |
| 84 | 96 |
| 85 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_DUMP_MANAGER_ANDROID_H_ | 97 #endif // COMPONENTS_CRASH_CONTENT_BROWSER_CRASH_DUMP_MANAGER_ANDROID_H_ |
| OLD | NEW |