Bug 1322735 - Remove OBSERVE_LATE_WRITES define. r=glandium draft
authorEric Rahm <erahm@mozilla.com>
Tue, 20 Dec 2016 15:29:05 -0800
changeset 459503 dc29789eb29e6546d36a096a9bf0ffa8ec94e561
parent 459502 886ea9889ceb796701777200a1b8058e1981f1f0
child 541913 9b12eb4adeb95b4c6814088180fb0ee5b3ccb46f
push id41241
push usererahm@mozilla.com
push dateThu, 12 Jan 2017 02:40:39 +0000
reviewersglandium
bugs1322735
milestone53.0a1
Bug 1322735 - Remove OBSERVE_LATE_WRITES define. r=glandium OBSERVE_LATE_WRITES is now always defined, we can just remove it. MozReview-Commit-ID: El6RnzZnXBN
xpcom/build/LateWriteChecks.cpp
--- a/xpcom/build/LateWriteChecks.cpp
+++ b/xpcom/build/LateWriteChecks.cpp
@@ -30,18 +30,16 @@
 #include <sys/stat.h>
 #include <windows.h>
 #else
 #define NS_SLASH "/"
 #endif
 
 #include "LateWriteChecks.h"
 
-#define OBSERVE_LATE_WRITES
-
 using namespace mozilla;
 
 /*************************** Auxiliary Declarations ***************************/
 
 // This a wrapper over a file descriptor that provides a Printf method and
 // computes the sha1 of the data that passes through it.
 class SHA1Stream
 {
@@ -107,17 +105,16 @@ public:
   void Observe(IOInterposeObserver::Observation& aObservation);
 private:
   char* mProfileDirectory;
 };
 
 void
 LateWriteObserver::Observe(IOInterposeObserver::Observation& aOb)
 {
-#ifdef OBSERVE_LATE_WRITES
   // Crash if that is the shutdown check mode
   if (gShutdownChecks == SCM_CRASH) {
     MOZ_CRASH();
   }
 
   // If we have shutdown mode SCM_NOTHING or we can't record then abort
   if (gShutdownChecks == SCM_NOTHING || !Telemetry::CanRecordExtended()) {
     return;
@@ -202,17 +199,16 @@ LateWriteObserver::Observe(IOInterposeOb
   // client side deduplication.
   nsPrintfCString finalName("%s%s", mProfileDirectory,
                             "/Telemetry.LateWriteFinal-");
   for (int i = 0; i < 20; ++i) {
     finalName.AppendPrintf("%02x", sha1[i]);
   }
   PR_Delete(finalName.get());
   PR_Rename(name, finalName.get());
-#endif
 }
 
 /******************************* Setup/Teardown *******************************/
 
 static StaticAutoPtr<LateWriteObserver> sLateWriteObserver;
 
 namespace mozilla {