summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android/AndroidLog.h
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-03-20 10:01:59 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-03-20 10:01:59 -0700
commit92f133bc695b6812d789c6e71feab3b6a8557ad1 (patch)
tree9e567e7775afd37d3d214ee78f44ff46720480d6 /Source/WebKit/android/AndroidLog.h
parent696cf3d1df6a07f13757e175b190aae7dc2d405c (diff)
parenta144ac64329978c258faadf3bc484cf4ae6c5d0d (diff)
downloadexternal_webkit-92f133bc695b6812d789c6e71feab3b6a8557ad1.zip
external_webkit-92f133bc695b6812d789c6e71feab3b6a8557ad1.tar.gz
external_webkit-92f133bc695b6812d789c6e71feab3b6a8557ad1.tar.bz2
Merge "Canvas on a texture"
Diffstat (limited to 'Source/WebKit/android/AndroidLog.h')
-rw-r--r--Source/WebKit/android/AndroidLog.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/Source/WebKit/android/AndroidLog.h b/Source/WebKit/android/AndroidLog.h
index 4090ab9..3ac210f 100644
--- a/Source/WebKit/android/AndroidLog.h
+++ b/Source/WebKit/android/AndroidLog.h
@@ -26,8 +26,14 @@
#ifndef AndroidLog_h
#define AndroidLog_h
+#ifndef LOG_TAG
+#define LOG_TAG __FILE__
+#endif
+
+#include <cutils/log.h>
+#include <wtf/CurrentTime.h>
+
#ifdef ANDROID_DOM_LOGGING
-#include <utils/Log.h>
#include <stdio.h>
extern FILE* gDomTreeFile;
#define DOM_TREE_LOG_FILE "/sdcard/domTree.txt"
@@ -46,4 +52,21 @@ extern FILE* gRenderTreeFile;
#define DISPLAY_TREE_LOG_FILE "/sdcard/displayTree.txt"
#define LAYERS_TREE_LOG_FILE "/sdcard/layersTree.plist"
+#define TIME_METHOD() MethodTimer __method_timer(__func__)
+class MethodTimer {
+public:
+ MethodTimer(const char* name)
+ : m_methodName(name)
+ {
+ m_startTime = currentTimeMS();
+ }
+ virtual ~MethodTimer() {
+ double duration = currentTimeMS() - m_startTime;
+ ALOGD("%s took %.2fms", m_methodName, duration);
+ }
+private:
+ const char* m_methodName;
+ double m_startTime;
+};
+
#endif // AndroidLog_h