<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[161844] trunk/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/161844">161844</a></dd>
<dt>Author</dt> <dd>weinig@apple.com</dd>
<dt>Date</dt> <dd>2014-01-12 17:28:53 -0800 (Sun, 12 Jan 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>TextBreakIterator's should support Latin-1 for all iterator types (Part 1)
https://bugs.webkit.org/show_bug.cgi?id=126856

Reviewed by Darin Adler.

- Do some initial cleanup before adding complete Latin-1 support.

* platform/text/TextBreakIterator.cpp:
Remove non-ICU acquireLineBreakIterator() implementation.

* platform/text/TextBreakIterator.h:
- Changes acquireLineBreakIterator() to take a StringView.

* platform/text/TextBreakIteratorICU.cpp:
- Refactor iterator initialization and setting of text on the iterator.
- Add support for using a Latin-1 provider (this is not currently used).

* platform/text/icu/UTextProviderLatin1.cpp:
* platform/text/icu/UTextProviderLatin1.h:
- Add back non-context aware Latin-1 provider (from <a href="http://trac.webkit.org/projects/webkit/changeset/129662">r129662</a>).
- Rename context aware provider.

* platform/text/icu/UTextProviderUTF16.cpp:
* platform/text/icu/UTextProviderUTF16.h:
- Rename context aware provider.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorcpp">trunk/Source/WebCore/platform/text/TextBreakIterator.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorh">trunk/Source/WebCore/platform/text/TextBreakIterator.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextBreakIteratorICUcpp">trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtexticuUTextProviderh">trunk/Source/WebCore/platform/text/icu/UTextProvider.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtexticuUTextProviderLatin1cpp">trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtexticuUTextProviderLatin1h">trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtexticuUTextProviderUTF16cpp">trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtexticuUTextProviderUTF16h">trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/ChangeLog        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2014-01-12  Sam Weinig  &lt;sam@webkit.org&gt;
+
+        TextBreakIterator's should support Latin-1 for all iterator types (Part 1)
+        https://bugs.webkit.org/show_bug.cgi?id=126856
+
+        Reviewed by Darin Adler.
+
+        - Do some initial cleanup before adding complete Latin-1 support.
+
+        * platform/text/TextBreakIterator.cpp:
+        Remove non-ICU acquireLineBreakIterator() implementation.
+
+        * platform/text/TextBreakIterator.h:
+        - Changes acquireLineBreakIterator() to take a StringView.
+
+        * platform/text/TextBreakIteratorICU.cpp:
+        - Refactor iterator initialization and setting of text on the iterator.
+        - Add support for using a Latin-1 provider (this is not currently used).
+
+        * platform/text/icu/UTextProviderLatin1.cpp:
+        * platform/text/icu/UTextProviderLatin1.h:
+        - Add back non-context aware Latin-1 provider (from r129662).
+        - Rename context aware provider.
+
+        * platform/text/icu/UTextProviderUTF16.cpp:
+        * platform/text/icu/UTextProviderUTF16.h:
+        - Rename context aware provider.
+
</ins><span class="cx"> 2014-01-12  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [WebGL] Error messages should use source code labels, not internal mangled symbols.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextBreakIterator.cpp (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIterator.cpp        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/TextBreakIterator.cpp        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -67,14 +67,4 @@
</span><span class="cx">     return textBreakCurrent(it);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if !USE(ICU_UNICODE)
-TextBreakIterator* acquireLineBreakIterator(const LChar* string, int length, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength)
-{
-    Vector&lt;UChar&gt; utf16string(length);
-    for (int i = 0; i &lt; length; ++i)
-        utf16string[i] = string[i];
-    return acquireLineBreakIterator(utf16string.data(), length, locale, priorContext, priorContextLength);
-}
-#endif
-
</del><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextBreakIterator.h (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIterator.h        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/TextBreakIterator.h        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -23,6 +23,7 @@
</span><span class="cx"> #define TextBreakIterator_h
</span><span class="cx"> 
</span><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><ins>+#include &lt;wtf/text/StringView.h&gt;
</ins><span class="cx"> #include &lt;wtf/unicode/Unicode.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -38,11 +39,11 @@
</span><span class="cx"> TextBreakIterator* cursorMovementIterator(const UChar*, int length);
</span><span class="cx"> 
</span><span class="cx"> TextBreakIterator* wordBreakIterator(const UChar*, int length);
</span><del>-TextBreakIterator* acquireLineBreakIterator(const LChar*, int length, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength);
-TextBreakIterator* acquireLineBreakIterator(const UChar*, int length, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength);
-void releaseLineBreakIterator(TextBreakIterator*);
</del><span class="cx"> TextBreakIterator* sentenceBreakIterator(const UChar*, int length);
</span><span class="cx"> 
</span><ins>+TextBreakIterator* acquireLineBreakIterator(StringView, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength);
+void releaseLineBreakIterator(TextBreakIterator*);
+
</ins><span class="cx"> int textBreakFirst(TextBreakIterator*);
</span><span class="cx"> int textBreakLast(TextBreakIterator*);
</span><span class="cx"> int textBreakNext(TextBreakIterator*);
</span><span class="lines">@@ -130,10 +131,7 @@
</span><span class="cx">         ASSERT(priorContextLength &lt;= priorContextCapacity);
</span><span class="cx">         const UChar* priorContext = priorContextLength ? &amp;m_priorContext[priorContextCapacity - priorContextLength] : 0;
</span><span class="cx">         if (!m_iterator) {
</span><del>-            if (m_string.is8Bit())
-                m_iterator = acquireLineBreakIterator(m_string.characters8(), m_string.length(), m_locale, priorContext, priorContextLength);
-            else
-                m_iterator = acquireLineBreakIterator(m_string.characters16(), m_string.length(), m_locale, priorContext, priorContextLength);
</del><ins>+            m_iterator = acquireLineBreakIterator(m_string, m_locale, priorContext, priorContextLength);
</ins><span class="cx">             m_cachedPriorContext = priorContext;
</span><span class="cx">             m_cachedPriorContextLength = priorContextLength;
</span><span class="cx">         } else if (priorContext != m_cachedPriorContext || priorContextLength != m_cachedPriorContextLength) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextBreakIteratorICUcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/TextBreakIteratorICU.cpp        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -26,218 +26,141 @@
</span><span class="cx"> #include &quot;UTextProviderLatin1.h&quot;
</span><span class="cx"> #include &quot;UTextProviderUTF16.h&quot;
</span><span class="cx"> #include &lt;wtf/Atomics.h&gt;
</span><ins>+#include &lt;wtf/text/StringView.h&gt;
</ins><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> using namespace WTF;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static TextBreakIterator* setUpIterator(bool&amp; createdIterator, TextBreakIterator*&amp; iterator, UBreakIteratorType type, const UChar* string, int length)
</del><ins>+// Iterator initialization
+
+static TextBreakIterator* initializeIterator(UBreakIteratorType type, const char* locale = currentTextBreakLocaleID())
</ins><span class="cx"> {
</span><del>-    if (!string)
-        return 0;
-
-    if (!createdIterator) {
-        UErrorCode openStatus = U_ZERO_ERROR;
-        iterator = reinterpret_cast&lt;TextBreakIterator*&gt;(ubrk_open(type, currentTextBreakLocaleID(), 0, 0, &amp;openStatus));
-        createdIterator = true;
-        ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), &quot;ICU could not open a break iterator: %s (%d)&quot;, u_errorName(openStatus), openStatus);
-    }
-    if (!iterator)
-        return 0;
-
-    UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setText(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), string, length, &amp;setTextStatus);
-    if (U_FAILURE(setTextStatus))
-        return 0;
-
</del><ins>+    UErrorCode openStatus = U_ZERO_ERROR;
+    TextBreakIterator* iterator = reinterpret_cast&lt;TextBreakIterator*&gt;(ubrk_open(type, locale, 0, 0, &amp;openStatus));
+    ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), &quot;ICU could not open a break iterator: %s (%d)&quot;, u_errorName(openStatus), openStatus);
</ins><span class="cx">     return iterator;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-TextBreakIterator* wordBreakIterator(const UChar* string, int length)
</del><ins>+#if !PLATFORM(IOS)
+static TextBreakIterator* initializeIteratorWithRules(const char* breakRules)
</ins><span class="cx"> {
</span><del>-    static bool createdWordBreakIterator = false;
-    static TextBreakIterator* staticWordBreakIterator;
-    return setUpIterator(createdWordBreakIterator, staticWordBreakIterator, UBRK_WORD, string, length);
</del><ins>+    UParseError parseStatus;
+    UErrorCode openStatus = U_ZERO_ERROR;
+    String rules(breakRules);
+    TextBreakIterator* iterator = reinterpret_cast&lt;TextBreakIterator*&gt;(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &amp;parseStatus, &amp;openStatus));
+    ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), &quot;ICU could not open a break iterator: %s (%d)&quot;, u_errorName(openStatus), openStatus);
+    return iterator;
</ins><span class="cx"> }
</span><ins>+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><del>-static UText emptyText = UTEXT_INITIALIZER;
</del><span class="cx"> 
</span><del>-TextBreakIterator* acquireLineBreakIterator(const LChar* string, int length, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength)
-{
-    UBreakIterator* iterator = LineBreakIteratorPool::sharedPool().take(locale);
-    if (!iterator)
-        return 0;
</del><ins>+// Iterator text setting
</ins><span class="cx"> 
</span><del>-    UTextWithBuffer textLocal;
-    textLocal.text = emptyText;
-    textLocal.text.extraSize = sizeof(textLocal.buffer);
-    textLocal.text.pExtra = textLocal.buffer;
-
-    UErrorCode openStatus = U_ZERO_ERROR;
-    UText* text = uTextOpenLatin1(&amp;textLocal, string, length, priorContext, priorContextLength, &amp;openStatus);
-    if (U_FAILURE(openStatus)) {
-        LOG_ERROR(&quot;textOpenUTF16 failed with status %d&quot;, openStatus);
-        return 0;
-    }
-
-    UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setUText(iterator, text, &amp;setTextStatus);
-    if (U_FAILURE(setTextStatus)) {
-        LOG_ERROR(&quot;ubrk_setUText failed with status %d&quot;, setTextStatus);
-        return 0;
-    }
-
-    utext_close(text);
-
-    return reinterpret_cast&lt;TextBreakIterator*&gt;(iterator);
-}
-
-TextBreakIterator* acquireLineBreakIterator(const UChar* string, int length, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength)
</del><ins>+static TextBreakIterator* setTextForIterator(TextBreakIterator&amp; iterator, StringView string)
</ins><span class="cx"> {
</span><del>-    UBreakIterator* iterator = LineBreakIteratorPool::sharedPool().take(locale);
-    if (!iterator)
-        return 0;
</del><ins>+    if (string.is8Bit()) {
+        UTextWithBuffer textLocal;
+        textLocal.text = UTEXT_INITIALIZER;
+        textLocal.text.extraSize = sizeof(textLocal.buffer);
+        textLocal.text.pExtra = textLocal.buffer;
</ins><span class="cx"> 
</span><del>-    UText textLocal = UTEXT_INITIALIZER;
</del><ins>+        UErrorCode openStatus = U_ZERO_ERROR;
+        UText* text = openLatin1UTextProvider(&amp;textLocal, string.characters8(), string.length(), &amp;openStatus);
+        if (U_FAILURE(openStatus)) {
+            LOG_ERROR(&quot;uTextOpenLatin1 failed with status %d&quot;, openStatus);
+            return nullptr;
+        }
</ins><span class="cx"> 
</span><del>-    UErrorCode openStatus = U_ZERO_ERROR;
-    UText* text = uTextOpenUTF16(&amp;textLocal, string, length, priorContext, priorContextLength, &amp;openStatus);
-    if (U_FAILURE(openStatus)) {
-        LOG_ERROR(&quot;textOpenUTF16 failed with status %d&quot;, openStatus);
-        return 0;
-    }
</del><ins>+        UErrorCode setTextStatus = U_ZERO_ERROR;
+        ubrk_setUText(reinterpret_cast&lt;UBreakIterator*&gt;(&amp;iterator), text, &amp;setTextStatus);
+        if (U_FAILURE(setTextStatus)) {
+            LOG_ERROR(&quot;ubrk_setUText failed with status %d&quot;, setTextStatus);
+            return nullptr;
+        }
</ins><span class="cx"> 
</span><del>-    UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setUText(iterator, text, &amp;setTextStatus);
-    if (U_FAILURE(setTextStatus)) {
-        LOG_ERROR(&quot;ubrk_setUText failed with status %d&quot;, setTextStatus);
-        return 0;
</del><ins>+        utext_close(text);
+    } else {
+        UErrorCode setTextStatus = U_ZERO_ERROR;
+        ubrk_setText(reinterpret_cast&lt;UBreakIterator*&gt;(&amp;iterator), string.characters16(), string.length(), &amp;setTextStatus);
+        if (U_FAILURE(setTextStatus))
+            return nullptr;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    utext_close(text);
-
-    return reinterpret_cast&lt;TextBreakIterator*&gt;(iterator);
</del><ins>+    return &amp;iterator;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void releaseLineBreakIterator(TextBreakIterator* iterator)
</del><ins>+static TextBreakIterator* setContextAwareTextForIterator(TextBreakIterator&amp; iterator, StringView string, const UChar* priorContext, unsigned priorContextLength)
</ins><span class="cx"> {
</span><del>-    ASSERT_ARG(iterator, iterator);
</del><ins>+    if (string.is8Bit()) {
+        UTextWithBuffer textLocal;
+        textLocal.text = UTEXT_INITIALIZER;
+        textLocal.text.extraSize = sizeof(textLocal.buffer);
+        textLocal.text.pExtra = textLocal.buffer;
</ins><span class="cx"> 
</span><del>-    LineBreakIteratorPool::sharedPool().put(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
-}
</del><ins>+        UErrorCode openStatus = U_ZERO_ERROR;
+        UText* text = openLatin1ContextAwareUTextProvider(&amp;textLocal, string.characters8(), string.length(), priorContext, priorContextLength, &amp;openStatus);
+        if (U_FAILURE(openStatus)) {
+            LOG_ERROR(&quot;openLatin1ContextAwareUTextProvider failed with status %d&quot;, openStatus);
+            return nullptr;
+        }
</ins><span class="cx"> 
</span><del>-static TextBreakIterator* nonSharedCharacterBreakIterator;
</del><ins>+        UErrorCode setTextStatus = U_ZERO_ERROR;
+        ubrk_setUText(reinterpret_cast&lt;UBreakIterator*&gt;(&amp;iterator), text, &amp;setTextStatus);
+        if (U_FAILURE(setTextStatus)) {
+            LOG_ERROR(&quot;ubrk_setUText failed with status %d&quot;, setTextStatus);
+            return nullptr;
+        }
</ins><span class="cx"> 
</span><del>-static inline bool compareAndSwapNonSharedCharacterBreakIterator(TextBreakIterator* expected, TextBreakIterator* newValue)
-{
-#if ENABLE(COMPARE_AND_SWAP)
-    return weakCompareAndSwap(reinterpret_cast&lt;void**&gt;(&amp;nonSharedCharacterBreakIterator), expected, newValue);
-#else
-    DEFINE_STATIC_LOCAL(Mutex, nonSharedCharacterBreakIteratorMutex, ());
-    MutexLocker locker(nonSharedCharacterBreakIteratorMutex);
-    if (nonSharedCharacterBreakIterator != expected)
-        return false;
-    nonSharedCharacterBreakIterator = newValue;
-    return true;
-#endif
-}
</del><ins>+        utext_close(text);
+    } else {
+        UText textLocal = UTEXT_INITIALIZER;
</ins><span class="cx"> 
</span><del>-NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length)
-{
-    m_iterator = nonSharedCharacterBreakIterator;
-    bool createdIterator = m_iterator &amp;&amp; compareAndSwapNonSharedCharacterBreakIterator(m_iterator, 0);
-    m_iterator = setUpIterator(createdIterator, m_iterator, UBRK_CHARACTER, buffer, length);
-}
</del><ins>+        UErrorCode openStatus = U_ZERO_ERROR;
+        UText* text = openUTF16ContextAwareUTextProvider(&amp;textLocal, string.characters16(), string.length(), priorContext, priorContextLength, &amp;openStatus);
+        if (U_FAILURE(openStatus)) {
+            LOG_ERROR(&quot;openUTF16ContextAwareUTextProvider failed with status %d&quot;, openStatus);
+            return 0;
+        }
</ins><span class="cx"> 
</span><del>-NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
-{
-    if (!compareAndSwapNonSharedCharacterBreakIterator(0, m_iterator))
-        ubrk_close(reinterpret_cast&lt;UBreakIterator*&gt;(m_iterator));
-}
</del><ins>+        UErrorCode setTextStatus = U_ZERO_ERROR;
+        ubrk_setUText(reinterpret_cast&lt;UBreakIterator*&gt;(&amp;iterator), text, &amp;setTextStatus);
+        if (U_FAILURE(setTextStatus)) {
+            LOG_ERROR(&quot;ubrk_setUText failed with status %d&quot;, setTextStatus);
+            return nullptr;
+        }
</ins><span class="cx"> 
</span><del>-TextBreakIterator* sentenceBreakIterator(const UChar* string, int length)
-{
-    static bool createdSentenceBreakIterator = false;
-    static TextBreakIterator* staticSentenceBreakIterator;
-    return setUpIterator(createdSentenceBreakIterator, staticSentenceBreakIterator, UBRK_SENTENCE, string, length);
-}
</del><ins>+        utext_close(text);
+    }
</ins><span class="cx"> 
</span><del>-int textBreakFirst(TextBreakIterator* iterator)
-{
-    return ubrk_first(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
</del><ins>+    return &amp;iterator;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-int textBreakLast(TextBreakIterator* iterator)
-{
-    return ubrk_last(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
-}
</del><span class="cx"> 
</span><del>-int textBreakNext(TextBreakIterator* iterator)
-{
-    return ubrk_next(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
-}
</del><ins>+// Static iterators
</ins><span class="cx"> 
</span><del>-int textBreakPrevious(TextBreakIterator* iterator)
</del><ins>+TextBreakIterator* wordBreakIterator(const UChar* buffer, int length)
</ins><span class="cx"> {
</span><del>-    return ubrk_previous(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
-}
</del><ins>+    static TextBreakIterator* staticWordBreakIterator = initializeIterator(UBRK_WORD);
+    if (!staticWordBreakIterator)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-int textBreakPreceding(TextBreakIterator* iterator, int pos)
-{
-    return ubrk_preceding(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), pos);
</del><ins>+    return setTextForIterator(*staticWordBreakIterator, StringView(buffer, length));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-int textBreakFollowing(TextBreakIterator* iterator, int pos)
</del><ins>+TextBreakIterator* sentenceBreakIterator(const UChar* buffer, int length)
</ins><span class="cx"> {
</span><del>-    return ubrk_following(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), pos);
-}
</del><ins>+    static TextBreakIterator* staticSentenceBreakIterator = initializeIterator(UBRK_SENTENCE);
+    if (!staticSentenceBreakIterator)
+        return nullptr;
</ins><span class="cx"> 
</span><del>-int textBreakCurrent(TextBreakIterator* iterator)
-{
-    return ubrk_current(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
</del><ins>+    return setTextForIterator(*staticSentenceBreakIterator, StringView(buffer, length));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool isTextBreak(TextBreakIterator* iterator, int position)
</del><ins>+TextBreakIterator* cursorMovementIterator(const UChar* buffer, int length)
</ins><span class="cx"> {
</span><del>-    return ubrk_isBoundary(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), position);
-}
-
-bool isWordTextBreak(TextBreakIterator* iterator)
-{
-    int ruleStatus = ubrk_getRuleStatus(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
-    return ruleStatus != UBRK_WORD_NONE;
-}
-
</del><span class="cx"> #if !PLATFORM(IOS)
</span><del>-static TextBreakIterator* setUpIteratorWithRules(bool&amp; createdIterator, TextBreakIterator*&amp; iterator, const char* breakRules, const UChar* string, int length)
-{
-    if (!string)
-        return 0;
-
-    if (!createdIterator) {
-        UParseError parseStatus;
-        UErrorCode openStatus = U_ZERO_ERROR;
-        String rules(breakRules);
-        iterator = reinterpret_cast&lt;TextBreakIterator*&gt;(ubrk_openRules(rules.characters(), rules.length(), 0, 0, &amp;parseStatus, &amp;openStatus));
-        createdIterator = true;
-        ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), &quot;ICU could not open a break iterator: %s (%d)&quot;, u_errorName(openStatus), openStatus);
-    }
-    if (!iterator)
-        return 0;
-
-    UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setText(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), string, length, &amp;setTextStatus);
-    if (U_FAILURE(setTextStatus))
-        return 0;
-
-    return iterator;
-}
-#endif // !PLATFORM(IOS)
-
-TextBreakIterator* cursorMovementIterator(const UChar* string, int length)
-{
-#if !PLATFORM(IOS)
</del><span class="cx">     // This rule set is based on character-break iterator rules of ICU 4.0
</span><span class="cx">     // &lt;http://source.icu-project.org/repos/icu/icu/tags/release-4-0/source/data/brkitr/char.txt&gt;.
</span><span class="cx">     // The major differences from the original ones are listed below:
</span><span class="lines">@@ -320,33 +243,116 @@
</span><span class="cx">         &quot;$Mal1 $MalV $Mal0;&quot;               // Malayalam Virama (backward)
</span><span class="cx">         &quot;!!safe_reverse;&quot;
</span><span class="cx">         &quot;!!safe_forward;&quot;;
</span><del>-    static bool createdCursorMovementIterator = false;
-    static TextBreakIterator* staticCursorMovementIterator;
-    return setUpIteratorWithRules(createdCursorMovementIterator, staticCursorMovementIterator, kRules, string, length);
</del><ins>+    static TextBreakIterator* staticCursorMovementIterator = initializeIteratorWithRules(kRules);
</ins><span class="cx"> #else // PLATFORM(IOS)
</span><span class="cx">     // Use the special Thai character break iterator for all locales
</span><del>-    static bool createdCursorBreakIterator;
-    static TextBreakIterator* staticCursorBreakIterator;
</del><ins>+    static TextBreakIterator* staticCursorMovementIterator = createSharedIterator(UBRK_CHARACTER, &quot;th&quot;);
+#endif // !PLATFORM(IOS)
</ins><span class="cx"> 
</span><del>-    if (!string)
</del><ins>+    if (!staticCursorMovementIterator)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (!createdCursorBreakIterator) {
-        UErrorCode openStatus = U_ZERO_ERROR;
-        staticCursorBreakIterator = reinterpret_cast&lt;TextBreakIterator*&gt;(ubrk_open(UBRK_CHARACTER, &quot;th&quot;, 0, 0, &amp;openStatus));
-        createdCursorBreakIterator = true;
-        ASSERT_WITH_MESSAGE(U_SUCCESS(openStatus), &quot;ICU could not open a break iterator: %s (%d)&quot;, u_errorName(openStatus), openStatus);
-    }
-    if (!staticCursorBreakIterator)
-        return nullptr;
</del><ins>+    return setTextForIterator(*staticCursorMovementIterator, StringView(buffer, length));
+}
</ins><span class="cx"> 
</span><del>-    UErrorCode setTextStatus = U_ZERO_ERROR;
-    ubrk_setText(reinterpret_cast&lt;UBreakIterator*&gt;(staticCursorBreakIterator), string, length, &amp;setTextStatus);
-    if (U_FAILURE(setTextStatus))
</del><ins>+TextBreakIterator* acquireLineBreakIterator(StringView string, const AtomicString&amp; locale, const UChar* priorContext, unsigned priorContextLength)
+{
+    TextBreakIterator* iterator = reinterpret_cast&lt;TextBreakIterator*&gt;(LineBreakIteratorPool::sharedPool().take(locale));
+    if (!iterator)
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    return staticCursorBreakIterator;
-#endif // !PLATFORM(IOS)
</del><ins>+    return setContextAwareTextForIterator(*iterator, string, priorContext, priorContextLength);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void releaseLineBreakIterator(TextBreakIterator* iterator)
+{
+    ASSERT_ARG(iterator, iterator);
+
+    LineBreakIteratorPool::sharedPool().put(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
</ins><span class="cx"> }
</span><ins>+
+static TextBreakIterator* nonSharedCharacterBreakIterator;
+
+static inline bool compareAndSwapNonSharedCharacterBreakIterator(TextBreakIterator* expected, TextBreakIterator* newValue)
+{
+#if ENABLE(COMPARE_AND_SWAP)
+    return weakCompareAndSwap(reinterpret_cast&lt;void**&gt;(&amp;nonSharedCharacterBreakIterator), expected, newValue);
+#else
+    DEFINE_STATIC_LOCAL(Mutex, nonSharedCharacterBreakIteratorMutex, ());
+    MutexLocker locker(nonSharedCharacterBreakIteratorMutex);
+    if (nonSharedCharacterBreakIterator != expected)
+        return false;
+    nonSharedCharacterBreakIterator = newValue;
+    return true;
+#endif
+}
+
+NonSharedCharacterBreakIterator::NonSharedCharacterBreakIterator(const UChar* buffer, int length)
+{
+    m_iterator = nonSharedCharacterBreakIterator;
+
+    bool createdIterator = m_iterator &amp;&amp; compareAndSwapNonSharedCharacterBreakIterator(m_iterator, 0);
+    if (!createdIterator)
+        m_iterator = initializeIterator(UBRK_CHARACTER);
+    if (!m_iterator)
+        return;
+
+    m_iterator = setTextForIterator(*m_iterator, StringView(buffer, length));
+}
+
+NonSharedCharacterBreakIterator::~NonSharedCharacterBreakIterator()
+{
+    if (!compareAndSwapNonSharedCharacterBreakIterator(0, m_iterator))
+        ubrk_close(reinterpret_cast&lt;UBreakIterator*&gt;(m_iterator));
+}
+
+
+// Iterator implemenation.
+
+int textBreakFirst(TextBreakIterator* iterator)
+{
+    return ubrk_first(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
+}
+
+int textBreakLast(TextBreakIterator* iterator)
+{
+    return ubrk_last(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
+}
+
+int textBreakNext(TextBreakIterator* iterator)
+{
+    return ubrk_next(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
+}
+
+int textBreakPrevious(TextBreakIterator* iterator)
+{
+    return ubrk_previous(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
+}
+
+int textBreakPreceding(TextBreakIterator* iterator, int pos)
+{
+    return ubrk_preceding(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), pos);
+}
+
+int textBreakFollowing(TextBreakIterator* iterator, int pos)
+{
+    return ubrk_following(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), pos);
+}
+
+int textBreakCurrent(TextBreakIterator* iterator)
+{
+    return ubrk_current(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
+}
+
+bool isTextBreak(TextBreakIterator* iterator, int position)
+{
+    return ubrk_isBoundary(reinterpret_cast&lt;UBreakIterator*&gt;(iterator), position);
+}
+
+bool isWordTextBreak(TextBreakIterator* iterator)
+{
+    int ruleStatus = ubrk_getRuleStatus(reinterpret_cast&lt;UBreakIterator*&gt;(iterator));
+    return ruleStatus != UBRK_WORD_NONE;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformtexticuUTextProviderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/icu/UTextProvider.h (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/icu/UTextProvider.h        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/icu/UTextProvider.h        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -46,7 +46,7 @@
</span><span class="cx">     return UTextProviderContext::PriorContext;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void uTextInitialize(UText* text, const UTextFuncs* funcs, const void* string, unsigned length, const UChar* priorContext, int priorContextLength)
</del><ins>+inline void initializeContextAwareUTextProvider(UText* text, const UTextFuncs* funcs, const void* string, unsigned length, const UChar* priorContext, int priorContextLength)
</ins><span class="cx"> {
</span><span class="cx">     text-&gt;pFuncs = funcs;
</span><span class="cx">     text-&gt;providerProperties = 1 &lt;&lt; UTEXT_PROVIDER_STABLE_CHUNKS;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtexticuUTextProviderLatin1cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -31,14 +31,244 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static inline UTextProviderContext textLatin1GetCurrentContext(const UText* text)
</del><ins>+// Latin1 provider
+
+static UText* uTextLatin1Clone(UText*, const UText*, UBool, UErrorCode*);
+static int64_t uTextLatin1NativeLength(UText*);
+static UBool uTextLatin1Access(UText*, int64_t, UBool);
+static int32_t uTextLatin1Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
+static int64_t uTextLatin1MapOffsetToNative(const UText*);
+static int32_t uTextLatin1MapNativeIndexToUTF16(const UText*, int64_t);
+static void uTextLatin1Close(UText*);
+
+static struct UTextFuncs uTextLatin1Funcs = {
+    sizeof(UTextFuncs),
+    0,
+    0,
+    0,
+    uTextLatin1Clone,
+    uTextLatin1NativeLength,
+    uTextLatin1Access,
+    uTextLatin1Extract,
+    nullptr,
+    nullptr,
+    uTextLatin1MapOffsetToNative,
+    uTextLatin1MapNativeIndexToUTF16,
+    uTextLatin1Close,
+    nullptr,
+    nullptr,
+    nullptr
+};
+
+static UText* uTextLatin1Clone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
</ins><span class="cx"> {
</span><ins>+    ASSERT_UNUSED(deep, !deep);
+
+    if (U_FAILURE(*status))
+        return 0;
+
+    UText* result = utext_setup(destination, sizeof(UChar) * (UTextWithBufferInlineCapacity + 1), status);
+    if (U_FAILURE(*status))
+        return destination;
+    
+    result-&gt;providerProperties = source-&gt;providerProperties;
+    
+    // Point at the same position, but with an empty buffer.
+    result-&gt;chunkNativeStart = source-&gt;chunkNativeStart;
+    result-&gt;chunkNativeLimit = source-&gt;chunkNativeStart;
+    result-&gt;nativeIndexingLimit = source-&gt;chunkNativeStart;
+    result-&gt;chunkOffset = 0;
+    result-&gt;context = source-&gt;context;
+    result-&gt;a = source-&gt;a;
+    result-&gt;pFuncs = &amp;uTextLatin1Funcs;
+    result-&gt;chunkContents = (UChar*)result-&gt;pExtra;
+    memset(const_cast&lt;UChar*&gt;(result-&gt;chunkContents), 0, sizeof(UChar) * (UTextWithBufferInlineCapacity + 1));
+
+    return result;
+}
+
+static int64_t uTextLatin1NativeLength(UText* uText)
+{
+    return uText-&gt;a;
+}
+
+static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+{
+    int64_t length = uText-&gt;a;
+
+    if (forward) {
+        if (index &lt; uText-&gt;chunkNativeLimit &amp;&amp; index &gt;= uText-&gt;chunkNativeStart) {
+            // Already inside the buffer. Set the new offset.
+            uText-&gt;chunkOffset = static_cast&lt;int32_t&gt;(index - uText-&gt;chunkNativeStart);
+            return TRUE;
+        }
+        if (index &gt;= length &amp;&amp; uText-&gt;chunkNativeLimit == length) {
+            // Off the end of the buffer, but we can't get it.
+            uText-&gt;chunkOffset = uText-&gt;chunkLength;
+            return FALSE;
+        }
+    } else {
+        if (index &lt;= uText-&gt;chunkNativeLimit &amp;&amp; index &gt; uText-&gt;chunkNativeStart) {
+            // Already inside the buffer. Set the new offset.
+            uText-&gt;chunkOffset = static_cast&lt;int32_t&gt;(index - uText-&gt;chunkNativeStart);
+            return TRUE;
+        }
+        if (!index &amp;&amp; !uText-&gt;chunkNativeStart) {
+            // Already at the beginning; can't go any farther.
+            uText-&gt;chunkOffset = 0;
+            return FALSE;
+        }
+    }
+    
+    if (forward) {
+        uText-&gt;chunkNativeStart = index;
+        uText-&gt;chunkNativeLimit = uText-&gt;chunkNativeStart + UTextWithBufferInlineCapacity;
+        if (uText-&gt;chunkNativeLimit &gt; length)
+            uText-&gt;chunkNativeLimit = length;
+
+        uText-&gt;chunkOffset = 0;
+    } else {
+        uText-&gt;chunkNativeLimit = index;
+        if (uText-&gt;chunkNativeLimit &gt; length)
+            uText-&gt;chunkNativeLimit = length;
+
+        uText-&gt;chunkNativeStart = uText-&gt;chunkNativeLimit -  UTextWithBufferInlineCapacity;
+        if (uText-&gt;chunkNativeStart &lt; 0)
+            uText-&gt;chunkNativeStart = 0;
+
+        uText-&gt;chunkOffset = uText-&gt;chunkLength;
+    }
+    uText-&gt;chunkLength = static_cast&lt;int32_t&gt;(uText-&gt;chunkNativeLimit - uText-&gt;chunkNativeStart);
+
+    StringImpl::copyChars(const_cast&lt;UChar*&gt;(uText-&gt;chunkContents), static_cast&lt;const LChar*&gt;(uText-&gt;context) + uText-&gt;chunkNativeStart, static_cast&lt;unsigned&gt;(uText-&gt;chunkLength));
+
+    uText-&gt;nativeIndexingLimit = uText-&gt;chunkLength;
+
+    return TRUE;
+}
+
+static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+{
+    int64_t length = uText-&gt;a;
+    if (U_FAILURE(*status))
+        return 0;
+
+    if (destCapacity &lt; 0 || (!dest &amp;&amp; destCapacity &gt; 0)) {
+        *status = U_ILLEGAL_ARGUMENT_ERROR;
+        return 0;
+    }
+
+    if (start &lt; 0 || start &gt; limit || (limit - start) &gt; INT32_MAX) {
+        *status = U_INDEX_OUTOFBOUNDS_ERROR;
+        return 0;
+    }
+
+    if (start &gt; length)
+        start = length;
+    if (limit &gt; length)
+        limit = length;
+
+    length = limit - start;
+    
+    if (!length)
+        return 0;
+
+    if (destCapacity &gt; 0 &amp;&amp; !dest) {
+        int32_t trimmedLength = length;
+        if (trimmedLength &gt; destCapacity)
+            trimmedLength = destCapacity;
+
+        StringImpl::copyChars(dest, static_cast&lt;const LChar*&gt;(uText-&gt;context) + start, static_cast&lt;unsigned&gt;(trimmedLength));
+    }
+
+    if (length &lt; destCapacity) {
+        dest[length] = 0;
+        if (*status == U_STRING_NOT_TERMINATED_WARNING)
+            *status = U_ZERO_ERROR;
+    } else if (length == destCapacity)
+        *status = U_STRING_NOT_TERMINATED_WARNING;
+    else
+        *status = U_BUFFER_OVERFLOW_ERROR;
+
+    return length;
+}
+
+static int64_t uTextLatin1MapOffsetToNative(const UText* uText)
+{
+    return uText-&gt;chunkNativeStart + uText-&gt;chunkOffset;
+}
+
+static int32_t uTextLatin1MapNativeIndexToUTF16(const UText* uText, int64_t nativeIndex)
+{
+    ASSERT_UNUSED(uText, uText-&gt;chunkNativeStart &gt;= nativeIndex);
+    ASSERT_UNUSED(uText, nativeIndex &lt; uText-&gt;chunkNativeLimit);
+    return nativeIndex;
+}
+
+static void uTextLatin1Close(UText* uText)
+{
+    uText-&gt;context = nullptr;
+}
+
+UText* openLatin1UTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, UErrorCode* status)
+{
+    if (U_FAILURE(*status))
+        return nullptr;
+    if (!string || length &gt; static_cast&lt;unsigned&gt;(std::numeric_limits&lt;int32_t&gt;::max())) {
+        *status = U_ILLEGAL_ARGUMENT_ERROR;
+        return nullptr;
+    }
+    UText* text = utext_setup(&amp;utWithBuffer-&gt;text, sizeof(utWithBuffer-&gt;buffer), status);
+    if (U_FAILURE(*status)) {
+        ASSERT(!text);
+        return nullptr;
+    }
+
+    text-&gt;context = string;
+    text-&gt;a = length;
+    text-&gt;pFuncs = &amp;uTextLatin1Funcs;
+    text-&gt;chunkContents = (UChar*)text-&gt;pExtra;
+    memset(const_cast&lt;UChar*&gt;(text-&gt;chunkContents), 0, sizeof(UChar) * (UTextWithBufferInlineCapacity + 1));
+
+    return text;
+}
+
+
+// Latin1ContextAware provider
+
+static UText* uTextLatin1ContextAwareClone(UText*, const UText*, UBool, UErrorCode*);
+static int64_t uTextLatin1ContextAwareNativeLength(UText*);
+static UBool uTextLatin1ContextAwareAccess(UText*, int64_t, UBool);
+static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
+static void uTextLatin1ContextAwareClose(UText*);
+
+static const struct UTextFuncs textLatin1ContextAwareFuncs = {
+    sizeof(UTextFuncs),
+    0,
+    0,
+    0,
+    uTextLatin1ContextAwareClone,
+    uTextLatin1ContextAwareNativeLength,
+    uTextLatin1ContextAwareAccess,
+    uTextLatin1ContextAwareExtract,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    uTextLatin1ContextAwareClose,
+    nullptr,
+    nullptr,
+    nullptr
+};
+
+static inline UTextProviderContext textLatin1ContextAwareGetCurrentContext(const UText* text)
+{
</ins><span class="cx">     if (!text-&gt;chunkContents)
</span><span class="cx">         return UTextProviderContext::NoContext;
</span><span class="cx">     return text-&gt;chunkContents == text-&gt;pExtra ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textLatin1MoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textLatin1ContextAwareMoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(text-&gt;chunkContents == text-&gt;pExtra);
</span><span class="cx">     if (forward) {
</span><span class="lines">@@ -63,14 +293,14 @@
</span><span class="cx">     StringImpl::copyChars(const_cast&lt;UChar*&gt;(text-&gt;chunkContents), static_cast&lt;const LChar*&gt;(text-&gt;p) + (text-&gt;chunkNativeStart - text-&gt;b), static_cast&lt;unsigned&gt;(text-&gt;chunkLength));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textLatin1SwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textLatin1ContextAwareSwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!text-&gt;chunkContents || text-&gt;chunkContents == text-&gt;q);
</span><span class="cx">     text-&gt;chunkContents = static_cast&lt;const UChar*&gt;(text-&gt;pExtra);
</span><del>-    textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</del><ins>+    textLatin1ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textLatin1MoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textLatin1ContextAwareMoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(text-&gt;chunkContents == text-&gt;q);
</span><span class="cx">     ASSERT(forward ? nativeIndex &lt; text-&gt;b : nativeIndex &lt;= text-&gt;b);
</span><span class="lines">@@ -86,58 +316,50 @@
</span><span class="cx">     text-&gt;chunkOffset = std::min(offset &lt; std::numeric_limits&lt;int32_t&gt;::max() ? static_cast&lt;int32_t&gt;(offset) : 0, text-&gt;chunkLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textLatin1SwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textLatin1ContextAwareSwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!text-&gt;chunkContents || text-&gt;chunkContents == text-&gt;pExtra);
</span><span class="cx">     text-&gt;chunkContents = static_cast&lt;const UChar*&gt;(text-&gt;q);
</span><del>-    textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward);
</del><ins>+    textLatin1ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// -- Begin Latin-1 provider functions --
-
-static UText* uTextLatin1Clone(UText*, const UText*, UBool, UErrorCode*);
-static int64_t uTextLatin1NativeLength(UText*); 
-static UBool uTextLatin1Access(UText*, int64_t, UBool); 
-static int32_t uTextLatin1Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*); 
-static void uTextLatin1Close(UText*);
-
-static UText* uTextLatin1Clone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
</del><ins>+static UText* uTextLatin1ContextAwareClone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
</ins><span class="cx"> {
</span><span class="cx">     return uTextCloneImpl(destination, source, deep, status);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static int64_t uTextLatin1NativeLength(UText* text)
</del><ins>+static int64_t uTextLatin1ContextAwareNativeLength(UText* text)
</ins><span class="cx"> {
</span><span class="cx">     return text-&gt;a + text-&gt;b;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static UBool uTextLatin1Access(UText* text, int64_t nativeIndex, UBool forward)
</del><ins>+static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     if (!text-&gt;context)
</span><span class="cx">         return FALSE;
</span><del>-    int64_t nativeLength = uTextLatin1NativeLength(text);
</del><ins>+    int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
</ins><span class="cx">     UBool isAccessible;
</span><span class="cx">     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
</span><span class="cx">         return isAccessible;
</span><span class="cx">     nativeIndex = uTextAccessPinIndex(nativeIndex, nativeLength);
</span><del>-    UTextProviderContext currentContext = textLatin1GetCurrentContext(text);
</del><ins>+    UTextProviderContext currentContext = textLatin1ContextAwareGetCurrentContext(text);
</ins><span class="cx">     UTextProviderContext newContext = uTextProviderContext(text, nativeIndex, forward);
</span><span class="cx">     ASSERT(newContext != UTextProviderContext::NoContext);
</span><span class="cx">     if (newContext == currentContext) {
</span><span class="cx">         if (currentContext == UTextProviderContext::PrimaryContext)
</span><del>-            textLatin1MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</del><ins>+            textLatin1ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">         else
</span><del>-            textLatin1MoveInPriorContext(text, nativeIndex, nativeLength, forward);
</del><ins>+            textLatin1ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">     } else if (newContext == UTextProviderContext::PrimaryContext)
</span><del>-        textLatin1SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
</del><ins>+        textLatin1ContextAwareSwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">     else {
</span><span class="cx">         ASSERT(newContext == UTextProviderContext::PriorContext);
</span><del>-        textLatin1SwitchToPriorContext(text, nativeIndex, nativeLength, forward);
</del><ins>+        textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">     }
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static int32_t uTextLatin1Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
</del><ins>+static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
</ins><span class="cx"> {
</span><span class="cx">     // In the present context, this text provider is used only with ICU functions
</span><span class="cx">     // that do not perform an extract operation.
</span><span class="lines">@@ -146,26 +368,12 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void uTextLatin1Close(UText* text)
</del><ins>+static void uTextLatin1ContextAwareClose(UText* text)
</ins><span class="cx"> {
</span><del>-    text-&gt;context = 0;
</del><ins>+    text-&gt;context = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// -- End Latin-1 provider functions --
-
-static const struct UTextFuncs textLatin1Funcs = {
-    sizeof(UTextFuncs),
-    0, 0, 0,
-    uTextLatin1Clone,
-    uTextLatin1NativeLength,
-    uTextLatin1Access,
-    uTextLatin1Extract,
-    0, 0, 0, 0,
-    uTextLatin1Close,
-    0, 0, 0,
-};
-
-UText* uTextOpenLatin1(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
</del><ins>+UText* openLatin1ContextAwareUTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
</ins><span class="cx"> {
</span><span class="cx">     if (U_FAILURE(*status))
</span><span class="cx">         return 0;
</span><span class="lines">@@ -178,7 +386,8 @@
</span><span class="cx">         ASSERT(!text);
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><del>-    uTextInitialize(text, &amp;textLatin1Funcs, string, length, priorContext, priorContextLength);
</del><ins>+
+    initializeContextAwareUTextProvider(text, &amp;textLatin1ContextAwareFuncs, string, length, priorContext, priorContextLength);
</ins><span class="cx">     return text;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtexticuUTextProviderLatin1h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.h (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.h        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/icu/UTextProviderLatin1.h        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -38,7 +38,8 @@
</span><span class="cx">     UChar buffer[UTextWithBufferInlineCapacity];
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-UText* uTextOpenLatin1(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status);
</del><ins>+UText* openLatin1UTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, UErrorCode* status);
+UText* openLatin1ContextAwareUTextProvider(UTextWithBuffer* utWithBuffer, const LChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtexticuUTextProviderUTF16cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -30,14 +30,41 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static inline UTextProviderContext textUTF16GetCurrentContext(const UText* text)
</del><ins>+// UTF16ContextAware provider
+
+static UText* uTextUTF16ContextAwareClone(UText*, const UText*, UBool, UErrorCode*);
+static int64_t uTextUTF16ContextAwareNativeLength(UText*);
+static UBool uTextUTF16ContextAwareAccess(UText*, int64_t, UBool);
+static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
+static void uTextUTF16ContextAwareClose(UText*);
+
+static const struct UTextFuncs textUTF16ContextAwareFuncs = {
+    sizeof(UTextFuncs),
+    0,
+    0,
+    0,
+    uTextUTF16ContextAwareClone,
+    uTextUTF16ContextAwareNativeLength,
+    uTextUTF16ContextAwareAccess,
+    uTextUTF16ContextAwareExtract,
+    nullptr,
+    nullptr,
+    nullptr,
+    nullptr,
+    uTextUTF16ContextAwareClose,
+    nullptr,
+    nullptr,
+    nullptr
+};
+
+static inline UTextProviderContext textUTF16ContextAwareGetCurrentContext(const UText* text)
</ins><span class="cx"> {
</span><span class="cx">     if (!text-&gt;chunkContents)
</span><span class="cx">         return UTextProviderContext::NoContext;
</span><span class="cx">     return text-&gt;chunkContents == text-&gt;p ? UTextProviderContext::PrimaryContext : UTextProviderContext::PriorContext;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textUTF16MoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textUTF16ContextAwareMoveInPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(text-&gt;chunkContents == text-&gt;p);
</span><span class="cx">     ASSERT_UNUSED(forward, forward ? nativeIndex &gt;= text-&gt;b : nativeIndex &gt; text-&gt;b);
</span><span class="lines">@@ -55,14 +82,14 @@
</span><span class="cx">     text-&gt;chunkOffset = std::min(offset &lt; std::numeric_limits&lt;int32_t&gt;::max() ? static_cast&lt;int32_t&gt;(offset) : 0, text-&gt;chunkLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textUTF16SwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textUTF16ContextAwareSwitchToPrimaryContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!text-&gt;chunkContents || text-&gt;chunkContents == text-&gt;q);
</span><span class="cx">     text-&gt;chunkContents = static_cast&lt;const UChar*&gt;(text-&gt;p);
</span><del>-    textUTF16MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</del><ins>+    textUTF16ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textUTF16MoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textUTF16ContextAwareMoveInPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(text-&gt;chunkContents == text-&gt;q);
</span><span class="cx">     ASSERT(forward ? nativeIndex &lt; text-&gt;b : nativeIndex &lt;= text-&gt;b);
</span><span class="lines">@@ -78,58 +105,50 @@
</span><span class="cx">     text-&gt;chunkOffset = std::min(offset &lt; std::numeric_limits&lt;int32_t&gt;::max() ? static_cast&lt;int32_t&gt;(offset) : 0, text-&gt;chunkLength);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void textUTF16SwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</del><ins>+static void textUTF16ContextAwareSwitchToPriorContext(UText* text, int64_t nativeIndex, int64_t nativeLength, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!text-&gt;chunkContents || text-&gt;chunkContents == text-&gt;p);
</span><span class="cx">     text-&gt;chunkContents = static_cast&lt;const UChar*&gt;(text-&gt;q);
</span><del>-    textUTF16MoveInPriorContext(text, nativeIndex, nativeLength, forward);
</del><ins>+    textUTF16ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// -- Begin UTF-16 provider functions --
-
-static UText* uTextUTF16Clone(UText*, const UText*, UBool, UErrorCode*);
-static int64_t uTextUTF16NativeLength(UText*);
-static UBool uTextUTF16Access(UText*, int64_t, UBool);
-static int32_t uTextUTF16Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode*);
-static void uTextUTF16Close(UText*);
-
-static UText* uTextUTF16Clone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
</del><ins>+static UText* uTextUTF16ContextAwareClone(UText* destination, const UText* source, UBool deep, UErrorCode* status)
</ins><span class="cx"> {
</span><span class="cx">     return uTextCloneImpl(destination, source, deep, status);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline int64_t uTextUTF16NativeLength(UText* text)
</del><ins>+static inline int64_t uTextUTF16ContextAwareNativeLength(UText* text)
</ins><span class="cx"> {
</span><span class="cx">     return text-&gt;a + text-&gt;b;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static UBool uTextUTF16Access(UText* text, int64_t nativeIndex, UBool forward)
</del><ins>+static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
</ins><span class="cx"> {
</span><span class="cx">     if (!text-&gt;context)
</span><span class="cx">         return FALSE;
</span><del>-    int64_t nativeLength = uTextUTF16NativeLength(text);
</del><ins>+    int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
</ins><span class="cx">     UBool isAccessible;
</span><span class="cx">     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
</span><span class="cx">         return isAccessible;
</span><span class="cx">     nativeIndex = uTextAccessPinIndex(nativeIndex, nativeLength);
</span><del>-    UTextProviderContext currentContext = textUTF16GetCurrentContext(text);
</del><ins>+    UTextProviderContext currentContext = textUTF16ContextAwareGetCurrentContext(text);
</ins><span class="cx">     UTextProviderContext newContext = uTextProviderContext(text, nativeIndex, forward);
</span><span class="cx">     ASSERT(newContext != UTextProviderContext::NoContext);
</span><span class="cx">     if (newContext == currentContext) {
</span><span class="cx">         if (currentContext == UTextProviderContext::PrimaryContext)
</span><del>-            textUTF16MoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</del><ins>+            textUTF16ContextAwareMoveInPrimaryContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">         else
</span><del>-            textUTF16MoveInPriorContext(text, nativeIndex, nativeLength, forward);
</del><ins>+            textUTF16ContextAwareMoveInPriorContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">     } else if (newContext == UTextProviderContext::PrimaryContext)
</span><del>-        textUTF16SwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
</del><ins>+        textUTF16ContextAwareSwitchToPrimaryContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">     else {
</span><span class="cx">         ASSERT(newContext == UTextProviderContext::PriorContext);
</span><del>-        textUTF16SwitchToPriorContext(text, nativeIndex, nativeLength, forward);
</del><ins>+        textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
</ins><span class="cx">     }
</span><span class="cx">     return TRUE;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static int32_t uTextUTF16Extract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
</del><ins>+static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
</ins><span class="cx"> {
</span><span class="cx">     // In the present context, this text provider is used only with ICU functions
</span><span class="cx">     // that do not perform an extract operation.
</span><span class="lines">@@ -138,26 +157,12 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static void uTextUTF16Close(UText* text)
</del><ins>+static void uTextUTF16ContextAwareClose(UText* text)
</ins><span class="cx"> {
</span><del>-    text-&gt;context = 0;
</del><ins>+    text-&gt;context = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-// -- End UTF-16 provider functions --
-
-static const struct UTextFuncs textUTF16Funcs = {
-    sizeof(UTextFuncs),
-    0, 0, 0,
-    uTextUTF16Clone,
-    uTextUTF16NativeLength,
-    uTextUTF16Access,
-    uTextUTF16Extract,
-    0, 0, 0, 0,
-    uTextUTF16Close,
-    0, 0, 0,
-};
-
-UText* uTextOpenUTF16(UText* text, const UChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
</del><ins>+UText* openUTF16ContextAwareUTextProvider(UText* text, const UChar* string, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode* status)
</ins><span class="cx"> {
</span><span class="cx">     if (U_FAILURE(*status))
</span><span class="cx">         return 0;
</span><span class="lines">@@ -170,7 +175,8 @@
</span><span class="cx">         ASSERT(!text);
</span><span class="cx">         return 0;
</span><span class="cx">     }
</span><del>-    uTextInitialize(text, &amp;textUTF16Funcs, string, length, priorContext, priorContextLength);
</del><ins>+
+    initializeContextAwareUTextProvider(text, &amp;textUTF16ContextAwareFuncs, string, length, priorContext, priorContextLength);
</ins><span class="cx">     return text;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtexticuUTextProviderUTF16h"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.h (161843 => 161844)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.h        2014-01-13 01:26:11 UTC (rev 161843)
+++ trunk/Source/WebCore/platform/text/icu/UTextProviderUTF16.h        2014-01-13 01:28:53 UTC (rev 161844)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-UText* uTextOpenUTF16(UText*, const UChar*, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode*);
</del><ins>+UText* openUTF16ContextAwareUTextProvider(UText*, const UChar*, unsigned length, const UChar* priorContext, int priorContextLength, UErrorCode*);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>