Backed out changeset 1310d6d8b5c0 (bug 1377158)
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Tue, 25 Jul 2017 14:33:48 +0200
changeset 370829 01e4f85ad7f69ede53f1b9a5132a7d9afa38c155
parent 370828 cc6128e68428576c75672244acd36784575537de
child 370830 a013e95212fcdc459484be58815e309bca684e83
push id32234
push userkwierso@gmail.com
push dateWed, 26 Jul 2017 01:24:05 +0000
treeherdermozilla-central@c6d36106525b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1377158
milestone56.0a1
backs out1310d6d8b5c091998951a05ce7ac05e4ffac7b28
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 1310d6d8b5c0 (bug 1377158)
image/imgLoader.cpp
image/imgRequest.cpp
image/imgRequest.h
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -2239,24 +2239,19 @@ imgLoader::LoadImage(nsIURI* aURI,
 
     nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(newChannel));
     if (cos && aUseUrgentStartForChannel) {
       cos->AddClassFlags(nsIClassOfService::UrgentStart);
     }
 
     nsCOMPtr<nsILoadGroup> channelLoadGroup;
     newChannel->GetLoadGroup(getter_AddRefs(channelLoadGroup));
-    // We look at the loading document's style backend type to decide which
-    // style backend type should be used for the images. So the images in Chrome
-    // documents would be loaded by Gecko.
     rv = request->Init(aURI, aURI, /* aHadInsecureRedirect = */ false,
                        channelLoadGroup, newChannel, entry, aLoadingDocument,
-                       aLoadingPrincipal, corsmode, aReferrerPolicy,
-                       aLoadingDocument ? aLoadingDocument->GetStyleBackendType()
-                                        : StyleBackendType::None);
+                       aLoadingPrincipal, corsmode, aReferrerPolicy);
     if (NS_FAILED(rv)) {
       return NS_ERROR_FAILURE;
     }
 
     // Add the initiator type for this image load
     nsCOMPtr<nsITimedChannel> timedChannel = do_QueryInterface(newChannel);
     if (timedChannel) {
       timedChannel->SetInitiatorType(initiatorType);
--- a/image/imgRequest.cpp
+++ b/image/imgRequest.cpp
@@ -64,17 +64,16 @@ imgRequest::imgRequest(imgLoader* aLoade
  , mMutex("imgRequest")
  , mProgressTracker(new ProgressTracker())
  , mIsMultiPartChannel(false)
  , mGotData(false)
  , mIsInCache(false)
  , mDecodeRequested(false)
  , mNewPartPending(false)
  , mHadInsecureRedirect(false)
- , mStyleBackendType(StyleBackendType::None)
 { }
 
 imgRequest::~imgRequest()
 {
   if (mLoader) {
     mLoader->RemoveFromUncachedImages(this);
   }
   if (mURI) {
@@ -91,18 +90,17 @@ imgRequest::Init(nsIURI *aURI,
                  nsIURI *aCurrentURI,
                  bool aHadInsecureRedirect,
                  nsIRequest *aRequest,
                  nsIChannel *aChannel,
                  imgCacheEntry *aCacheEntry,
                  nsISupports* aCX,
                  nsIPrincipal* aLoadingPrincipal,
                  int32_t aCORSMode,
-                 ReferrerPolicy aReferrerPolicy,
-                 StyleBackendType aStyleBackendType)
+                 ReferrerPolicy aReferrerPolicy)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Cannot use nsIURI off main thread!");
 
   LOG_FUNC(gImgLog, "imgRequest::Init");
 
   MOZ_ASSERT(!mImage, "Multiple calls to init");
   MOZ_ASSERT(aURI, "No uri");
   MOZ_ASSERT(aCurrentURI, "No current uri");
@@ -120,18 +118,16 @@ imgRequest::Init(nsIURI *aURI,
   mRequest = aRequest;
   mChannel = aChannel;
   mTimedChannel = do_QueryInterface(mChannel);
 
   mLoadingPrincipal = aLoadingPrincipal;
   mCORSMode = aCORSMode;
   mReferrerPolicy = aReferrerPolicy;
 
-  mStyleBackendType = aStyleBackendType;
-
   // If the original URI and the current URI are different, check whether the
   // original URI is secure. We deliberately don't take the current URI into
   // account, as it needs to be handled using more complicated rules than
   // earlier elements of the redirect chain.
   if (aURI != aCurrentURI) {
     bool isHttps = false;
     bool isChrome = false;
     bool schemeLocal = false;
@@ -966,18 +962,17 @@ struct NewPartResult final
   const bool mIsFirstPart;
   bool mSucceeded;
   bool mShouldResetCacheEntry;
 };
 
 static NewPartResult
 PrepareForNewPart(nsIRequest* aRequest, nsIInputStream* aInStr, uint32_t aCount,
                   ImageURL* aURI, bool aIsMultipart, image::Image* aExistingImage,
-                  ProgressTracker* aProgressTracker, uint32_t aInnerWindowId,
-                  StyleBackendType aStyleBackendType)
+                  ProgressTracker* aProgressTracker, uint32_t aInnerWindowId)
 {
   NewPartResult result(aExistingImage);
 
   if (aInStr) {
     mimetype_closure closure;
     closure.newType = &result.mContentType;
 
     // Look at the first few bytes and see if we can tell what the data is from
@@ -1015,17 +1010,17 @@ PrepareForNewPart(nsIRequest* aRequest, 
   // 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, aStyleBackendType);
+                                       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);
     } else {
@@ -1040,17 +1035,17 @@ PrepareForNewPart(nsIRequest* aRequest, 
     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, aStyleBackendType);
+                                       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;
@@ -1133,18 +1128,17 @@ imgRequest::OnDataAvailable(nsIRequest* 
     mNewPartPending = false;
   }
 
   // If this is a new part, we need to sniff its content type and create an
   // appropriate image.
   if (newPartPending) {
     NewPartResult result = PrepareForNewPart(aRequest, aInStr, aCount, mURI,
                                              isMultipart, image,
-                                             progressTracker, mInnerWindowId,
-                                             mStyleBackendType);
+                                             progressTracker, mInnerWindowId);
     bool succeeded = result.mSucceeded;
 
     if (result.mImage) {
       image = result.mImage;
 
       // Update our state to reflect this new part.
       {
         MutexAutoLock lock(mMutex);
--- a/image/imgRequest.h
+++ b/image/imgRequest.h
@@ -17,19 +17,16 @@
 #include "nsProxyRelease.h"
 #include "nsStringGlue.h"
 #include "nsError.h"
 #include "nsIAsyncVerifyRedirectCallback.h"
 #include "mozilla/Mutex.h"
 #include "mozilla/net/ReferrerPolicy.h"
 #include "ImageCacheKey.h"
 
-#include "X11UndefineNone.h"
-#include "mozilla/StyleBackendType.h"
-
 class imgCacheValidator;
 class imgLoader;
 class imgRequestProxy;
 class imgCacheEntry;
 class nsIApplicationCache;
 class nsIProperties;
 class nsIRequest;
 class nsITimedChannel;
@@ -51,17 +48,16 @@ class imgRequest final : public nsIStrea
                          public nsIInterfaceRequestor,
                          public nsIAsyncVerifyRedirectCallback
 {
   typedef mozilla::image::Image Image;
   typedef mozilla::image::ImageCacheKey ImageCacheKey;
   typedef mozilla::image::ImageURL ImageURL;
   typedef mozilla::image::ProgressTracker ProgressTracker;
   typedef mozilla::net::ReferrerPolicy ReferrerPolicy;
-  typedef mozilla::StyleBackendType StyleBackendType;
 
 public:
   imgRequest(imgLoader* aLoader, const ImageCacheKey& aCacheKey);
 
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSITHREADRETARGETABLESTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
@@ -73,18 +69,17 @@ public:
                              nsIURI* aCurrentURI,
                              bool aHadInsecureRedirect,
                              nsIRequest* aRequest,
                              nsIChannel* aChannel,
                              imgCacheEntry* aCacheEntry,
                              nsISupports* aCX,
                              nsIPrincipal* aLoadingPrincipal,
                              int32_t aCORSMode,
-                             ReferrerPolicy aReferrerPolicy,
-                             StyleBackendType aBackendType = StyleBackendType::None);
+                             ReferrerPolicy aReferrerPolicy);
 
   void ClearLoader();
 
   // Callers must call imgRequestProxy::Notify later.
   void AddProxy(imgRequestProxy* proxy);
 
   nsresult RemoveProxy(imgRequestProxy* proxy, nsresult aStatus);
 
@@ -295,14 +290,11 @@ private:
   RefPtr<ProgressTracker> mProgressTracker;
   RefPtr<Image> mImage;
   bool mIsMultiPartChannel : 1;
   bool mGotData : 1;
   bool mIsInCache : 1;
   bool mDecodeRequested : 1;
   bool mNewPartPending : 1;
   bool mHadInsecureRedirect : 1;
-
-  // The backend used for this image document.
-  mozilla::StyleBackendType mStyleBackendType;
 };
 
 #endif // mozilla_image_imgRequest_h