Title: [195832] trunk
Revision
195832
Author
beid...@apple.com
Date
2016-01-29 11:47:03 -0800 (Fri, 29 Jan 2016)

Log Message

Modern IDB: Fix logging that overwhelms python with strings of excessive length.
https://bugs.webkit.org/show_bug.cgi?id=153652

Reviewed by Tim Horton.

Source/WebCore:

No new tests (Two skipped tests now pass).

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString): Limit the length of the string.

* Modules/indexeddb/IDBKeyRangeData.cpp:
(WebCore::IDBKeyRangeData::loggingString): Limit the length of the string.

LayoutTests:

* platform/mac-wk1/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (195831 => 195832)


--- trunk/LayoutTests/ChangeLog	2016-01-29 19:46:01 UTC (rev 195831)
+++ trunk/LayoutTests/ChangeLog	2016-01-29 19:47:03 UTC (rev 195832)
@@ -1,3 +1,12 @@
+2016-01-29  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Fix logging that overwhelms python with strings of excessive length.
+        https://bugs.webkit.org/show_bug.cgi?id=153652
+
+        Reviewed by Tim Horton.
+
+        * platform/mac-wk1/TestExpectations:
+
 2016-01-29  Saam barati  <sbar...@apple.com>
 
         Exits from exceptions shouldn't jettison code

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (195831 => 195832)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-29 19:46:01 UTC (rev 195831)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-01-29 19:47:03 UTC (rev 195832)
@@ -271,12 +271,8 @@
 
 # SQLite backend tests that crash or ASSERT
 storage/indexeddb/database-odd-names.html [ Skip ]
+storage/indexeddb/dont-wedge.html [ Skip ]
 storage/indexeddb/odd-strings.html [ Skip ]
 
-# SQLite backend tests that wedge the entire testing harness
-imported/w3c/indexeddb/keyorder.htm [ Skip ]
-storage/indexeddb/dont-wedge.html [ Skip ]
-storage/indexeddb/key-type-array.html [ Skip ]
-
 ### END OF (3) IndexedDB failures with SQLite
 ########################################

Modified: trunk/Source/WebCore/ChangeLog (195831 => 195832)


--- trunk/Source/WebCore/ChangeLog	2016-01-29 19:46:01 UTC (rev 195831)
+++ trunk/Source/WebCore/ChangeLog	2016-01-29 19:47:03 UTC (rev 195832)
@@ -1,3 +1,18 @@
+2016-01-29  Brady Eidson  <beid...@apple.com>
+
+        Modern IDB: Fix logging that overwhelms python with strings of excessive length.
+        https://bugs.webkit.org/show_bug.cgi?id=153652
+
+        Reviewed by Tim Horton.
+
+        No new tests (Two skipped tests now pass).
+
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::loggingString): Limit the length of the string.
+        
+        * Modules/indexeddb/IDBKeyRangeData.cpp:
+        (WebCore::IDBKeyRangeData::loggingString): Limit the length of the string.
+
 2016-01-29  Jer Noble  <jer.no...@apple.com>
 
         Unreviewed Windows build fix; one more ResourceLoaderOptions call site which needs to

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (195831 => 195832)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2016-01-29 19:46:01 UTC (rev 195831)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2016-01-29 19:47:03 UTC (rev 195832)
@@ -255,23 +255,26 @@
     if (m_isNull)
         return "<null>";
 
+    String result;
+
     switch (m_type) {
     case KeyType::Invalid:
         return "<invalid>";
-    case KeyType::Array:
-        {
-            StringBuilder result;
-            result.appendLiteral("<array> - { ");
-            for (size_t i = 0; i < m_arrayValue.size(); ++i) {
-                result.append(m_arrayValue[i].loggingString());
-                if (i < m_arrayValue.size() - 1)
-                    result.appendLiteral(", ");
-            }
-            result.appendLiteral(" }");
-            return result.toString();
+    case KeyType::Array: {
+        StringBuilder builder;
+        builder.appendLiteral("<array> - { ");
+        for (size_t i = 0; i < m_arrayValue.size(); ++i) {
+            builder.append(m_arrayValue[i].loggingString());
+            if (i < m_arrayValue.size() - 1)
+                builder.appendLiteral(", ");
         }
+        builder.appendLiteral(" }");
+        result = builder.toString();
+        break;
+    }
     case KeyType::String:
-        return "<string> - " + m_stringValue;
+        result = "<string> - " + m_stringValue;
+        break;
     case KeyType::Date:
         return String::format("Date m_type - %f", m_numberValue);
     case KeyType::Number:
@@ -283,7 +286,13 @@
     default:
         return String();
     }
-    ASSERT_NOT_REACHED();
+
+    if (result.length() > 150) {
+        result.truncate(147);
+        result.append(WTF::ASCIILiteral("..."));
+    }
+
+    return result;
 }
 #endif
 

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp (195831 => 195832)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp	2016-01-29 19:46:01 UTC (rev 195831)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyRangeData.cpp	2016-01-29 19:47:03 UTC (rev 195832)
@@ -116,7 +116,13 @@
 #ifndef NDEBUG
 String IDBKeyRangeData::loggingString() const
 {
-    return makeString(lowerOpen ? "( " : "[ ", lowerKey.loggingString(), ", ", upperKey.loggingString(), upperOpen ? " )" : " ]");
+    auto result = makeString(lowerOpen ? "( " : "[ ", lowerKey.loggingString(), ", ", upperKey.loggingString(), upperOpen ? " )" : " ]");
+    if (result.length() > 400) {
+        result.truncate(397);
+        result.append(WTF::ASCIILiteral("..."));
+    }
+
+    return result;
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to