Bug 1256049: Revert diagnostics. r=janv
authorKyle Huey <khuey@kylehuey.com>
Mon, 28 Mar 2016 10:28:15 -0700
changeset 290741 b94bf7ac393dcfdb1a2fedd3073b3a247ab70d51
parent 290740 af8611a7b88ceb68413da8c6c0b3010d82e5fc5c
child 290742 097e6e67c4c6884395c64125a2812af49845cd91
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanv
bugs1256049
milestone48.0a1
Bug 1256049: Revert diagnostics. r=janv
dom/indexedDB/ActorsParent.cpp
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -4984,17 +4984,17 @@ public:
 
     return CheckpointInternal(CheckpointMode::Full);
   }
 
   void
   DoIdleProcessing(bool aNeedsCheckpoint);
 
   void
-  Close(uintptr_t aCallsite = 0);
+  Close();
 
   nsresult
   DisableQuotaChecks();
 
   void
   EnableQuotaChecks();
 
 private:
@@ -5291,20 +5291,19 @@ public:
 
   void
   Dispatch(uint64_t aTransactionId, nsIRunnable* aRunnable);
 
   void
   Finish(uint64_t aTransactionId, FinishCallback* aCallback);
 
   void
-  CloseDatabaseWhenIdle(const nsACString& aDatabaseId,
-                        uintptr_t aCallsite)
-  {
-    Unused << CloseDatabaseWhenIdleInternal(aDatabaseId, aCallsite);
+  CloseDatabaseWhenIdle(const nsACString& aDatabaseId)
+  {
+    Unused << CloseDatabaseWhenIdleInternal(aDatabaseId);
   }
 
   void
   WaitForDatabasesToComplete(nsTArray<nsCString>&& aDatabaseIds,
                              nsIRunnable* aCallback);
 
   void
   Shutdown();
@@ -5353,21 +5352,20 @@ private:
 
   bool
   MaybeFireCallback(DatabasesCompleteCallback* aCallback);
 
   void
   PerformIdleDatabaseMaintenance(DatabaseInfo* aDatabaseInfo);
 
   void
-  CloseDatabase(DatabaseInfo* aDatabaseInfo, uintptr_t aCallsite);
-
-  bool
-  CloseDatabaseWhenIdleInternal(const nsACString& aDatabaseId,
-                                uintptr_t aCallsite);
+  CloseDatabase(DatabaseInfo* aDatabaseInfo);
+
+  bool
+  CloseDatabaseWhenIdleInternal(const nsACString& aDatabaseId);
 };
 
 class ConnectionPool::ConnectionRunnable
   : public nsRunnable
 {
 protected:
   DatabaseInfo* mDatabaseInfo;
   nsCOMPtr<nsIEventTarget> mOwningThread;
@@ -5400,31 +5398,27 @@ private:
   NS_DECL_NSIRUNNABLE
 };
 
 class ConnectionPool::CloseConnectionRunnable final
   : public ConnectionRunnable
 {
 public:
   explicit
-  CloseConnectionRunnable(DatabaseInfo* aDatabaseInfo,
-                          uintptr_t aCallsite)
-    : ConnectionRunnable(aDatabaseInfo),
-      mCallsite(aCallsite)
+  CloseConnectionRunnable(DatabaseInfo* aDatabaseInfo)
+    : ConnectionRunnable(aDatabaseInfo)
   { }
 
   NS_DECL_ISUPPORTS_INHERITED
 
 private:
   ~CloseConnectionRunnable()
   { }
 
   NS_DECL_NSIRUNNABLE
-
-  uintptr_t mCallsite;
 };
 
 struct ConnectionPool::ThreadInfo
 {
   nsCOMPtr<nsIThread> mThread;
   RefPtr<ThreadRunnable> mRunnable;
 
   ThreadInfo();
@@ -10449,26 +10443,22 @@ DatabaseConnection::GetFreelistCount(Cac
 
   MOZ_ASSERT(freelistCount >= 0);
 
   *aFreelistCount = uint32_t(freelistCount);
   return NS_OK;
 }
 
 void
-DatabaseConnection::Close(uintptr_t aCallsite)
+DatabaseConnection::Close()
 {
   AssertIsOnConnectionThread();
   MOZ_ASSERT(mStorageConnection);
   MOZ_ASSERT(!mDEBUGSavepointCount);
-  if (mInWriteTransaction) {
-    uint32_t* crashPtr = (uint32_t*)aCallsite;
-    *crashPtr = 42;
-    MOZ_RELEASE_ASSERT(!mInWriteTransaction);
-  }
+  MOZ_RELEASE_ASSERT(!mInWriteTransaction);
 
   PROFILER_LABEL("IndexedDB",
                  "DatabaseConnection::Close",
                  js::ProfileEntry::Category::STORAGE);
 
   if (mUpdateRefcountFunction) {
     MOZ_ALWAYS_SUCCEEDS(
       mStorageConnection->RemoveFunction(
@@ -11366,17 +11356,17 @@ ConnectionPool::IdleTimerCallback(nsITim
 
   for (uint32_t count = self->mIdleDatabases.Length(); index < count; index++) {
     IdleDatabaseInfo& info = self->mIdleDatabases[index];
 
     if (now >= info.mIdleTime) {
       if (info.mDatabaseInfo->mIdle) {
         self->PerformIdleDatabaseMaintenance(info.mDatabaseInfo);
       } else {
-        self->CloseDatabase(info.mDatabaseInfo, 1);
+        self->CloseDatabase(info.mDatabaseInfo);
       }
     } else {
       break;
     }
   }
 
   if (index) {
     self->mIdleDatabases.RemoveElementsAt(0, index);
@@ -11638,17 +11628,17 @@ ConnectionPool::WaitForDatabasesToComple
   bool mayRunCallbackImmediately = true;
 
   for (uint32_t index = 0, count = aDatabaseIds.Length();
        index < count;
        index++) {
     const nsCString& databaseId = aDatabaseIds[index];
     MOZ_ASSERT(!databaseId.IsEmpty());
 
-    if (CloseDatabaseWhenIdleInternal(databaseId, 0x6)) {
+    if (CloseDatabaseWhenIdleInternal(databaseId)) {
       mayRunCallbackImmediately = false;
     }
   }
 
   if (mayRunCallbackImmediately) {
     Unused << aCallback->Run();
     return;
   }
@@ -11844,25 +11834,25 @@ ConnectionPool::CloseIdleDatabases()
   MOZ_ASSERT(mShutdownRequested);
 
   PROFILER_LABEL("IndexedDB",
                  "ConnectionPool::CloseIdleDatabases",
                  js::ProfileEntry::Category::STORAGE);
 
   if (!mIdleDatabases.IsEmpty()) {
     for (IdleDatabaseInfo& idleInfo : mIdleDatabases) {
-      CloseDatabase(idleInfo.mDatabaseInfo, 2);
+      CloseDatabase(idleInfo.mDatabaseInfo);
     }
     mIdleDatabases.Clear();
   }
 
   if (!mDatabasesPerformingIdleMaintenance.IsEmpty()) {
     for (DatabaseInfo* dbInfo : mDatabasesPerformingIdleMaintenance) {
       MOZ_ASSERT(dbInfo);
-      CloseDatabase(dbInfo, 3);
+      CloseDatabase(dbInfo);
     }
     mDatabasesPerformingIdleMaintenance.Clear();
   }
 }
 
 void
 ConnectionPool::ShutdownIdleThreads()
 {
@@ -12158,17 +12148,17 @@ ConnectionPool::NoteIdleDatabase(Databas
 
   const bool otherDatabasesWaiting = !mQueuedTransactions.IsEmpty();
 
   if (mShutdownRequested ||
       otherDatabasesWaiting ||
       aDatabaseInfo->mCloseOnIdle) {
     // Make sure we close the connection if we're shutting down or giving the
     // thread to another database.
-    CloseDatabase(aDatabaseInfo, 4);
+    CloseDatabase(aDatabaseInfo);
 
     if (otherDatabasesWaiting) {
       // Let another database use this thread.
       ScheduleQueuedTransactions(aDatabaseInfo->mThreadInfo);
     } else if (mShutdownRequested) {
       // If there are no other databases that need to run then we can shut this
       // thread down immediately instead of going through the idle thread
       // mechanism.
@@ -12339,53 +12329,50 @@ ConnectionPool::PerformIdleDatabaseMaint
   mDatabasesPerformingIdleMaintenance.AppendElement(aDatabaseInfo);
 
   MOZ_ALWAYS_SUCCEEDS(
     aDatabaseInfo->mThreadInfo.mThread->Dispatch(runnable,
                                                  NS_DISPATCH_NORMAL));
 }
 
 void
-ConnectionPool::CloseDatabase(DatabaseInfo* aDatabaseInfo,
-                              uintptr_t aCallsite)
+ConnectionPool::CloseDatabase(DatabaseInfo* aDatabaseInfo)
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(aDatabaseInfo);
   MOZ_ASSERT(!aDatabaseInfo->TotalTransactionCount());
   MOZ_ASSERT(aDatabaseInfo->mThreadInfo.mThread);
   MOZ_ASSERT(aDatabaseInfo->mThreadInfo.mRunnable);
   MOZ_ASSERT(!aDatabaseInfo->mClosing);
 
   aDatabaseInfo->mIdle = false;
   aDatabaseInfo->mNeedsCheckpoint = false;
   aDatabaseInfo->mClosing = true;
 
-  nsCOMPtr<nsIRunnable> runnable = new CloseConnectionRunnable(aDatabaseInfo,
-                                                               aCallsite);
+  nsCOMPtr<nsIRunnable> runnable = new CloseConnectionRunnable(aDatabaseInfo);
 
   MOZ_ALWAYS_SUCCEEDS(
     aDatabaseInfo->mThreadInfo.mThread->Dispatch(runnable,
                                                  NS_DISPATCH_NORMAL));
 }
 
 bool
-ConnectionPool::CloseDatabaseWhenIdleInternal(const nsACString& aDatabaseId,
-                                              uintptr_t aCallsite)
+ConnectionPool::CloseDatabaseWhenIdleInternal(const nsACString& aDatabaseId)
 {
   AssertIsOnOwningThread();
   MOZ_ASSERT(!aDatabaseId.IsEmpty());
 
   PROFILER_LABEL("IndexedDB",
                  "ConnectionPool::CloseDatabaseWhenIdleInternal",
                  js::ProfileEntry::Category::STORAGE);
 
   if (DatabaseInfo* dbInfo = mDatabases.Get(aDatabaseId)) {
     if (mIdleDatabases.RemoveElement(dbInfo) ||
         mDatabasesPerformingIdleMaintenance.RemoveElement(dbInfo)) {
-      CloseDatabase(dbInfo, aCallsite);
+      CloseDatabase(dbInfo);
       AdjustIdleTimer();
     } else {
       dbInfo->mCloseOnIdle = true;
     }
 
     return true;
   }
 
@@ -12463,17 +12450,17 @@ CloseConnectionRunnable::Run()
     MOZ_ASSERT(mDatabaseInfo->mClosing);
 
     nsCOMPtr<nsIEventTarget> owningThread;
     mOwningThread.swap(owningThread);
 
     if (mDatabaseInfo->mConnection) {
       mDatabaseInfo->AssertIsOnConnectionThread();
 
-      mDatabaseInfo->mConnection->Close(mCallsite);
+      mDatabaseInfo->mConnection->Close();
 
       IDB_DEBUG_LOG(("ConnectionPool closed connection 0x%p",
                      mDatabaseInfo->mConnection.get()));
 
       mDatabaseInfo->mConnection = nullptr;
 
 #ifdef DEBUG
       mDatabaseInfo->mDEBUGConnectionThread = nullptr;
@@ -13650,17 +13637,17 @@ Database::CloseInternal()
 
     // Ignore harmless race when we just invalidated the database.
     return true;
   }
 
   mClosed = true;
 
   if (gConnectionPool) {
-    gConnectionPool->CloseDatabaseWhenIdle(Id(), 0x7);
+    gConnectionPool->CloseDatabaseWhenIdle(Id());
   }
 
   DatabaseActorInfo* info;
   MOZ_ALWAYS_TRUE(gLiveDatabaseHashtable->Get(Id(), &info));
 
   MOZ_ASSERT(info->mLiveDatabases.Contains(this));
 
   if (info->mWaitingFactoryOp) {