From 5e7bb0a9cafc5e90bf451faa5722bb80fb4294e9 Mon Sep 17 00:00:00 2001 From: Andrei Popescu Date: Mon, 1 Feb 2010 22:32:16 +0000 Subject: Implement support for v8 counters --- core/java/android/webkit/WebView.java | 11 +++++++++++ core/java/android/webkit/WebViewCore.java | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 815e55717af0..a6b74c41ca0b 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -3493,6 +3493,17 @@ public class WebView extends AbsoluteLayout mWebViewCore.sendMessage(EventHub.DUMP_RENDERTREE, toFile ? 1 : 0, 0); } + /** + * Dump the V8 counters to standard output. + * Note that you need a build with V8 and WEBCORE_INSTRUMENTATION set to + * true. Otherwise, this will do nothing. + * + * @hide debug only + */ + public void dumpV8Counters() { + mWebViewCore.sendMessage(EventHub.DUMP_V8COUNTERS); + } + // This is used to determine long press with the center key. Does not // affect long press with the trackball/touch. private boolean mGotCenterDown = false; diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index d4bb1d287f8f..387942f757e3 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -524,6 +524,8 @@ final class WebViewCore { private native void nativeDumpNavTree(); + private native void nativeDumpV8Counters(); + private native void nativeSetJsFlags(String flags); /** @@ -874,8 +876,9 @@ final class WebViewCore { static final int DUMP_DOMTREE = 170; static final int DUMP_RENDERTREE = 171; static final int DUMP_NAVTREE = 172; + static final int DUMP_V8COUNTERS = 173; - static final int SET_JS_FLAGS = 173; + static final int SET_JS_FLAGS = 174; // Geolocation static final int GEOLOCATION_PERMISSIONS_PROVIDE = 180; @@ -1296,6 +1299,10 @@ final class WebViewCore { nativeDumpNavTree(); break; + case DUMP_V8COUNTERS: + nativeDumpV8Counters(); + break; + case SET_JS_FLAGS: nativeSetJsFlags((String)msg.obj); break; -- cgit v1.2.3-59-g8ed1b