[Webkit-unassigned] [Bug 66706] New: Change return type of StringImpl::characters() to StringIterator

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 22 13:25:20 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=66706

           Summary: Change return type of StringImpl::characters() to
                    StringIterator
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: sullivan at chromium.org
                CC: abarth at webkit.org, jamesr at chromium.org,
                    simonjam at chromium.org, wangxianzhu at chromium.org
            Blocks: 66161


In order to fix bug 66161 (storing strings in 8-bit buffers when possible), we want to reduce the number of places where the underlying data format in WTF::String is exposed. The main thing that needs to get fixed are ~200 usages of the String::characters() method. After discussion in bug 66286, we think the best approach to the conversion is the following:

1. Typedef const UChar * (the return value of characters() ) StringIterator, and make characters() return StringIterator.
2. Replace usages of const UChar* in callers with StringIterator. At this point, the functionality of the code hasn't changed at all, but it would be possible to implement StringIterator with operator[], etc. in a way that hides the underlying data format of the string.
3. Write various implementations of StringIterator and do performance analysis on how they affect the entire codebase (as opposed to relying solely on microbenchmarks).
4. Pick a performant implementation of StringIterator, and actually convert the code to use 8-bit buffers when possible using this implementation.

This bug addresses step 1. I pulled it out of one of the patches from bug 66286 because there is a lot of discussion on that bug and I wanted to make sure what we're doing here is clear.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list