diff options
author | Yongqin Liu <yongqin.liu@linaro.org> | 2012-09-25 18:10:27 +0800 |
---|---|---|
committer | Amit Pundir <Amit.Pundir@linaro.org> | 2013-02-13 08:42:13 +0530 |
commit | de18b717fb689753a85f819bc1d0ec5edec2d830 (patch) | |
tree | 85faf81a1422b82859c606966be5346e788a87ce | |
parent | 3c3c3a8e7e5b25ace07482b382d9b3bd96430d9a (diff) | |
download | base-de18b717fb689753a85f819bc1d0ec5edec2d830.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.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/core/java/android/webkit/WebViewClassic.java b/core/java/android/webkit/WebViewClassic.java index ae56e6bfde0e..7aa5b4e5a378 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; @@ -2584,6 +2585,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; |