Backed out 2 changesets (bug 1193038) for Valgrind bustage

Backed out changeset 9a09b707e39b (bug 1193038)
Backed out changeset 2c9fe69fd9b4 (bug 1193038)
This commit is contained in:
Phil Ringnalda 2015-09-10 12:26:00 -07:00
parent 92ad55e0aa
commit 8edbab28aa

View File

@ -21,7 +21,6 @@
#include "mozilla/Preferences.h" #include "mozilla/Preferences.h"
#include "mozilla/Services.h" #include "mozilla/Services.h"
#include "mozilla/Telemetry.h" #include "mozilla/Telemetry.h"
#include "mozilla/MemoryChecking.h"
#include "nsAppRunner.h" #include "nsAppRunner.h"
#include "mozilla/AppData.h" #include "mozilla/AppData.h"
@ -3073,6 +3072,7 @@ public:
~XREMain() { ~XREMain() {
mScopedXPCOM = nullptr; mScopedXPCOM = nullptr;
mStatisticsRecorder = nullptr;
mAppData = nullptr; mAppData = nullptr;
} }
@ -3091,6 +3091,7 @@ public:
#endif #endif
UniquePtr<ScopedXPCOMStartup> mScopedXPCOM; UniquePtr<ScopedXPCOMStartup> mScopedXPCOM;
UniquePtr<base::StatisticsRecorder> mStatisticsRecorder;
nsAutoPtr<mozilla::ScopedAppData> mAppData; nsAutoPtr<mozilla::ScopedAppData> mAppData;
nsXREDirProvider mDirProvider; nsXREDirProvider mDirProvider;
@ -4344,6 +4345,10 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
NS_ENSURE_TRUE(aAppData, 2); NS_ENSURE_TRUE(aAppData, 2);
// A initializer to initialize histogram collection, a chromium
// thing used by Telemetry.
mStatisticsRecorder = MakeUnique<base::StatisticsRecorder>();
mAppData = new ScopedAppData(aAppData); mAppData = new ScopedAppData(aAppData);
if (!mAppData) if (!mAppData)
return 1; return 1;
@ -4408,6 +4413,7 @@ XREMain::XRE_main(int argc, char* argv[], const nsXREAppData* aAppData)
} }
mScopedXPCOM = nullptr; mScopedXPCOM = nullptr;
mStatisticsRecorder = nullptr;
// unlock the profile after ScopedXPCOMStartup object (xpcom) // unlock the profile after ScopedXPCOMStartup object (xpcom)
// has gone out of scope. see bug #386739 for more details // has gone out of scope. see bug #386739 for more details
@ -4469,13 +4475,6 @@ int
XRE_main(int argc, char* argv[], const nsXREAppData* aAppData, uint32_t aFlags) XRE_main(int argc, char* argv[], const nsXREAppData* aAppData, uint32_t aFlags)
{ {
XREMain main; XREMain main;
// A initializer to initialize histogram collection, a chromium
// thing used by Telemetry (and effectively a global; it's all static).
// Note: purposely leaked
base::StatisticsRecorder* statistics_recorder = new base::StatisticsRecorder();
MOZ_LSAN_INTENTIONALLY_LEAK_OBJECT(statistics_recorder);
unused << statistics_recorder;
int result = main.XRE_main(argc, argv, aAppData); int result = main.XRE_main(argc, argv, aAppData);
mozilla::RecordShutdownEndTimeStamp(); mozilla::RecordShutdownEndTimeStamp();
return result; return result;