merge
authorFabrice Desré <fabrice@mozilla.com>
Wed, 03 Oct 2012 13:36:06 -0700
changeset 109230 2545d8e6f3becb1146cf08e7df60659826b19811
parent 109229 14fe82a53d68c7be9e6042e8971fddd6ebbf5e76 (current diff)
parent 109228 cdb19bc19fdb99e78c15da13af3082dbad4747b8 (diff)
child 109231 83d17569d789c6d1c4521458e6b460bc33eee759
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
milestone18.0a1
merge
--- a/image/src/RasterImage.cpp
+++ b/image/src/RasterImage.cpp
@@ -229,18 +229,18 @@ RasterImage::RasterImage(imgStatusTracke
   mMultipart(false),
   mDiscardable(false),
   mHasSourceData(false),
   mDecoded(false),
   mHasBeenDecoded(false),
   mInDecoder(false),
   mAnimationFinished(false),
   mFinishing(false),
-  mInUpdateImageContainer(false),
-  mScaleRequest(this)
+  mScaleRequest(this),
+  mInUpdateImageContainer(false)
 {
   // Set up the discard tracker node.
   mDiscardTrackerNode.img = this;
   Telemetry::GetHistogramById(Telemetry::IMAGE_DECODE_COUNT)->Add(0);
 
   // Statistics
   num_containers++;
 
@@ -2709,20 +2709,16 @@ void
 RasterImage::ScaleWorker::RequestScale(RasterImage* aImg)
 {
   mRequestsMutex.AssertCurrentThreadOwns();
 
   ScaleRequest* request = &aImg->mScaleRequest;
   if (request->isInList())
     return;
 
-  // While the request is outstanding, we hold a reference to it so it won't be
-  // deleted from under us (and, since it owns us, so we won't be deleted).
-  request->kungFuDeathGrip = request->image;
-
   mScaleRequests.insertBack(request);
 
   if (!sScaleWorkerThread) {
     NS_NewThread(getter_AddRefs(sScaleWorkerThread), this, NS_DISPATCH_NORMAL);
     ClearOnShutdown(&sScaleWorkerThread);
   }
   else {
     sScaleWorkerThread->Dispatch(this, NS_DISPATCH_NORMAL);
@@ -2757,21 +2753,16 @@ RasterImage::DrawWorker::Run()
     }
     nsCOMPtr<imgIContainerObserver> observer(do_QueryReferent(request->image->mObserver));
     if (request->done && observer) {
       imgFrame *scaledFrame = request->dstFrame.get();
       scaledFrame->ImageUpdated(scaledFrame->GetRect());
       nsIntRect frameRect = request->srcFrame->GetRect();
       observer->FrameChanged(nullptr, request->image, &frameRect);
     }
-    if (request->done) {
-      // We are now done with this image, so we can release our reference.
-      // THIS CAN DELETE THE REQUEST!
-      request->kungFuDeathGrip = nullptr;
-    }
   }
 
   return NS_OK;
 }
 
 void
 RasterImage::DrawWorker::RequestDraw(RasterImage* aImg)
 {
--- a/image/src/RasterImage.h
+++ b/image/src/RasterImage.h
@@ -506,17 +506,16 @@ private:
         srcDataLocked = false;
       }
       return success;
     }
 
     static void Stop(RasterImage* aImg);
 
     RasterImage* const image;
-    nsRefPtr<RasterImage> kungFuDeathGrip;
     imgFrame *srcFrame;
     nsAutoPtr<imgFrame> dstFrame;
     gfxSize scale;
     bool done;
     bool stopped;
     bool srcDataLocked;
   };
 
--- a/toolkit/components/downloads/nsDownloadManager.h
+++ b/toolkit/components/downloads/nsDownloadManager.h
@@ -377,17 +377,16 @@ private:
   nsCOMPtr<nsIURI> mSource;
   nsCOMPtr<nsIURI> mReferrer;
   nsCOMPtr<nsICancelable> mCancelable;
   nsCOMPtr<nsIRequest> mRequest;
   nsCOMPtr<nsIFile> mTempFile;
   nsCOMPtr<nsIMIMEInfo> mMIMEInfo;
 
   DownloadState mDownloadState;
-  DownloadType mDownloadType;
 
   uint32_t mID;
   int32_t mPercentComplete;
 
   /**
    * These bytes are based on the position of where the request started, so 0
    * doesn't necessarily mean we have nothing. Use GetAmountTransferred and
    * GetSize for the real transferred amount and size.
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -335,17 +335,16 @@ NS_IMPL_THREADSAFE_ISUPPORTS2(Database
 , nsISupportsWeakReference
 )
 
 Database::Database()
   : mMainThreadStatements(mMainConn)
   , mMainThreadAsyncStatements(mMainConn)
   , mAsyncThreadStatements(mMainConn)
   , mDBPageSize(0)
-  , mCurrentJournalMode(JOURNAL_DELETE)
   , mDatabaseStatus(nsINavHistoryService::DATABASE_STATUS_OK)
   , mShuttingDown(false)
 {
   // Attempting to create two instances of the service?
   MOZ_ASSERT(!gDatabase);
   gDatabase = this;
 }
 
--- a/toolkit/components/places/Database.h
+++ b/toolkit/components/places/Database.h
@@ -290,17 +290,16 @@ private:
 
   nsCOMPtr<mozIStorageConnection> mMainConn;
 
   mutable StatementCache mMainThreadStatements;
   mutable AsyncStatementCache mMainThreadAsyncStatements;
   mutable StatementCache mAsyncThreadStatements;
 
   int32_t mDBPageSize;
-  enum JournalMode mCurrentJournalMode;
   uint16_t mDatabaseStatus;
   bool mShuttingDown;
 };
 
 } // namespace places
 } // namespace mozilla
 
 #endif // mozilla_places_Database_h_