summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Andrei Popescu <andreip@google.com> 2010-02-01 22:32:16 +0000
committer Andrei Popescu <andreip@google.com> 2010-02-02 11:40:20 +0000
commit5e7bb0a9cafc5e90bf451faa5722bb80fb4294e9 (patch)
treeca0bca4bf5c469a6daf9b61f4163f0e8f03498de
parentb83e68c95b391455f201a28379a94649cf28c0d1 (diff)
Implement support for v8 counters
-rw-r--r--core/java/android/webkit/WebView.java11
-rw-r--r--core/java/android/webkit/WebViewCore.java9
2 files changed, 19 insertions, 1 deletions
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;