Changeset 62172 in webkit


Ignore:
Timestamp:
Jun 30, 2010 2:14:18 AM (14 years ago)
Author:
eric@webkit.org
Message:

2010-06-30 Eric Seidel <eric@webkit.org>

Reviewed by Adam Barth.

HTMLTokenizer needs EndOfFile support
https://bugs.webkit.org/show_bug.cgi?id=41344

EndOfFile support uncovered a bug in our implementation of finish().
finish() may be called more than once if the first call does not
result in end() being called (and parsing thus actually stopping).

SegmentedString::close() should have ASSERTed that it was not already
closed when close() is called. I've added such an assert now.

  • html/HTMLDocumentParser.cpp: (WebCore::HTMLDocumentParser::finish):
  • platform/text/SegmentedString.cpp: (WebCore::SegmentedString::close):
  • platform/text/SegmentedString.h:
Location:
trunk/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r62168 r62172  
     12010-06-30  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        HTMLTokenizer needs EndOfFile support
     6        https://bugs.webkit.org/show_bug.cgi?id=41344
     7
     8        EndOfFile support uncovered a bug in our implementation of finish().
     9        finish() may be called more than once if the first call does not
     10        result in end() being called (and parsing thus actually stopping).
     11
     12        SegmentedString::close() should have ASSERTed that it was not already
     13        closed when close() is called.  I've added such an assert now.
     14
     15        * html/HTMLDocumentParser.cpp:
     16        (WebCore::HTMLDocumentParser::finish):
     17        * platform/text/SegmentedString.cpp:
     18        (WebCore::SegmentedString::close):
     19        * platform/text/SegmentedString.h:
     20
    1212010-06-29  Eric Seidel  <eric@webkit.org>
    222
  • trunk/WebCore/html/HTMLDocumentParser.cpp

    r62168 r62172  
    291291{
    292292    // We're not going to get any more data off the network, so we tell the
    293     // input stream we've reached the end of file.
    294     m_input.markEndOfFile();
     293    // input stream we've reached the end of file.  finish() can be called more
     294    // than once, if the first time does not call end().
     295    if (!m_input.haveSeenEndOfFile())
     296        m_input.markEndOfFile();
    295297    attemptToEnd();
    296298}
  • trunk/WebCore/platform/text/SegmentedString.cpp

    r60926 r62172  
    123123}
    124124
     125void SegmentedString::close()
     126{
     127    // Closing a stream twice is likely a coding mistake.
     128    ASSERT(!m_closed);
     129    m_closed = true;
     130}
     131
    125132void SegmentedString::append(const SegmentedString &s)
    126133{
  • trunk/WebCore/platform/text/SegmentedString.h

    r60274 r62172  
    8383
    8484    void clear();
    85     void close() { m_closed = true; }
     85    void close();
    8686
    8787    void append(const SegmentedString&);
Note: See TracChangeset for help on using the changeset viewer.