From: Patrick Scott Date: Tue, 18 Jan 2011 21:17:21 +0000 (-0500) Subject: Do not send empty data. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=32552b6c77d13df635d84345f5ddb3f5854185ea;p=android-x86%2Fexternal-webkit.git Do not send empty data. WebKit asserts that the length of data is 0 and assumes that the length is non-zero. Change-Id: Ic1e62bcfaca5b875256216ed20013f1b4ad7e653 --- diff --git a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp index d6224e068..ed7ece76e 100644 --- a/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp +++ b/WebKit/android/WebCoreSupport/WebUrlLoaderClient.cpp @@ -302,7 +302,7 @@ void WebUrlLoaderClient::didReceiveResponse(PassOwnPtr webResponse) void WebUrlLoaderClient::didReceiveData(scoped_refptr buf, int size) { - if (!isActive()) + if (!isActive() || !size) return; // didReceiveData will take a copy of the data @@ -313,7 +313,7 @@ void WebUrlLoaderClient::didReceiveData(scoped_refptr buf, int si // For data url's void WebUrlLoaderClient::didReceiveDataUrl(PassOwnPtr str) { - if (!isActive()) + if (!isActive() || !str->size()) return; // didReceiveData will take a copy of the data @@ -323,7 +323,7 @@ void WebUrlLoaderClient::didReceiveDataUrl(PassOwnPtr str) // For special android files void WebUrlLoaderClient::didReceiveAndroidFileData(PassOwnPtr > vector) { - if (!isActive()) + if (!isActive() || !vector->size()) return; // didReceiveData will take a copy of the data