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

Side by Side Diff: third_party/tcmalloc/chromium/src/heap-profiler.cc

Issue 208263016: Revert "Enable DMP for system Chromium WebView on Android" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2005, Google Inc. 1 // Copyright (c) 2005, Google Inc.
2 // All rights reserved. 2 // All rights reserved.
3 // 3 //
4 // Redistribution and use in source and binary forms, with or without 4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are 5 // modification, are permitted provided that the following conditions are
6 // met: 6 // met:
7 // 7 //
8 // * Redistributions of source code must retain the above copyright 8 // * Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer. 9 // notice, this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above 10 // * Redistributions in binary form must reproduce the above
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 //---------------------------------------------------------------------- 664 //----------------------------------------------------------------------
665 665
666 // Initialization code 666 // Initialization code
667 static void HeapProfilerInit() { 667 static void HeapProfilerInit() {
668 // Everything after this point is for setting up the profiler based on envvar 668 // Everything after this point is for setting up the profiler based on envvar
669 char fname[PATH_MAX]; 669 char fname[PATH_MAX];
670 if (!GetUniquePathFromEnv(HEAPPROFILE, fname)) { 670 if (!GetUniquePathFromEnv(HEAPPROFILE, fname)) {
671 return; 671 return;
672 } 672 }
673 // We do a uid check so we don't write out files in a setuid executable. 673 // We do a uid check so we don't write out files in a setuid executable.
674 #if !defined(__ANDROID__) && defined(HAVE_GETEUID) 674 #ifdef HAVE_GETEUID
675 if (getuid() != geteuid()) { 675 if (getuid() != geteuid()) {
676 RAW_LOG(WARNING, ("HeapProfiler: ignoring " HEAPPROFILE " because " 676 RAW_LOG(WARNING, ("HeapProfiler: ignoring " HEAPPROFILE " because "
677 "program seems to be setuid\n")); 677 "program seems to be setuid\n"));
678 return; 678 return;
679 } 679 }
680 #endif 680 #endif
681 681
682 HeapProfileTable::CleanupOldProfiles(fname); 682 HeapProfileTable::CleanupOldProfiles(fname);
683 683
684 HeapProfilerStart(fname); 684 HeapProfilerStart(fname);
685 } 685 }
686 686
687 // class used for finalization -- dumps the heap-profile at program exit 687 // class used for finalization -- dumps the heap-profile at program exit
688 struct HeapProfileEndWriter { 688 struct HeapProfileEndWriter {
689 ~HeapProfileEndWriter() { HeapProfilerDump("Exiting"); } 689 ~HeapProfileEndWriter() { HeapProfilerDump("Exiting"); }
690 }; 690 };
691 691
692 // We want to make sure tcmalloc is up and running before starting the profiler 692 // We want to make sure tcmalloc is up and running before starting the profiler
693 static const TCMallocGuard tcmalloc_initializer; 693 static const TCMallocGuard tcmalloc_initializer;
694 REGISTER_MODULE_INITIALIZER(heapprofiler, HeapProfilerInit()); 694 REGISTER_MODULE_INITIALIZER(heapprofiler, HeapProfilerInit());
695 static HeapProfileEndWriter heap_profile_end_writer; 695 static HeapProfileEndWriter heap_profile_end_writer;
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698