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

Unified Diff: components/breakpad/browser/crash_handler_host_linux.cc

Issue 298803013: Linux Breakpad: Call base::GetLinuxDistro() on the right thread. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/breakpad/browser/crash_handler_host_linux.cc
===================================================================
--- components/breakpad/browser/crash_handler_host_linux.cc (revision 272375)
+++ components/breakpad/browser/crash_handler_host_linux.cc (working copy)
@@ -300,14 +300,6 @@
process_type_str[info->process_type_length] = '\0';
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().
info->crash_keys = crash_keys.release();
#if defined(ADDRESS_SANITIZER)
@@ -344,6 +336,16 @@
DCHECK(BrowserThread::GetBlockingPool()->IsRunningSequenceOnCurrentThread(
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");
PathService::Get(base::DIR_TEMP, &dumps_path);
if (!info->upload)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698