| Index: third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
|
| diff --git a/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp b/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
|
| index 4c8811dcaf0429650b643978e56a654098f0f6cd..d749a587a0e713378fc3f23dba29f89d8ca07c9c 100644
|
| --- a/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
|
| +++ b/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
|
| @@ -83,6 +83,19 @@ PassRefPtrWillBeRawPtr<MHTMLArchive> MHTMLArchive::create(const KURL& url, Share
|
| return nullptr; // Invalid MHTML file.
|
|
|
| RefPtrWillBeRawPtr<MHTMLArchive> archive = adoptRefWillBeNoop(new MHTMLArchive);
|
| + // Special case for single resource archives, in that case we will make an image
|
| + // the main resource.
|
| + if (resources.size() == 1) {
|
| + const AtomicString& mimeType = resources[0]->mimeType();
|
| + if (MIMETypeRegistry::isSupportedNonImageMIMEType(mimeType)
|
| + || MIMETypeRegistry::isSupportedImageResourceMIMEType(mimeType)) {
|
| + archive->setMainResource(resources[0].get());
|
| + } else {
|
| + archive->addSubresource(resources[0].get());
|
| + }
|
| + return archive.release();
|
| + }
|
| +
|
| // The first document suitable resource is the main resource of the top frame.
|
| for (size_t i = 0; i < resources.size(); ++i) {
|
| const AtomicString& mimeType = resources[i]->mimeType();
|
|
|