Title: [123744] trunk/Source
Revision
123744
Author
yu...@chromium.org
Date
2012-07-26 07:49:36 -0700 (Thu, 26 Jul 2012)

Log Message

Unreviewed. Revert r123740 as it breaks AppleMac compilation.

Source/WebCore:

* WebCore.exp.in:
* inspector/InspectorMemoryAgent.cpp:
(WebCore):

Source/WTF:

* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (123743 => 123744)


--- trunk/Source/WTF/ChangeLog	2012-07-26 14:40:08 UTC (rev 123743)
+++ trunk/Source/WTF/ChangeLog	2012-07-26 14:49:36 UTC (rev 123744)
@@ -1,5 +1,12 @@
 2012-07-26  Yury Semikhatsky  <yu...@chromium.org>
 
+        Unreviewed. Revert r123740 as it breaks AppleMac compilation.
+
+        * wtf/text/StringImpl.cpp:
+        * wtf/text/StringImpl.h:
+
+2012-07-26  Yury Semikhatsky  <yu...@chromium.org>
+
         Web Inspector: move StringImpl size calculation to StringImpl
         https://bugs.webkit.org/show_bug.cgi?id=92359
 

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (123743 => 123744)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2012-07-26 14:40:08 UTC (rev 123743)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2012-07-26 14:49:36 UTC (rev 123744)
@@ -1693,19 +1693,4 @@
     return terminatedString.release();
 }
 
-size_t StringImpl::sizeInBytes() const
-{
-    // FIXME: support substrings
-    size_t size = length();
-    if (is8Bit()) {
-        if (has16BitShadow()) {
-            size += 2 * size;
-            if (hasTerminatingNullCharacter())
-                size += 2;
-        }
-    } else
-        size *= 2;
-    return size + sizeof(*this);
-}
-
 } // namespace WTF

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (123743 => 123744)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2012-07-26 14:40:08 UTC (rev 123743)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2012-07-26 14:49:36 UTC (rev 123744)
@@ -385,8 +385,6 @@
         return m_length;
     }
 
-    size_t sizeInBytes() const;
-
     bool has16BitShadow() const { return m_hashAndFlags & s_hashFlagHas16BitShadow; }
     WTF_EXPORT_PRIVATE void upconvertCharacters(unsigned, unsigned) const;
     bool isIdentifier() const { return m_hashAndFlags & s_hashFlagIsIdentifier; }

Modified: trunk/Source/WebCore/ChangeLog (123743 => 123744)


--- trunk/Source/WebCore/ChangeLog	2012-07-26 14:40:08 UTC (rev 123743)
+++ trunk/Source/WebCore/ChangeLog	2012-07-26 14:49:36 UTC (rev 123744)
@@ -1,5 +1,13 @@
 2012-07-26  Yury Semikhatsky  <yu...@chromium.org>
 
+        Unreviewed. Revert r123740 as it breaks AppleMac compilation.
+
+        * WebCore.exp.in:
+        * inspector/InspectorMemoryAgent.cpp:
+        (WebCore):
+
+2012-07-26  Yury Semikhatsky  <yu...@chromium.org>
+
         Unreviewed. Fix AppleMac compilation after r123740.
 
         * WebCore.exp.in: Added missing symbol.

Modified: trunk/Source/WebCore/WebCore.exp.in (123743 => 123744)


--- trunk/Source/WebCore/WebCore.exp.in	2012-07-26 14:40:08 UTC (rev 123743)
+++ trunk/Source/WebCore/WebCore.exp.in	2012-07-26 14:49:36 UTC (rev 123744)
@@ -1039,7 +1039,6 @@
 __ZN7WebCore9toElementEN3JSC7JSValueE
 __ZN7WebCore9unionRectERKN3WTF6VectorINS_9FloatRectELm0EEE
 __ZNK3JSC8Bindings10RootObject12globalObjectEv
-__ZNK3WTF10StringImpl11sizeInBytesEv
 __ZNK3WTF6String14createCFStringEv
 __ZNK7WebCore10Credential11hasPasswordEv
 __ZNK7WebCore10Credential11persistenceEv

Modified: trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp (123743 => 123744)


--- trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-07-26 14:40:08 UTC (rev 123743)
+++ trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp	2012-07-26 14:49:36 UTC (rev 123744)
@@ -110,6 +110,21 @@
     return node->nodeName().lower();
 }
 
+size_t stringSize(StringImpl* string)
+{
+    // FIXME: support substrings
+    size_t size = string->length();
+    if (string->is8Bit()) {
+        if (string->has16BitShadow()) {
+            size += 2 * size;
+            if (string->hasTerminatingNullCharacter())
+                size += 2;
+        }
+    } else
+        size *= 2;
+    return size + sizeof(*string);
+}
+
 typedef HashSet<StringImpl*, PtrHash<StringImpl*> > StringImplIdentitySet;
 
 class CharacterDataStatistics {
@@ -128,7 +143,7 @@
             return;
         m_domStringImplSet.add(dataImpl);
 
-        m_characterDataSize += dataImpl->sizeInBytes();
+        m_characterDataSize += stringSize(dataImpl);
     }
 
     bool contains(StringImpl* s) { return m_domStringImplSet.contains(s); }
@@ -273,7 +288,7 @@
 
     virtual void visitJSExternalString(StringImpl* string)
     {
-        int size = string->sizeInBytes();
+        int size = stringSize(string);
         m_jsExternalStringSize += size;
         if (m_characterDataStatistics.contains(string))
             m_sharedStringSize += size;
@@ -337,7 +352,7 @@
     virtual void visitJSExternalString(StringImpl* string)
     {
         if (m_visitedObjects.add(string).isNewEntry)
-            m_jsExternalStringSize += string->sizeInBytes();
+            m_jsExternalStringSize += stringSize(string);
     }
 
     VisitedObjects& m_visitedObjects;
@@ -491,7 +506,7 @@
     {
         if (string.isNull() || visited(string.impl()))
             return;
-        countObjectSize(objectType, string.impl()->sizeInBytes());
+        countObjectSize(objectType, stringSize(string.impl()));
     }
 
     virtual void countObjectSize(ObjectType objectType, size_t size) OVERRIDE
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to