Title: [163401] trunk/Source
Revision
163401
Author
[email protected]
Date
2014-02-04 13:50:25 -0800 (Tue, 04 Feb 2014)

Log Message

Rename StringImpl::getCharacters to StringImpl::characters
https://bugs.webkit.org/show_bug.cgi?id=128205

Reviewed by Antti Koivisto.

Source/_javascript_Core:

Update for WTF changes.

* runtime/JSStringJoiner.cpp:
(JSC::joinStrings):
* runtime/StringPrototype.cpp:
(JSC::splitStringByOneCharacterImpl):

Source/WebCore:

Update for WTF changes.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::createTextRuns):

Source/WTF:

This lets us use StringImpl::getCharacters for the upconverting version.
Also, change StringImpl::characters<UChar>() to call characters16() instead of deprecatedCharacters()
and audit all call sites to make sure we weren't relying on upconversion anywhere.

* wtf/text/AtomicString.cpp:
(WTF::findString):
* wtf/text/StringImpl.cpp:
(WTF::StringImpl::simplifyMatchedCharactersToSpace):
* wtf/text/StringImpl.h:
(WTF::StringImpl::characters<LChar>):
(WTF::StringImpl::characters<UChar>):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (163400 => 163401)


--- trunk/Source/_javascript_Core/ChangeLog	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/_javascript_Core/ChangeLog	2014-02-04 21:50:25 UTC (rev 163401)
@@ -1,3 +1,17 @@
+2014-02-04  Anders Carlsson  <[email protected]>
+
+        Rename StringImpl::getCharacters to StringImpl::characters
+        https://bugs.webkit.org/show_bug.cgi?id=128205
+
+        Reviewed by Antti Koivisto.
+
+        Update for WTF changes.
+
+        * runtime/JSStringJoiner.cpp:
+        (JSC::joinStrings):
+        * runtime/StringPrototype.cpp:
+        (JSC::splitStringByOneCharacterImpl):
+
 2014-02-04  Mark Hahnenberg  <[email protected]>
 
         Fix a mismatch of uint64_t and size_t on 32-bit platforms.

Modified: trunk/Source/_javascript_Core/runtime/JSStringJoiner.cpp (163400 => 163401)


--- trunk/Source/_javascript_Core/runtime/JSStringJoiner.cpp	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/_javascript_Core/runtime/JSStringJoiner.cpp	2014-02-04 21:50:25 UTC (rev 163401)
@@ -80,7 +80,7 @@
     CharacterType* data;
     RefPtr<StringImpl> outputStringImpl = StringImpl::tryCreateUninitialized(outputLength, data);
     if (!outputStringImpl)
-        return PassRefPtr<StringImpl>();
+        return nullptr;
 
     const String firstString = strings.first();
     appendStringToData(data, firstString);
@@ -90,7 +90,7 @@
         appendStringToData(data, strings[i]);
     }
 
-    ASSERT(data == (outputStringImpl->getCharacters<CharacterType>() + outputStringImpl->length()));
+    ASSERT(data == (outputStringImpl->characters<CharacterType>() + outputStringImpl->length()));
     return outputStringImpl.release();
 }
 

Modified: trunk/Source/_javascript_Core/runtime/StringPrototype.cpp (163400 => 163401)


--- trunk/Source/_javascript_Core/runtime/StringPrototype.cpp	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/_javascript_Core/runtime/StringPrototype.cpp	2014-02-04 21:50:25 UTC (rev 163401)
@@ -942,7 +942,7 @@
 {
     // 12. Let q = p.
     size_t matchPosition;
-    const CharacterType* characters = string->getCharacters<CharacterType>();
+    const CharacterType* characters = string->characters<CharacterType>();
     // 13. Repeat, while q != s
     //   a. Call SplitMatch(S, q, R) and let z be its MatchResult result.
     //   b. If z is failure, then let q = q+1.

Modified: trunk/Source/WTF/ChangeLog (163400 => 163401)


--- trunk/Source/WTF/ChangeLog	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/WTF/ChangeLog	2014-02-04 21:50:25 UTC (rev 163401)
@@ -1,5 +1,24 @@
 2014-02-04  Anders Carlsson  <[email protected]>
 
+        Rename StringImpl::getCharacters to StringImpl::characters
+        https://bugs.webkit.org/show_bug.cgi?id=128205
+
+        Reviewed by Antti Koivisto.
+
+        This lets us use StringImpl::getCharacters for the upconverting version.
+        Also, change StringImpl::characters<UChar>() to call characters16() instead of deprecatedCharacters()
+        and audit all call sites to make sure we weren't relying on upconversion anywhere.
+
+        * wtf/text/AtomicString.cpp:
+        (WTF::findString):
+        * wtf/text/StringImpl.cpp:
+        (WTF::StringImpl::simplifyMatchedCharactersToSpace):
+        * wtf/text/StringImpl.h:
+        (WTF::StringImpl::characters<LChar>):
+        (WTF::StringImpl::characters<UChar>):
+
+2014-02-04  Anders Carlsson  <[email protected]>
+
         Rename equalNonNull to equal and make it take const StringImpl& instead
         https://bugs.webkit.org/show_bug.cgi?id=128206
 

Modified: trunk/Source/WTF/wtf/text/AtomicString.cpp (163400 => 163401)


--- trunk/Source/WTF/wtf/text/AtomicString.cpp	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/WTF/wtf/text/AtomicString.cpp	2014-02-04 21:50:25 UTC (rev 163401)
@@ -400,7 +400,7 @@
 template<typename CharacterType>
 static inline HashSet<StringImpl*>::iterator findString(const StringImpl* stringImpl)
 {
-    HashAndCharacters<CharacterType> buffer = { stringImpl->existingHash(), stringImpl->getCharacters<CharacterType>(), stringImpl->length() };
+    HashAndCharacters<CharacterType> buffer = { stringImpl->existingHash(), stringImpl->characters<CharacterType>(), stringImpl->length() };
     return stringTable().find<HashAndCharactersTranslator<CharacterType>>(buffer);
 }
 

Modified: trunk/Source/WTF/wtf/text/StringImpl.cpp (163400 => 163401)


--- trunk/Source/WTF/wtf/text/StringImpl.cpp	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/WTF/wtf/text/StringImpl.cpp	2014-02-04 21:50:25 UTC (rev 163401)
@@ -817,7 +817,7 @@
 {
     StringBuffer<CharType> data(m_length);
 
-    const CharType* from = getCharacters<CharType>();
+    const CharType* from = characters<CharType>();
     const CharType* fromend = from + m_length;
     int outc = 0;
     bool changedToSpace = false;

Modified: trunk/Source/WTF/wtf/text/StringImpl.h (163400 => 163401)


--- trunk/Source/WTF/wtf/text/StringImpl.h	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/WTF/wtf/text/StringImpl.h	2014-02-04 21:50:25 UTC (rev 163401)
@@ -453,7 +453,7 @@
     }
 
     template <typename CharType>
-    ALWAYS_INLINE const CharType * getCharacters() const;
+    ALWAYS_INLINE const CharType *characters() const;
 
     size_t cost() const
     {
@@ -881,10 +881,10 @@
 ALWAYS_INLINE PassRef<StringImpl> StringImpl::constructInternal<UChar>(StringImpl* impl, unsigned length) { return adoptRef(*new (NotNull, impl) StringImpl(length)); }
 
 template <>
-ALWAYS_INLINE const LChar* StringImpl::getCharacters<LChar>() const { return characters8(); }
+ALWAYS_INLINE const LChar* StringImpl::characters<LChar>() const { return characters8(); }
 
 template <>
-ALWAYS_INLINE const UChar* StringImpl::getCharacters<UChar>() const { return deprecatedCharacters(); }
+ALWAYS_INLINE const UChar* StringImpl::characters<UChar>() const { return characters16(); }
 
 WTF_EXPORT_STRING_API bool equal(const StringImpl*, const StringImpl*);
 WTF_EXPORT_STRING_API bool equal(const StringImpl*, const LChar*);

Modified: trunk/Source/WebCore/ChangeLog (163400 => 163401)


--- trunk/Source/WebCore/ChangeLog	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/WebCore/ChangeLog	2014-02-04 21:50:25 UTC (rev 163401)
@@ -1,5 +1,17 @@
 2014-02-04  Anders Carlsson  <[email protected]>
 
+        Rename StringImpl::getCharacters to StringImpl::characters
+        https://bugs.webkit.org/show_bug.cgi?id=128205
+
+        Reviewed by Antti Koivisto.
+
+        Update for WTF changes.
+
+        * rendering/SimpleLineLayout.cpp:
+        (WebCore::SimpleLineLayout::createTextRuns):
+
+2014-02-04  Anders Carlsson  <[email protected]>
+
         Rename equalNonNull to equal and make it take const StringImpl& instead
         https://bugs.webkit.org/show_bug.cgi?id=128206
 

Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (163400 => 163401)


--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2014-02-04 21:40:21 UTC (rev 163400)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp	2014-02-04 21:50:25 UTC (rev 163401)
@@ -414,7 +414,7 @@
 {
     const Style style(flow.style());
 
-    const CharacterType* text = textRenderer.text()->getCharacters<CharacterType>();
+    const CharacterType* text = textRenderer.text()->characters<CharacterType>();
     const unsigned textLength = textRenderer.textLength();
 
     LayoutUnit borderAndPaddingBefore = flow.borderAndPaddingBefore();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to