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 #include "components/breakpad/browser/crash_dump_manager_android.h" | 5 #include "components/breakpad/browser/crash_dump_manager_android.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 child_process_id_to_minidump_path_[child_process_id] = minidump_path; | 79 child_process_id_to_minidump_path_[child_process_id] = minidump_path; |
80 } | 80 } |
81 return minidump_file; | 81 return minidump_file; |
82 } | 82 } |
83 | 83 |
84 // static | 84 // static |
85 void CrashDumpManager::ProcessMinidump(const base::FilePath& minidump_path, | 85 void CrashDumpManager::ProcessMinidump(const base::FilePath& minidump_path, |
86 base::ProcessHandle pid) { | 86 base::ProcessHandle pid) { |
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
88 int64 file_size = 0; | 88 int64 file_size = 0; |
89 int r = file_util::GetFileSize(minidump_path, &file_size); | 89 int r = base::GetFileSize(minidump_path, &file_size); |
90 DCHECK(r) << "Failed to retrieve size for minidump " | 90 DCHECK(r) << "Failed to retrieve size for minidump " |
91 << minidump_path.value(); | 91 << minidump_path.value(); |
92 | 92 |
93 if (file_size == 0) { | 93 if (file_size == 0) { |
94 // Empty minidump, this process did not crash. Just remove the file. | 94 // Empty minidump, this process did not crash. Just remove the file. |
95 r = base::DeleteFile(minidump_path, false); | 95 r = base::DeleteFile(minidump_path, false); |
96 DCHECK(r) << "Failed to delete temporary minidump file " | 96 DCHECK(r) << "Failed to delete temporary minidump file " |
97 << minidump_path.value(); | 97 << minidump_path.value(); |
98 return; | 98 return; |
99 } | 99 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 } | 164 } |
165 minidump_path = iter->second; | 165 minidump_path = iter->second; |
166 child_process_id_to_minidump_path_.erase(iter); | 166 child_process_id_to_minidump_path_.erase(iter); |
167 } | 167 } |
168 BrowserThread::PostTask( | 168 BrowserThread::PostTask( |
169 BrowserThread::FILE, FROM_HERE, | 169 BrowserThread::FILE, FROM_HERE, |
170 base::Bind(&CrashDumpManager::ProcessMinidump, minidump_path, pid)); | 170 base::Bind(&CrashDumpManager::ProcessMinidump, minidump_path, pid)); |
171 } | 171 } |
172 | 172 |
173 } // namespace breakpad | 173 } // namespace breakpad |
OLD | NEW |