Changeset 138855 in webkit


Ignore:
Timestamp:
Jan 4, 2013, 2:18:28 PM (13 years ago)
Author:
abarth@webkit.org
Message:

HTMLTreeBuilder should ASSERT that it is on the main thread before touching elements
https://bugs.webkit.org/show_bug.cgi?id=106128

Reviewed by Eric Seidel.

Even if we move the HTML parser onto a background thread, we're likely
to keep fragment parsing on the main thread. These code paths touch
elements (which only exist on the main thread) but are only used during
fragment parsing. This patch adds ASSERTs to document that invariant.

  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::closestFormAncestor):
(WebCore::HTMLTreeBuilder::HTMLTreeBuilder):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r138854 r138855  
     12013-01-04  Adam Barth  <abarth@webkit.org>
     2
     3        HTMLTreeBuilder should ASSERT that it is on the main thread before touching elements
     4        https://bugs.webkit.org/show_bug.cgi?id=106128
     5
     6        Reviewed by Eric Seidel.
     7
     8        Even if we move the HTML parser onto a background thread, we're likely
     9        to keep fragment parsing on the main thread. These code paths touch
     10        elements (which only exist on the main thread) but are only used during
     11        fragment parsing. This patch adds ASSERTs to document that invariant.
     12
     13        * html/parser/HTMLTreeBuilder.cpp:
     14        (WebCore::closestFormAncestor):
     15        (WebCore::HTMLTreeBuilder::HTMLTreeBuilder):
     16
    1172013-01-04  Zoltan Horvath  <zoltan@webkit.org>
    218
  • trunk/Source/WebCore/html/parser/HTMLTreeBuilder.cpp

    r138546 r138855  
    5353#include "XMLNSNames.h"
    5454#include "XMLNames.h"
     55#include <wtf/MainThread.h>
    5556#include <wtf/unicode/CharacterNames.h>
    5657
     
    142143static HTMLFormElement* closestFormAncestor(Element* element)
    143144{
     145    ASSERT(isMainThread());
    144146    while (element) {
    145147        if (element->hasTagName(formTag))
     
    296298    , m_usePreHTML5ParserQuirks(usePreHTML5ParserQuirks)
    297299{
     300    ASSERT(isMainThread());
    298301    // FIXME: This assertion will become invalid if <http://webkit.org/b/60316> is fixed.
    299302    ASSERT(contextElement);
Note: See TracChangeset for help on using the changeset viewer.