Bug 799640 - Part 3: Add shutdown labels. r=espindola
☠☠ backed out by fd22236ffb15 ☠ ☠
authorBenoit Girard <b56girard@gmail.com>
Fri, 30 Nov 2012 12:49:47 -0500
changeset 114608 133c704dbcc68e7f573d3664f4e2107e2e4f2090
parent 114607 b130bb991d84db729555ad5b837dc3c5eb1a74a7
child 114609 944c97dabc33f06406bdb3f0cfb0f4dd89388dce
push id18871
push userb56girard@gmail.com
push dateFri, 30 Nov 2012 17:54:51 +0000
treeherdermozilla-inbound@133c704dbcc6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersespindola
bugs799640
milestone20.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 799640 - Part 3: Add shutdown labels. r=espindola
toolkit/components/startup/nsAppStartup.cpp
toolkit/xre/nsAppRunner.cpp
xpcom/build/nsXPComInit.cpp
--- a/toolkit/components/startup/nsAppStartup.cpp
+++ b/toolkit/components/startup/nsAppStartup.cpp
@@ -21,16 +21,17 @@
 #include "nsIWindowWatcher.h"
 #include "nsIXULRuntime.h"
 #include "nsIXULWindow.h"
 #include "nsNativeCharsetUtils.h"
 #include "nsThreadUtils.h"
 #include "nsAutoPtr.h"
 #include "nsStringGlue.h"
 #include "mozilla/Preferences.h"
+#include "sampler.h"
 
 #include "prprf.h"
 #include "nsCRT.h"
 #include "nsIInterfaceRequestorUtils.h"
 #include "nsWidgetsCID.h"
 #include "nsAppShellCID.h"
 #include "nsXPCOMCIDInternal.h"
 #include "mozilla/Services.h"
@@ -382,16 +383,17 @@ nsAppStartup::Quit(uint32_t aMode)
   // Exit() method via nsAppExitEvent to allow one last pass
   // through any events in the queue. This guarantees a tidy cleanup.
   nsresult rv = NS_OK;
   bool postedExitEvent = false;
 
   if (mShuttingDown)
     return NS_OK;
 
+  SAMPLE_MARKER("Shutdown start");
   RecordShutdownStartTimeStamp();
 
   // If we're considering quitting, we will only do so if:
   if (ferocity == eConsiderQuit) {
     if (mConsiderQuitStopper == 0) {
       // there are no windows...
       ferocity = eAttemptQuit;
     }
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -1112,16 +1112,17 @@ ScopedXPCOMStartup::~ScopedXPCOMStartup(
     mozilla::MacAutoreleasePool pool;
 #endif
 
     nsCOMPtr<nsIAppStartup> appStartup (do_GetService(NS_APPSTARTUP_CONTRACTID));
     if (appStartup)
       appStartup->DestroyHiddenWindow();
 
     gDirServiceProvider->DoShutdown();
+    SAMPLE_MARKER("Shutdown early");
 
     WriteConsoleLog();
 
     NS_ShutdownXPCOM(mServiceManager);
     mServiceManager = nullptr;
   }
 }
 
--- a/xpcom/build/nsXPComInit.cpp
+++ b/xpcom/build/nsXPComInit.cpp
@@ -613,16 +613,17 @@ ShutdownXPCOM(nsIServiceManager* servMgr
         nsComponentManagerImpl::gComponentManager->FreeServices();
     }
 
     // Release the directory service
     NS_IF_RELEASE(nsDirectoryService::gService);
 
     nsCycleCollector_shutdown();
 
+    SAMPLE_MARKER("Shutdown xpcom");
     mozilla::PoisonWrite();
 
     if (moduleLoaders) {
         bool more;
         nsCOMPtr<nsISupports> el;
         while (NS_SUCCEEDED(moduleLoaders->HasMoreElements(&more)) &&
                more) {
             moduleLoaders->GetNext(getter_AddRefs(el));