Bug 943686 - Add imgRequest.cpp to unified sources. r=tn

MozReview-Commit-ID: B87v26HNtBn
This commit is contained in:
Eric Rahm 2017-03-20 14:28:41 -07:00
Родитель e9c6b8a437
Коммит bbf39fe24c
2 изменённых файлов: 16 добавлений и 14 удалений

Просмотреть файл

@ -509,11 +509,11 @@ imgRequest::HasConsumers() const
return progressTracker && progressTracker->ObserverCount() > 0;
}
already_AddRefed<Image>
already_AddRefed<image::Image>
imgRequest::GetImage() const
{
MutexAutoLock lock(mMutex);
RefPtr<Image> image = mImage;
RefPtr<image::Image> image = mImage;
return image.forget();
}
@ -905,7 +905,7 @@ imgRequest::CheckListenerChain()
struct NewPartResult final
{
explicit NewPartResult(Image* aExistingImage)
explicit NewPartResult(image::Image* aExistingImage)
: mImage(aExistingImage)
, mIsFirstPart(!aExistingImage)
, mSucceeded(false)
@ -914,7 +914,7 @@ struct NewPartResult final
nsAutoCString mContentType;
nsAutoCString mContentDisposition;
RefPtr<Image> mImage;
RefPtr<image::Image> mImage;
const bool mIsFirstPart;
bool mSucceeded;
bool mShouldResetCacheEntry;
@ -922,7 +922,7 @@ struct NewPartResult final
static NewPartResult
PrepareForNewPart(nsIRequest* aRequest, nsIInputStream* aInStr, uint32_t aCount,
ImageURL* aURI, bool aIsMultipart, Image* aExistingImage,
ImageURL* aURI, bool aIsMultipart, image::Image* aExistingImage,
ProgressTracker* aProgressTracker, uint32_t aInnerWindowId)
{
NewPartResult result(aExistingImage);
@ -967,17 +967,18 @@ PrepareForNewPart(nsIRequest* aRequest, nsIInputStream* aInStr, uint32_t aCount,
if (aIsMultipart) {
// Create the ProgressTracker and image for this part.
RefPtr<ProgressTracker> progressTracker = new ProgressTracker();
RefPtr<Image> partImage =
ImageFactory::CreateImage(aRequest, progressTracker, result.mContentType,
aURI, /* aIsMultipart = */ true,
aInnerWindowId);
RefPtr<image::Image> partImage =
image::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 =
ImageFactory::CreateMultipartImage(partImage, aProgressTracker);
image::ImageFactory::CreateMultipartImage(partImage, aProgressTracker);
} else {
// Transition to the new part.
auto multipartImage = static_cast<MultipartImage*>(aExistingImage);
@ -992,9 +993,10 @@ PrepareForNewPart(nsIRequest* aRequest, nsIInputStream* aInStr, uint32_t aCount,
// Create an image using our progress tracker.
result.mImage =
ImageFactory::CreateImage(aRequest, aProgressTracker, result.mContentType,
aURI, /* aIsMultipart = */ false,
aInnerWindowId);
image::ImageFactory::CreateImage(aRequest, aProgressTracker,
result.mContentType,
aURI, /* aIsMultipart = */ false,
aInnerWindowId);
}
MOZ_ASSERT(result.mImage);

Просмотреть файл

@ -67,6 +67,7 @@ UNIFIED_SOURCES += [
'ImageWrapper.cpp',
'imgFrame.cpp',
'imgLoader.cpp',
'imgRequest.cpp',
'imgTools.cpp',
'MultipartImage.cpp',
'OrientedImage.cpp',
@ -84,7 +85,6 @@ if CONFIG['MOZ_ENABLE_SKIA']:
# These files can't be unified because of ImageLogging.h #include order issues.
SOURCES += [
'imgRequest.cpp',
'imgRequestProxy.cpp',
'ProgressTracker.cpp',
'RasterImage.cpp',