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/crash/browser/crash_dump_manager_android.h" | 5 #include "components/crash/browser/crash_dump_manager_android.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 BrowserChildProcessObserver::Add(this); | 50 BrowserChildProcessObserver::Add(this); |
51 } | 51 } |
52 | 52 |
53 CrashDumpManager::~CrashDumpManager() { | 53 CrashDumpManager::~CrashDumpManager() { |
54 instance_ = NULL; | 54 instance_ = NULL; |
55 | 55 |
56 BrowserChildProcessObserver::Remove(this); | 56 BrowserChildProcessObserver::Remove(this); |
57 } | 57 } |
58 | 58 |
59 base::File CrashDumpManager::CreateMinidumpFile(int child_process_id) { | 59 base::File CrashDumpManager::CreateMinidumpFile(int child_process_id) { |
60 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::PROCESS_LAUNCHER)); | 60 DCHECK_CURRENTLY_ON(BrowserThread::PROCESS_LAUNCHER); |
61 base::FilePath minidump_path; | 61 base::FilePath minidump_path; |
62 if (!base::CreateTemporaryFile(&minidump_path)) | 62 if (!base::CreateTemporaryFile(&minidump_path)) |
63 return base::File(); | 63 return base::File(); |
64 | 64 |
65 // We need read permission as the minidump is generated in several phases | 65 // We need read permission as the minidump is generated in several phases |
66 // and needs to be read at some point. | 66 // and needs to be read at some point. |
67 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | | 67 int flags = base::File::FLAG_OPEN | base::File::FLAG_READ | |
68 base::File::FLAG_WRITE; | 68 base::File::FLAG_WRITE; |
69 base::File minidump_file(minidump_path, flags); | 69 base::File minidump_file(minidump_path, flags); |
70 if (!minidump_file.IsValid()) { | 70 if (!minidump_file.IsValid()) { |
(...skipping 93 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 |