summaryrefslogtreecommitdiffstats
path: root/WebKit
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-12-02 09:51:27 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-12-02 09:51:27 -0800
commit73b03f71b87666e532e997c6bcd3eb6a4fc3228d (patch)
treeaaee79b799d9b263bf316fa36d96c97e8a83597a /WebKit
parent5f1379c6c79e49753999830866c2809a920cc3e4 (diff)
parent537e6e260dbe25b78cd6df29a17118b3294f61a6 (diff)
downloadexternal_webkit-73b03f71b87666e532e997c6bcd3eb6a4fc3228d.zip
external_webkit-73b03f71b87666e532e997c6bcd3eb6a4fc3228d.tar.gz
external_webkit-73b03f71b87666e532e997c6bcd3eb6a4fc3228d.tar.bz2
Merge change Ie0a2c0d4 into eclair-mr2
* changes: Move dump display tree to sdcard as dom and render tree.
Diffstat (limited to 'WebKit')
-rw-r--r--WebKit/android/AndroidLog.h2
-rw-r--r--WebKit/android/jni/WebViewCore.cpp30
2 files changed, 15 insertions, 17 deletions
diff --git a/WebKit/android/AndroidLog.h b/WebKit/android/AndroidLog.h
index 0c8e160..b5d63e8 100644
--- a/WebKit/android/AndroidLog.h
+++ b/WebKit/android/AndroidLog.h
@@ -42,6 +42,6 @@ extern FILE* gRenderTreeFile;
#define DUMP_RENDER_LOGD(...) ((void)0)
#endif /* ANDROID_DOM_LOGGING */
-#define DISPLAY_TREE_LOG_FILE "/data/data/com.android.browser/displayTree.txt"
+#define DISPLAY_TREE_LOG_FILE "/sdcard/displayTree.txt"
#endif /* ANDROIDLOG_H_ */
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 4372171..f138662 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1153,26 +1153,24 @@ void WebViewCore::dumpDomTree(bool useFile)
void WebViewCore::dumpRenderTree(bool useFile)
{
#ifdef ANDROID_DOM_LOGGING
- if (useFile)
- gRenderTreeFile = fopen(RENDER_TREE_LOG_FILE, "w");
WebCore::CString renderDump = WebCore::externalRepresentation(m_mainFrame->contentRenderer()).utf8();
const char* data = renderDump.data();
- int length = renderDump.length();
- int last = 0;
- for (int i = 0; i < length; i++) {
- if (data[i] == '\n') {
- if (i != last) {
- char* chunk = new char[i - last + 1];
- strncpy(chunk, (data + last), i - last);
- chunk[i - last] = '\0';
- DUMP_RENDER_LOGD("%s", chunk);
- }
- last = i + 1;
- }
- }
- if (gRenderTreeFile) {
+ if (useFile) {
+ gRenderTreeFile = fopen(RENDER_TREE_LOG_FILE, "w");
+ DUMP_RENDER_LOGD("%s", data);
fclose(gRenderTreeFile);
gRenderTreeFile = 0;
+ } else {
+ // adb log can only output 1024 characters, so write out line by line.
+ // exclude '\n' as adb log adds it for each output.
+ int length = renderDump.length();
+ for (int i = 0, last = 0; i < length; i++) {
+ if (data[i] == '\n') {
+ if (i != last)
+ DUMP_RENDER_LOGD("%.*s", (i - last), &(data[last]));
+ last = i + 1;
+ }
+ }
}
#endif
}