Commit 8dd612a1 authored by thestig@chromium.org's avatar thestig@chromium.org

Linux Breakpad: Call base::GetLinuxDistro() on the right thread.

This regressed in r271640.

Review URL: https://codereview.chromium.org/298803013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272499 0039d316-1c4b-4281-b951-d872f2087c98
parent c696c28a
...@@ -300,14 +300,6 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) { ...@@ -300,14 +300,6 @@ void CrashHandlerHostLinux::OnFileCanReadWithoutBlocking(int fd) {
process_type_str[info->process_type_length] = '\0'; process_type_str[info->process_type_length] = '\0';
info->process_type = process_type_str; info->process_type = process_type_str;
std::string distro = base::GetLinuxDistro();
info->distro_length = distro.length();
// Freed in CrashDumpTask().
char* distro_str = new char[info->distro_length + 1];
distro.copy(distro_str, info->distro_length);
distro_str[info->distro_length] = '\0';
info->distro = distro_str;
// Memory released from scoped_ptrs below are also freed in CrashDumpTask(). // Memory released from scoped_ptrs below are also freed in CrashDumpTask().
info->crash_keys = crash_keys.release(); info->crash_keys = crash_keys.release();
#if defined(ADDRESS_SANITIZER) #if defined(ADDRESS_SANITIZER)
...@@ -344,6 +336,16 @@ void CrashHandlerHostLinux::WriteDumpFile(scoped_ptr<BreakpadInfo> info, ...@@ -344,6 +336,16 @@ void CrashHandlerHostLinux::WriteDumpFile(scoped_ptr<BreakpadInfo> info,
DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread( DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread(
worker_pool_token_)); worker_pool_token_));
// Set |info->distro| here because base::GetLinuxDistro() needs to run on a
// blocking thread.
std::string distro = base::GetLinuxDistro();
info->distro_length = distro.length();
// Freed in CrashDumpTask().
char* distro_str = new char[info->distro_length + 1];
distro.copy(distro_str, info->distro_length);
distro_str[info->distro_length] = '\0';
info->distro = distro_str;
base::FilePath dumps_path("/tmp"); base::FilePath dumps_path("/tmp");
PathService::Get(base::DIR_TEMP, &dumps_path); PathService::Get(base::DIR_TEMP, &dumps_path);
if (!info->upload) if (!info->upload)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment