Changeset 157342 in webkit


Ignore:
Timestamp:
Oct 12, 2013 11:16:42 AM (11 years ago)
Author:
akling@apple.com
Message:

Replace static cast ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION
https://bugs.webkit.org/show_bug.cgi?id=120803

Patch by Jessica Pease <jessica_n_pease@apple.com> on 2013-09-27
Reviewed by Andreas Kling.

No new tests because we're just changing assertions.

Source/WebCore:

  • accessibility/AccessibilityMockObject.h:

(WebCore::toAccessibilityMockObject):

  • bindings/js/JSCanvasRenderingContextCustom.cpp:

(WebCore::toJS):

  • bindings/js/ScheduledAction.cpp:

(WebCore::ScheduledAction::execute):

  • css/CSSGradientValue.cpp:

(WebCore::CSSGradientValue::image):

  • css/DeprecatedStyleBuilder.cpp:

(WebCore::ApplyPropertyTextUnderlinePosition::applyValue):

  • dom/Element.cpp:

(WebCore::Element::elementRareData):
(WebCore::Element::synchronizeAttribute):

  • dom/FocusEvent.h:

(WebCore::toFocusEvent):

  • dom/MouseEvent.h:

(WebCore::toMouseEvent):

  • dom/Node.cpp:

(WebCore::Node::rareData):

  • dom/StyledElement.cpp:

(WebCore::StyledElement::ensureMutableInlineStyle):

  • dom/TouchEvent.h:

(WebCore::toTouchEvent):

  • editing/CompositeEditCommand.h:

(WebCore::toCompositeEditCommand):

  • html/HTMLObjectElement.cpp:

(WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk):

  • html/track/AudioTrack.h:

(WebCore::toAudioTrack):

  • html/track/TextTrack.h:

(WebCore::toTextTrack):

  • html/track/VideoTrack.h:

(WebCore::toVideoTrack):

  • inspector/InspectorCSSAgent.cpp:

(WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):

  • loader/cache/CachedResourceClientWalker.h:

(WebCore::CachedResourceClientWalker::next):

  • page/FrameView.h:

(WebCore::toFrameView):

  • rendering/InlineBox.cpp:

(WebCore::InlineBox::root):

  • rendering/RenderBlockLineLayout.cpp:

(WebCore::RenderBlock::createLineBoxesFromBidiRuns):

  • rendering/svg/SVGPathData.cpp:

(WebCore::updatePathFromEllipseElement):
(WebCore::updatePathFromLineElement):
(WebCore::updatePathFromPolygonElement):
(WebCore::updatePathFromPolylineElement):

  • workers/WorkerMessagingProxy.cpp:

(WebCore::WorkerMessagingProxy::startWorkerGlobalScope):

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::document):

Source/WebKit2:

  • Shared/Plugins/NPObjectProxy.h:

(WebKit::NPObjectProxy::toNPObjectProxy):

  • WebProcess/Plugins/Netscape/NPJSObject.h:

(WebKit::NPJSObject::toNPJSObject):

Location:
trunk/Source
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r157341 r157342  
     12013-09-27  Jessica Pease  <jessica_n_pease@apple.com>
     2
     3        Replace static cast ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION
     4        https://bugs.webkit.org/show_bug.cgi?id=120803
     5
     6        Reviewed by Andreas Kling.
     7
     8        No new tests because we're just changing assertions.
     9
     10        * accessibility/AccessibilityMockObject.h:
     11        (WebCore::toAccessibilityMockObject):
     12        * bindings/js/JSCanvasRenderingContextCustom.cpp:
     13        (WebCore::toJS):
     14        * bindings/js/ScheduledAction.cpp:
     15        (WebCore::ScheduledAction::execute):
     16        * css/CSSGradientValue.cpp:
     17        (WebCore::CSSGradientValue::image):
     18        * css/DeprecatedStyleBuilder.cpp:
     19        (WebCore::ApplyPropertyTextUnderlinePosition::applyValue):
     20        * dom/Element.cpp:
     21        (WebCore::Element::elementRareData):
     22        (WebCore::Element::synchronizeAttribute):
     23        * dom/FocusEvent.h:
     24        (WebCore::toFocusEvent):
     25        * dom/MouseEvent.h:
     26        (WebCore::toMouseEvent):
     27        * dom/Node.cpp:
     28        (WebCore::Node::rareData):
     29        * dom/StyledElement.cpp:
     30        (WebCore::StyledElement::ensureMutableInlineStyle):
     31        * dom/TouchEvent.h:
     32        (WebCore::toTouchEvent):
     33        * editing/CompositeEditCommand.h:
     34        (WebCore::toCompositeEditCommand):
     35        * html/HTMLObjectElement.cpp:
     36        (WebCore::HTMLObjectElement::shouldAllowQuickTimeClassIdQuirk):
     37        * html/track/AudioTrack.h:
     38        (WebCore::toAudioTrack):
     39        * html/track/TextTrack.h:
     40        (WebCore::toTextTrack):
     41        * html/track/VideoTrack.h:
     42        (WebCore::toVideoTrack):
     43        * inspector/InspectorCSSAgent.cpp:
     44        (WebCore::InspectorCSSAgent::buildObjectForAttributesStyle):
     45        * loader/cache/CachedResourceClientWalker.h:
     46        (WebCore::CachedResourceClientWalker::next):
     47        * page/FrameView.h:
     48        (WebCore::toFrameView):
     49        * rendering/InlineBox.cpp:
     50        (WebCore::InlineBox::root):
     51        * rendering/RenderBlockLineLayout.cpp:
     52        (WebCore::RenderBlock::createLineBoxesFromBidiRuns):
     53        * rendering/svg/SVGPathData.cpp:
     54        (WebCore::updatePathFromEllipseElement):
     55        (WebCore::updatePathFromLineElement):
     56        (WebCore::updatePathFromPolygonElement):
     57        (WebCore::updatePathFromPolylineElement):
     58        * workers/WorkerMessagingProxy.cpp:
     59        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
     60        * xml/XMLHttpRequest.cpp:
     61        (WebCore::XMLHttpRequest::document):
     62
    1632013-09-06  Jessica Pease  <jessica_n_pease@apple.com>
    264
  • trunk/Source/WebCore/accessibility/AccessibilityMockObject.h

    r157044 r157342  
    5656inline AccessibilityMockObject* toAccessibilityMockObject(AccessibilityObject* object)
    5757{
    58     ASSERT(!object || object->isMockObject());
     58    ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isMockObject());
    5959    return static_cast<AccessibilityMockObject*>(object);
    6060}
  • trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp

    r157215 r157342  
    6060        return wrap<JSWebGLRenderingContext>(exec, globalObject, static_cast<WebGLRenderingContext*>(object));
    6161#endif
    62     ASSERT(object->is2d());
     62    ASSERT_WITH_SECURITY_IMPLICATION(object->is2d());
    6363    return wrap<JSCanvasRenderingContext2D>(exec, globalObject, static_cast<CanvasRenderingContext2D*>(object));
    6464}
  • trunk/Source/WebCore/bindings/js/ScheduledAction.cpp

    r157215 r157342  
    8282#if ENABLE(WORKERS)
    8383    else {
    84         ASSERT(context->isWorkerGlobalScope());
     84        ASSERT_WITH_SECURITY_IMPLICATION(context->isWorkerGlobalScope());
    8585        execute(static_cast<WorkerGlobalScope*>(context));
    8686    }
  • trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp

    r157024 r157342  
    13741374        for (CSSValueListIterator i(value); i.hasMore(); i.advance()) {
    13751375            CSSValue* item = i.value();
    1376             ASSERT(item->isPrimitiveValue());
     1376            ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue());
    13771377            TextUnderlinePosition t2 = *toCSSPrimitiveValue(item);
    13781378            t |= t2;
  • trunk/Source/WebCore/dom/Element.cpp

    r157212 r157342  
    192192inline ElementRareData* Element::elementRareData() const
    193193{
    194     ASSERT(hasRareData());
     194    ASSERT_WITH_SECURITY_IMPLICATION(hasRareData());
    195195    return static_cast<ElementRareData*>(rareData());
    196196}
     
    421421        return;
    422422    if (UNLIKELY(name == styleAttr && elementData()->m_styleAttributeIsDirty)) {
    423         ASSERT(isStyledElement());
     423        ASSERT_WITH_SECURITY_IMPLICATION(isStyledElement());
    424424        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
    425425        return;
     
    440440        return;
    441441    if (elementData()->m_styleAttributeIsDirty && equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(this))) {
    442         ASSERT(isStyledElement());
     442        ASSERT_WITH_SECURITY_IMPLICATION(isStyledElement());
    443443        static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal();
    444444        return;
     
    447447    if (elementData()->m_animatedSVGAttributesAreDirty) {
    448448        // We're not passing a namespace argument on purpose. SVGNames::*Attr are defined w/o namespaces as well.
    449         ASSERT(isSVGElement());
     449        ASSERT_WITH_SECURITY_IMPLICATION(isSVGElement());
    450450        toSVGElement(this)->synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom));
    451451    }
  • trunk/Source/WebCore/dom/FocusEvent.h

    r157210 r157342  
    7373inline FocusEvent* toFocusEvent(Event* event)
    7474{
    75     ASSERT(event && event->isFocusEvent());
     75    ASSERT_WITH_SECURITY_IMPLICATION(event && event->isFocusEvent());
    7676    return static_cast<FocusEvent*>(event);
    7777}
  • trunk/Source/WebCore/dom/MouseEvent.h

    r157282 r157342  
    134134inline MouseEvent* toMouseEvent(Event* event)
    135135{
    136     ASSERT(event && event->isMouseEvent());
     136    ASSERT_WITH_SECURITY_IMPLICATION(event && event->isMouseEvent());
    137137    return static_cast<MouseEvent*>(event);
    138138}
  • trunk/Source/WebCore/dom/Node.cpp

    r157316 r157342  
    369369NodeRareData* Node::rareData() const
    370370{
    371     ASSERT(hasRareData());
     371    ASSERT_WITH_SECURITY_IMPLICATION(hasRareData());
    372372    return static_cast<NodeRareData*>(m_data.m_rareData);
    373373}
  • trunk/Source/WebCore/dom/StyledElement.cpp

    r156550 r157342  
    155155    else if (!inlineStyle->isMutable())
    156156        inlineStyle = inlineStyle->mutableCopy();
    157     ASSERT(inlineStyle->isMutable());
     157    ASSERT_WITH_SECURITY_IMPLICATION(inlineStyle->isMutable());
    158158    return static_cast<MutableStylePropertySet&>(*inlineStyle);
    159159}
  • trunk/Source/WebCore/dom/TouchEvent.h

    r157210 r157342  
    9797inline TouchEvent* toTouchEvent(Event* event)
    9898{
    99     ASSERT(event && event->isTouchEvent());
     99    ASSERT_WITH_SECURITY_IMPLICATION(event && event->isTouchEvent());
    100100    return static_cast<TouchEvent*>(event);
    101101}
  • trunk/Source/WebCore/editing/CompositeEditCommand.h

    r157044 r157342  
    181181{
    182182    ASSERT(command);
    183     ASSERT(command->isCompositeEditCommand());
     183    ASSERT_WITH_SECURITY_IMPLICATION(command->isCompositeEditCommand());
    184184    return static_cast<CompositeEditCommand*>(command);
    185185}
  • trunk/Source/WebCore/html/HTMLObjectElement.cpp

    r156940 r157342  
    244244    unsigned length = metaElements->length();
    245245    for (unsigned i = 0; i < length; ++i) {
    246         ASSERT(metaElements->item(i)->isHTMLElement());
     246        ASSERT_WITH_SECURITY_IMPLICATION(metaElements->item(i)->isHTMLElement());
    247247        HTMLMetaElement* metaElement = static_cast<HTMLMetaElement*>(metaElements->item(i));
    248248        if (equalIgnoringCase(metaElement->name(), "generator") && metaElement->content().startsWith("Mac OS X Server Web Services Server", false))
  • trunk/Source/WebCore/html/track/AudioTrack.h

    r148785 r157342  
    9090inline AudioTrack* toAudioTrack(TrackBase* track)
    9191{
    92     ASSERT(track->type() == TrackBase::AudioTrack);
     92    ASSERT_WITH_SECURITY_IMPLICATION(track->type() == TrackBase::AudioTrack);
    9393    return static_cast<AudioTrack*>(track);
    9494}
  • trunk/Source/WebCore/html/track/TextTrack.h

    r156413 r157342  
    193193inline TextTrack* toTextTrack(TrackBase* track)
    194194{
    195     ASSERT(track->type() == TrackBase::TextTrack);
     195    ASSERT_WITH_SECURITY_IMPLICATION(track->type() == TrackBase::TextTrack);
    196196    return static_cast<TextTrack*>(track);
    197197}
  • trunk/Source/WebCore/html/track/VideoTrack.h

    r148785 r157342  
    9090inline VideoTrack* toVideoTrack(TrackBase* track)
    9191{
    92     ASSERT(track->type() == TrackBase::VideoTrack);
     92    ASSERT_WITH_SECURITY_IMPLICATION(track->type() == TrackBase::VideoTrack);
    9393    return static_cast<VideoTrack*>(track);
    9494}
  • trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp

    r156422 r157342  
    13481348        return 0;
    13491349
    1350     ASSERT(attributeStyle->isMutable());
     1350    ASSERT_WITH_SECURITY_IMPLICATION(attributeStyle->isMutable());
    13511351    MutableStylePropertySet* mutableAttributeStyle = static_cast<MutableStylePropertySet*>(attributeStyle);
    13521352
  • trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h

    r130612 r157342  
    5252            CachedResourceClient* next = m_clientVector[m_index++];
    5353            if (m_clientSet.contains(next)) {
    54                 ASSERT(T::expectedType() == CachedResourceClient::expectedType() || next->resourceClientType() == T::expectedType());
     54                ASSERT_WITH_SECURITY_IMPLICATION(T::expectedType() == CachedResourceClient::expectedType() || next->resourceClientType() == T::expectedType());
    5555                return static_cast<T*>(next);
    5656            }
  • trunk/Source/WebCore/page/FrameView.h

    r157253 r157342  
    691691inline FrameView* toFrameView(Widget* widget)
    692692{
    693     ASSERT(!widget || widget->isFrameView());
     693    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isFrameView());
    694694    return static_cast<FrameView*>(widget);
    695695}
     
    697697inline const FrameView* toFrameView(const Widget* widget)
    698698{
    699     ASSERT(!widget || widget->isFrameView());
     699    ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isFrameView());
    700700    return static_cast<const FrameView*>(widget);
    701701}
  • trunk/Source/WebCore/rendering/InlineBox.cpp

    r157011 r157342  
    270270    if (m_parent)
    271271        return m_parent->root();
    272     ASSERT(isRootInlineBox());
     272    ASSERT_WITH_SECURITY_IMPLICATION(isRootInlineBox());
    273273    return static_cast<const RootInlineBox&>(*this);
    274274}
     
    278278    if (m_parent)
    279279        return m_parent->root();
    280     ASSERT(isRootInlineBox());
     280    ASSERT_WITH_SECURITY_IMPLICATION(isRootInlineBox());
    281281    return static_cast<RootInlineBox&>(*this);
    282282}
  • trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp

    r157332 r157342  
    12301230    // text selection in RTL boxes would not work as expected.
    12311231    if (isSVGRootInlineBox) {
    1232         ASSERT(isSVGText());
     1232        ASSERT_WITH_SECURITY_IMPLICATION(isSVGText());
    12331233        static_cast<SVGRootInlineBox*>(lineBox)->computePerCharacterLayoutInformation();
    12341234    }
  • trunk/Source/WebCore/rendering/svg/SVGPathData.cpp

    r155630 r157342  
    4949static void updatePathFromEllipseElement(SVGElement* element, Path& path)
    5050{
    51     ASSERT(element->hasTagName(SVGNames::ellipseTag));
     51    ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::ellipseTag));
    5252    SVGEllipseElement* ellipse = static_cast<SVGEllipseElement*>(element);
    5353
     
    6464static void updatePathFromLineElement(SVGElement* element, Path& path)
    6565{
    66     ASSERT(element->hasTagName(SVGNames::lineTag));
     66    ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::lineTag));
    6767    SVGLineElement* line = static_cast<SVGLineElement*>(element);
    6868
     
    7979static void updatePathFromPolygonElement(SVGElement* element, Path& path)
    8080{
    81     ASSERT(element->hasTagName(SVGNames::polygonTag));
     81    ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::polygonTag));
    8282    SVGPolygonElement* polygon = static_cast<SVGPolygonElement*>(element);
    8383
     
    9797static void updatePathFromPolylineElement(SVGElement* element, Path& path)
    9898{
    99     ASSERT(element->hasTagName(SVGNames::polylineTag));
     99    ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::polylineTag));
    100100    SVGPolylineElement* polyline = static_cast<SVGPolylineElement*>(element);
    101101
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp

    r157075 r157342  
    300300{
    301301    // FIXME: This need to be revisited when we support nested worker one day
    302     ASSERT(m_scriptExecutionContext->isDocument());
     302    ASSERT_WITH_SECURITY_IMPLICATION(m_scriptExecutionContext->isDocument());
    303303    Document* document = static_cast<Document*>(m_scriptExecutionContext.get());
    304304    GroupSettings* settings = 0;
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r157002 r157342  
    209209Document* XMLHttpRequest::document() const
    210210{
    211     ASSERT(scriptExecutionContext()->isDocument());
     211    ASSERT_WITH_SECURITY_IMPLICATION(scriptExecutionContext()->isDocument());
    212212    return static_cast<Document*>(scriptExecutionContext());
    213213}
  • trunk/Source/WebKit2/ChangeLog

    r157341 r157342  
     12013-09-27  Jessica Pease  <jessica_n_pease@apple.com>
     2
     3        Replace static cast ASSERTs with ASSERT_WITH_SECURITY_IMPLICATION
     4        https://bugs.webkit.org/show_bug.cgi?id=120803
     5
     6        Reviewed by Andreas Kling.
     7
     8        No new tests because we're just changing assertions.
     9
     10        * Shared/Plugins/NPObjectProxy.h:
     11        (WebKit::NPObjectProxy::toNPObjectProxy):
     12        * WebProcess/Plugins/Netscape/NPJSObject.h:
     13        (WebKit::NPJSObject::toNPJSObject):
     14
    1152013-09-06  Jessica Pease  <jessica_n_pease@apple.com>
    216
  • trunk/Source/WebKit2/Shared/Plugins/NPObjectProxy.h

    r156069 r157342  
    4747    static NPObjectProxy* toNPObjectProxy(NPObject* npObject)
    4848    {
    49         ASSERT(isNPObjectProxy(npObject));
     49        ASSERT_WITH_SECURITY_IMPLICATION(isNPObjectProxy(npObject));
    5050        return static_cast<NPObjectProxy*>(npObject);
    5151    }
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.h

    r148696 r157342  
    5757    static NPJSObject* toNPJSObject(NPObject* npObject)
    5858    {
    59         ASSERT(isNPJSObject(npObject));
     59        ASSERT_WITH_SECURITY_IMPLICATION(isNPJSObject(npObject));
    6060        return static_cast<NPJSObject*>(npObject);
    6161    }
Note: See TracChangeset for help on using the changeset viewer.