| 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 26fe8ab4d8e1b3b88d67c43482a0c6c3288da1db..aca0676ca00d6a48348187c3ee8c7865c4c15913 100644
|
| --- a/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
|
| +++ b/third_party/WebKit/Source/platform/mhtml/MHTMLArchive.cpp
|
| @@ -69,9 +69,9 @@ MHTMLArchive::MHTMLArchive()
|
|
|
| MHTMLArchive* MHTMLArchive::create(const KURL& url, PassRefPtr<SharedBuffer> data)
|
| {
|
| - // MHTML pages can only be loaded from local URLs and http/https URLs.
|
| + // MHTML pages can only be loaded from local URLs, http/https URLs, and content URLs(Android specific).
|
| // The latter is now allowed due to full sandboxing enforcement on MHTML pages.
|
| - if (!SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol()) && !url.protocolIsInHTTPFamily())
|
| + if (!canLoadArchive(url))
|
| return nullptr;
|
|
|
| MHTMLParser parser(data);
|
| @@ -91,6 +91,21 @@ MHTMLArchive* MHTMLArchive::create(const KURL& url, PassRefPtr<SharedBuffer> dat
|
| return archive;
|
| }
|
|
|
| +bool MHTMLArchive::canLoadArchive(const KURL& url)
|
| +{
|
| + // MHTML pages can only be loaded from local URLs, http/https URLs, and content URLs(Android specific).
|
| + // The latter is now allowed due to full sandboxing enforcement on MHTML pages.
|
| + if (SchemeRegistry::shouldTreatURLSchemeAsLocal(url.protocol()))
|
| + return true;
|
| + if (url.protocolIsInHTTPFamily())
|
| + return true;
|
| +#if OS(ANDROID)
|
| + if (url.protocolIs("content"))
|
| + return true;
|
| +#endif
|
| + return false;
|
| +}
|
| +
|
| void MHTMLArchive::generateMHTMLHeader(
|
| const String& boundary, const String& title, const String& mimeType,
|
| SharedBuffer& outputBuffer)
|
|
|