Bug 1384688 - Pass aIsShuttingDown == true when obtaining shutdown profiles. r?njn draft
authorMarkus Stange <mstange@themasta.com>
Fri, 28 Jul 2017 16:16:54 -0400
changeset 618569 7458f2c4b12a0848462a17d750fbc6d932313917
parent 618568 983d412b7d802ad58fb47cee3e4dcc0f1aecfadb
child 618570 c0c14c758588be6ca6b58492d54736df95f38506
push id71382
push userbmo:mstange@themasta.com
push dateMon, 31 Jul 2017 18:46:43 +0000
reviewersnjn
bugs1384688
milestone56.0a1
Bug 1384688 - Pass aIsShuttingDown == true when obtaining shutdown profiles. r?njn MozReview-Commit-ID: Aw79gYQgkqy
tools/profiler/gecko/ProfilerChild.cpp
--- a/tools/profiler/gecko/ProfilerChild.cpp
+++ b/tools/profiler/gecko/ProfilerChild.cpp
@@ -70,32 +70,33 @@ ProfilerChild::RecvPause()
 mozilla::ipc::IPCResult
 ProfilerChild::RecvResume()
 {
   profiler_resume();
   return IPC_OK();
 }
 
 static nsCString
-CollectProfileOrEmptyString()
+CollectProfileOrEmptyString(bool aIsShuttingDown)
 {
   nsCString profileCString;
-  UniquePtr<char[]> profile = profiler_get_profile();
+  UniquePtr<char[]> profile =
+    profiler_get_profile(/* aSinceTime */ 0, aIsShuttingDown);
   if (profile) {
     profileCString = nsCString(profile.get(), strlen(profile.get()));
   } else {
     profileCString = EmptyCString();
   }
   return profileCString;
 }
 
 mozilla::ipc::IPCResult
 ProfilerChild::RecvGatherProfile(GatherProfileResolver&& aResolve)
 {
-  aResolve(CollectProfileOrEmptyString());
+  aResolve(CollectProfileOrEmptyString(/* aIsShuttingDown */ false));
   return IPC_OK();
 }
 
 void
 ProfilerChild::ActorDestroy(ActorDestroyReason aActorDestroyReason)
 {
   mDestroyed = true;
 }
@@ -106,12 +107,12 @@ ProfilerChild::Destroy()
   if (!mDestroyed) {
     Close();
   }
 }
 
 nsCString
 ProfilerChild::GrabShutdownProfile()
 {
-  return CollectProfileOrEmptyString();
+  return CollectProfileOrEmptyString(/* aIsShuttingDown */ true);
 }
 
 } // namespace mozilla