Backed out changeset 726f50ce3a40 (bug 943686)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Mon, 20 Mar 2017 23:00:06 +0100
changeset 501791 fc2be069fd576c9cf99c8797d541f35cdf09e4f5
parent 501790 b1c38bf368292d2bb8fba967ac113ef376a95133
child 501792 083daa40d2d70bad15dd135276905f8ed9c08b51
push id50127
push userna-g@nostrum.com
push dateTue, 21 Mar 2017 00:09:45 +0000
bugs943686
milestone55.0a1
backs out726f50ce3a40fc35279cf9d240128d54e4053fd2
Backed out changeset 726f50ce3a40 (bug 943686)
image/imgRequest.cpp
image/moz.build
--- a/image/imgRequest.cpp
+++ b/image/imgRequest.cpp
@@ -504,21 +504,21 @@ imgRequest::RemoveFromCache()
 
 bool
 imgRequest::HasConsumers() const
 {
   RefPtr<ProgressTracker> progressTracker = GetProgressTracker();
   return progressTracker && progressTracker->ObserverCount() > 0;
 }
 
-already_AddRefed<image::Image>
+already_AddRefed<Image>
 imgRequest::GetImage() const
 {
   MutexAutoLock lock(mMutex);
-  RefPtr<image::Image> image = mImage;
+  RefPtr<Image> image = mImage;
   return image.forget();
 }
 
 int32_t imgRequest::Priority() const
 {
   int32_t priority = nsISupportsPriority::PRIORITY_NORMAL;
   nsCOMPtr<nsISupportsPriority> p = do_QueryInterface(mRequest);
   if (p) {
@@ -900,34 +900,34 @@ imgRequest::CheckListenerChain()
   NS_ASSERTION(NS_IsMainThread(), "Should be on the main thread!");
   return NS_OK;
 }
 
 /** nsIStreamListener methods **/
 
 struct NewPartResult final
 {
-  explicit NewPartResult(image::Image* aExistingImage)
+  explicit NewPartResult(Image* aExistingImage)
     : mImage(aExistingImage)
     , mIsFirstPart(!aExistingImage)
     , mSucceeded(false)
     , mShouldResetCacheEntry(false)
   { }
 
   nsAutoCString mContentType;
   nsAutoCString mContentDisposition;
-  RefPtr<image::Image> mImage;
+  RefPtr<Image> mImage;
   const bool mIsFirstPart;
   bool mSucceeded;
   bool mShouldResetCacheEntry;
 };
 
 static NewPartResult
 PrepareForNewPart(nsIRequest* aRequest, nsIInputStream* aInStr, uint32_t aCount,
-                  ImageURL* aURI, bool aIsMultipart, image::Image* aExistingImage,
+                  ImageURL* aURI, bool aIsMultipart, Image* aExistingImage,
                   ProgressTracker* aProgressTracker, uint32_t aInnerWindowId)
 {
   NewPartResult result(aExistingImage);
 
   if (aInStr) {
     mimetype_closure closure;
     closure.newType = &result.mContentType;
 
@@ -962,46 +962,44 @@ PrepareForNewPart(nsIRequest* aRequest, 
   // XXX If server lied about mimetype and it's SVG, we may need to copy
   // the data and dispatch back to the main thread, AND tell the channel to
   // dispatch there in the future.
 
   // Create the new image and give it ownership of our ProgressTracker.
   if (aIsMultipart) {
     // Create the ProgressTracker and image for this part.
     RefPtr<ProgressTracker> progressTracker = new ProgressTracker();
-    RefPtr<image::Image> partImage =
-      image::ImageFactory::CreateImage(aRequest, progressTracker,
-                                       result.mContentType,
-                                       aURI, /* aIsMultipart = */ true,
-                                       aInnerWindowId);
+    RefPtr<Image> partImage =
+      ImageFactory::CreateImage(aRequest, progressTracker, result.mContentType,
+                                aURI, /* aIsMultipart = */ true,
+                                aInnerWindowId);
 
     if (result.mIsFirstPart) {
       // First part for a multipart channel. Create the MultipartImage wrapper.
       MOZ_ASSERT(aProgressTracker, "Shouldn't have given away tracker yet");
       aProgressTracker->SetIsMultipart();
       result.mImage =
-        image::ImageFactory::CreateMultipartImage(partImage, aProgressTracker);
+        ImageFactory::CreateMultipartImage(partImage, aProgressTracker);
     } else {
       // Transition to the new part.
       auto multipartImage = static_cast<MultipartImage*>(aExistingImage);
       multipartImage->BeginTransitionToPart(partImage);
 
       // Reset our cache entry size so it doesn't keep growing without bound.
       result.mShouldResetCacheEntry = true;
     }
   } else {
     MOZ_ASSERT(!aExistingImage, "New part for non-multipart channel?");
     MOZ_ASSERT(aProgressTracker, "Shouldn't have given away tracker yet");
 
     // Create an image using our progress tracker.
     result.mImage =
-      image::ImageFactory::CreateImage(aRequest, aProgressTracker,
-                                       result.mContentType,
-                                       aURI, /* aIsMultipart = */ false,
-                                       aInnerWindowId);
+      ImageFactory::CreateImage(aRequest, aProgressTracker, result.mContentType,
+                                aURI, /* aIsMultipart = */ false,
+                                aInnerWindowId);
   }
 
   MOZ_ASSERT(result.mImage);
   if (!result.mImage->HasError() || aIsMultipart) {
     // We allow multipart images to fail to initialize (which generally
     // indicates a bad content type) without cancelling the load, because
     // subsequent parts might be fine.
     result.mSucceeded = true;
--- a/image/moz.build
+++ b/image/moz.build
@@ -62,17 +62,16 @@ UNIFIED_SOURCES += [
     'IDecodingTask.cpp',
     'Image.cpp',
     'ImageCacheKey.cpp',
     'ImageFactory.cpp',
     'ImageOps.cpp',
     'ImageWrapper.cpp',
     'imgFrame.cpp',
     'imgLoader.cpp',
-    'imgRequest.cpp',
     'imgTools.cpp',
     'MultipartImage.cpp',
     'OrientedImage.cpp',
     'ScriptedNotificationObserver.cpp',
     'ShutdownTracker.cpp',
     'SourceBuffer.cpp',
     'SurfaceCache.cpp',
     'SurfaceCacheUtils.cpp',
@@ -80,16 +79,17 @@ UNIFIED_SOURCES += [
     'SVGDocumentWrapper.cpp',
     'VectorImage.cpp',
 ]
 if CONFIG['MOZ_ENABLE_SKIA']:
     UNIFIED_SOURCES += [ 'Downscaler.cpp']
 
 # These files can't be unified because of ImageLogging.h #include order issues.
 SOURCES += [
+    'imgRequest.cpp',
     'imgRequestProxy.cpp',
     'ProgressTracker.cpp',
     'RasterImage.cpp',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'