summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2012-09-25 18:10:27 +0800
committerYongqin Liu <yongqin.liu@linaro.org>2012-09-25 18:20:08 +0800
commit17d7ecaad004658cd7009659ebd78972f06b1588 (patch)
tree5ea45377b2f7c04234a824eba8a54bd81ebdc82a
parent6a09a0a6ffd94334e0b0ad2594b5eeb98a35296c (diff)
downloadbase-17d7ecaad004658cd7009659ebd78972f06b1588.tar.gz
frameworks/base:(Hack)Print the content displayed with WebView
This hack allows us to print content that displayed with the loadDataWithBaseURL method of WebViewClassic.java when ro.debug.loadDataWithBaseURL is set to true. This allows us to capture the contents of WebView which will help us capture benchmark results for thirdparty apps which use loadDataWithBaseURL of WebViewClassic to display results. Change-Id: Id8e61e072b867501ef2e0e8eb2f6fb30b13206b4 Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--core/java/android/webkit/WebViewClassic.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java
index 84a6129e8c4d..4ec586eedb6f 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -60,6 +60,7 @@ import android.os.Handler;
import android.os.Looper;
import android.os.Message;
import android.os.SystemClock;
+import android.os.SystemProperties;
import android.security.KeyChain;
import android.text.Editable;
import android.text.InputType;
@@ -2535,6 +2536,20 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
public void loadDataWithBaseURL(String baseUrl, String data,
String mimeType, String encoding, String historyUrl) {
+ String debug_prop = "ro.debug.loadDataWithBaseURL";
+ if (SystemProperties.getBoolean(debug_prop, false)) {
+ String[] ary = data.split("\n", -1);
+ for (String ele: ary){
+ /**
+ * Here we only debug the application that use this
+ * loadDataWithBaseURL method, so we set the the log tag to
+ * WebViewClassic.loadDataWithBaseURL instead of webview
+ * defined by the LOGTAG variable
+ * */
+ Log.d("WebViewClassic.loadDataWithBaseURL", ele);
+ }
+ }
+
if (baseUrl != null && baseUrl.toLowerCase().startsWith("data:")) {
loadDataImpl(data, mimeType, encoding);
return;