summaryrefslogtreecommitdiffstats
path: root/WebKit/android/jni/WebCoreFrameBridge.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2011-02-28 16:17:28 -0800
committerJohn Reck <jreck@google.com>2011-02-28 16:33:45 -0800
commit9e46c1efb24652cdda5b51c451183fe72ea1eee1 (patch)
tree20478f4f76ea9aeab6dae16ef385653e60d043fd /WebKit/android/jni/WebCoreFrameBridge.cpp
parentd914e54363c3b0482ac7f4843af11d1beb340afe (diff)
downloadexternal_webkit-9e46c1efb24652cdda5b51c451183fe72ea1eee1.zip
external_webkit-9e46c1efb24652cdda5b51c451183fe72ea1eee1.tar.gz
external_webkit-9e46c1efb24652cdda5b51c451183fe72ea1eee1.tar.bz2
Only support saveWebArchive for (X)HTML
Bug: 3492152 If the mimetype is not text/html or application/xhtml+xml, don't try to save the page as a web archive and instead return NULL Change-Id: Ieb9d65efd72392bedec41ba33ae2aeb1a0954bb4
Diffstat (limited to 'WebKit/android/jni/WebCoreFrameBridge.cpp')
-rw-r--r--WebKit/android/jni/WebCoreFrameBridge.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/WebKit/android/jni/WebCoreFrameBridge.cpp b/WebKit/android/jni/WebCoreFrameBridge.cpp
index c187d92..f800e2d 100644
--- a/WebKit/android/jni/WebCoreFrameBridge.cpp
+++ b/WebKit/android/jni/WebCoreFrameBridge.cpp
@@ -1417,6 +1417,9 @@ static jstring SaveWebArchive(JNIEnv *env, jobject obj, jstring basename, jboole
#if ENABLE(ARCHIVE)
WebCore::Frame* pFrame = GET_NATIVE_FRAME(env, obj);
LOG_ASSERT(pFrame, "nativeSaveWebArchive must take a valid frame pointer!");
+ String mimeType = pFrame->loader()->documentLoader()->mainResource()->mimeType();
+ if ((mimeType != "text/html") && (mimeType != "application/xhtml+xml"))
+ return NULL;
const char* basenameNative = getCharactersFromJStringInEnv(env, basename);
String basenameString = String::fromUTF8(basenameNative);