summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2012-09-25 18:10:27 +0800
committerBernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>2013-10-15 22:00:27 +0200
commitb78297c4caf70c012be78af5994731344932d69a (patch)
treea526d5d6ac164964f32abfc25e0ae0087fcf7c19
parent233f9412b6943519fabcd76199ea0898c23292f7 (diff)
downloadbase-b78297c4caf70c012be78af5994731344932d69a.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 a324502f4471..8aa69c6cae91 100644
--- a/core/java/android/webkit/WebViewClassic.java
+++ b/core/java/android/webkit/WebViewClassic.java
@@ -61,6 +61,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;
@@ -2621,6 +2622,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;