Changeset 157342 in webkit
- Timestamp:
- Oct 12, 2013 11:16:42 AM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157341 r157342 1 2013-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 1 63 2013-09-06 Jessica Pease <jessica_n_pease@apple.com> 2 64 -
trunk/Source/WebCore/accessibility/AccessibilityMockObject.h
r157044 r157342 56 56 inline AccessibilityMockObject* toAccessibilityMockObject(AccessibilityObject* object) 57 57 { 58 ASSERT (!object || object->isMockObject());58 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isMockObject()); 59 59 return static_cast<AccessibilityMockObject*>(object); 60 60 } -
trunk/Source/WebCore/bindings/js/JSCanvasRenderingContextCustom.cpp
r157215 r157342 60 60 return wrap<JSWebGLRenderingContext>(exec, globalObject, static_cast<WebGLRenderingContext*>(object)); 61 61 #endif 62 ASSERT (object->is2d());62 ASSERT_WITH_SECURITY_IMPLICATION(object->is2d()); 63 63 return wrap<JSCanvasRenderingContext2D>(exec, globalObject, static_cast<CanvasRenderingContext2D*>(object)); 64 64 } -
trunk/Source/WebCore/bindings/js/ScheduledAction.cpp
r157215 r157342 82 82 #if ENABLE(WORKERS) 83 83 else { 84 ASSERT (context->isWorkerGlobalScope());84 ASSERT_WITH_SECURITY_IMPLICATION(context->isWorkerGlobalScope()); 85 85 execute(static_cast<WorkerGlobalScope*>(context)); 86 86 } -
trunk/Source/WebCore/css/DeprecatedStyleBuilder.cpp
r157024 r157342 1374 1374 for (CSSValueListIterator i(value); i.hasMore(); i.advance()) { 1375 1375 CSSValue* item = i.value(); 1376 ASSERT (item->isPrimitiveValue());1376 ASSERT_WITH_SECURITY_IMPLICATION(item->isPrimitiveValue()); 1377 1377 TextUnderlinePosition t2 = *toCSSPrimitiveValue(item); 1378 1378 t |= t2; -
trunk/Source/WebCore/dom/Element.cpp
r157212 r157342 192 192 inline ElementRareData* Element::elementRareData() const 193 193 { 194 ASSERT (hasRareData());194 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); 195 195 return static_cast<ElementRareData*>(rareData()); 196 196 } … … 421 421 return; 422 422 if (UNLIKELY(name == styleAttr && elementData()->m_styleAttributeIsDirty)) { 423 ASSERT (isStyledElement());423 ASSERT_WITH_SECURITY_IMPLICATION(isStyledElement()); 424 424 static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); 425 425 return; … … 440 440 return; 441 441 if (elementData()->m_styleAttributeIsDirty && equalPossiblyIgnoringCase(localName, styleAttr.localName(), shouldIgnoreAttributeCase(this))) { 442 ASSERT (isStyledElement());442 ASSERT_WITH_SECURITY_IMPLICATION(isStyledElement()); 443 443 static_cast<const StyledElement*>(this)->synchronizeStyleAttributeInternal(); 444 444 return; … … 447 447 if (elementData()->m_animatedSVGAttributesAreDirty) { 448 448 // 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()); 450 450 toSVGElement(this)->synchronizeAnimatedSVGAttribute(QualifiedName(nullAtom, localName, nullAtom)); 451 451 } -
trunk/Source/WebCore/dom/FocusEvent.h
r157210 r157342 73 73 inline FocusEvent* toFocusEvent(Event* event) 74 74 { 75 ASSERT (event && event->isFocusEvent());75 ASSERT_WITH_SECURITY_IMPLICATION(event && event->isFocusEvent()); 76 76 return static_cast<FocusEvent*>(event); 77 77 } -
trunk/Source/WebCore/dom/MouseEvent.h
r157282 r157342 134 134 inline MouseEvent* toMouseEvent(Event* event) 135 135 { 136 ASSERT (event && event->isMouseEvent());136 ASSERT_WITH_SECURITY_IMPLICATION(event && event->isMouseEvent()); 137 137 return static_cast<MouseEvent*>(event); 138 138 } -
trunk/Source/WebCore/dom/Node.cpp
r157316 r157342 369 369 NodeRareData* Node::rareData() const 370 370 { 371 ASSERT (hasRareData());371 ASSERT_WITH_SECURITY_IMPLICATION(hasRareData()); 372 372 return static_cast<NodeRareData*>(m_data.m_rareData); 373 373 } -
trunk/Source/WebCore/dom/StyledElement.cpp
r156550 r157342 155 155 else if (!inlineStyle->isMutable()) 156 156 inlineStyle = inlineStyle->mutableCopy(); 157 ASSERT (inlineStyle->isMutable());157 ASSERT_WITH_SECURITY_IMPLICATION(inlineStyle->isMutable()); 158 158 return static_cast<MutableStylePropertySet&>(*inlineStyle); 159 159 } -
trunk/Source/WebCore/dom/TouchEvent.h
r157210 r157342 97 97 inline TouchEvent* toTouchEvent(Event* event) 98 98 { 99 ASSERT (event && event->isTouchEvent());99 ASSERT_WITH_SECURITY_IMPLICATION(event && event->isTouchEvent()); 100 100 return static_cast<TouchEvent*>(event); 101 101 } -
trunk/Source/WebCore/editing/CompositeEditCommand.h
r157044 r157342 181 181 { 182 182 ASSERT(command); 183 ASSERT (command->isCompositeEditCommand());183 ASSERT_WITH_SECURITY_IMPLICATION(command->isCompositeEditCommand()); 184 184 return static_cast<CompositeEditCommand*>(command); 185 185 } -
trunk/Source/WebCore/html/HTMLObjectElement.cpp
r156940 r157342 244 244 unsigned length = metaElements->length(); 245 245 for (unsigned i = 0; i < length; ++i) { 246 ASSERT (metaElements->item(i)->isHTMLElement());246 ASSERT_WITH_SECURITY_IMPLICATION(metaElements->item(i)->isHTMLElement()); 247 247 HTMLMetaElement* metaElement = static_cast<HTMLMetaElement*>(metaElements->item(i)); 248 248 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 90 90 inline AudioTrack* toAudioTrack(TrackBase* track) 91 91 { 92 ASSERT (track->type() == TrackBase::AudioTrack);92 ASSERT_WITH_SECURITY_IMPLICATION(track->type() == TrackBase::AudioTrack); 93 93 return static_cast<AudioTrack*>(track); 94 94 } -
trunk/Source/WebCore/html/track/TextTrack.h
r156413 r157342 193 193 inline TextTrack* toTextTrack(TrackBase* track) 194 194 { 195 ASSERT (track->type() == TrackBase::TextTrack);195 ASSERT_WITH_SECURITY_IMPLICATION(track->type() == TrackBase::TextTrack); 196 196 return static_cast<TextTrack*>(track); 197 197 } -
trunk/Source/WebCore/html/track/VideoTrack.h
r148785 r157342 90 90 inline VideoTrack* toVideoTrack(TrackBase* track) 91 91 { 92 ASSERT (track->type() == TrackBase::VideoTrack);92 ASSERT_WITH_SECURITY_IMPLICATION(track->type() == TrackBase::VideoTrack); 93 93 return static_cast<VideoTrack*>(track); 94 94 } -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r156422 r157342 1348 1348 return 0; 1349 1349 1350 ASSERT (attributeStyle->isMutable());1350 ASSERT_WITH_SECURITY_IMPLICATION(attributeStyle->isMutable()); 1351 1351 MutableStylePropertySet* mutableAttributeStyle = static_cast<MutableStylePropertySet*>(attributeStyle); 1352 1352 -
trunk/Source/WebCore/loader/cache/CachedResourceClientWalker.h
r130612 r157342 52 52 CachedResourceClient* next = m_clientVector[m_index++]; 53 53 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()); 55 55 return static_cast<T*>(next); 56 56 } -
trunk/Source/WebCore/page/FrameView.h
r157253 r157342 691 691 inline FrameView* toFrameView(Widget* widget) 692 692 { 693 ASSERT (!widget || widget->isFrameView());693 ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isFrameView()); 694 694 return static_cast<FrameView*>(widget); 695 695 } … … 697 697 inline const FrameView* toFrameView(const Widget* widget) 698 698 { 699 ASSERT (!widget || widget->isFrameView());699 ASSERT_WITH_SECURITY_IMPLICATION(!widget || widget->isFrameView()); 700 700 return static_cast<const FrameView*>(widget); 701 701 } -
trunk/Source/WebCore/rendering/InlineBox.cpp
r157011 r157342 270 270 if (m_parent) 271 271 return m_parent->root(); 272 ASSERT (isRootInlineBox());272 ASSERT_WITH_SECURITY_IMPLICATION(isRootInlineBox()); 273 273 return static_cast<const RootInlineBox&>(*this); 274 274 } … … 278 278 if (m_parent) 279 279 return m_parent->root(); 280 ASSERT (isRootInlineBox());280 ASSERT_WITH_SECURITY_IMPLICATION(isRootInlineBox()); 281 281 return static_cast<RootInlineBox&>(*this); 282 282 } -
trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp
r157332 r157342 1230 1230 // text selection in RTL boxes would not work as expected. 1231 1231 if (isSVGRootInlineBox) { 1232 ASSERT (isSVGText());1232 ASSERT_WITH_SECURITY_IMPLICATION(isSVGText()); 1233 1233 static_cast<SVGRootInlineBox*>(lineBox)->computePerCharacterLayoutInformation(); 1234 1234 } -
trunk/Source/WebCore/rendering/svg/SVGPathData.cpp
r155630 r157342 49 49 static void updatePathFromEllipseElement(SVGElement* element, Path& path) 50 50 { 51 ASSERT (element->hasTagName(SVGNames::ellipseTag));51 ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::ellipseTag)); 52 52 SVGEllipseElement* ellipse = static_cast<SVGEllipseElement*>(element); 53 53 … … 64 64 static void updatePathFromLineElement(SVGElement* element, Path& path) 65 65 { 66 ASSERT (element->hasTagName(SVGNames::lineTag));66 ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::lineTag)); 67 67 SVGLineElement* line = static_cast<SVGLineElement*>(element); 68 68 … … 79 79 static void updatePathFromPolygonElement(SVGElement* element, Path& path) 80 80 { 81 ASSERT (element->hasTagName(SVGNames::polygonTag));81 ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::polygonTag)); 82 82 SVGPolygonElement* polygon = static_cast<SVGPolygonElement*>(element); 83 83 … … 97 97 static void updatePathFromPolylineElement(SVGElement* element, Path& path) 98 98 { 99 ASSERT (element->hasTagName(SVGNames::polylineTag));99 ASSERT_WITH_SECURITY_IMPLICATION(element->hasTagName(SVGNames::polylineTag)); 100 100 SVGPolylineElement* polyline = static_cast<SVGPolylineElement*>(element); 101 101 -
trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp
r157075 r157342 300 300 { 301 301 // 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()); 303 303 Document* document = static_cast<Document*>(m_scriptExecutionContext.get()); 304 304 GroupSettings* settings = 0; -
trunk/Source/WebCore/xml/XMLHttpRequest.cpp
r157002 r157342 209 209 Document* XMLHttpRequest::document() const 210 210 { 211 ASSERT (scriptExecutionContext()->isDocument());211 ASSERT_WITH_SECURITY_IMPLICATION(scriptExecutionContext()->isDocument()); 212 212 return static_cast<Document*>(scriptExecutionContext()); 213 213 } -
trunk/Source/WebKit2/ChangeLog
r157341 r157342 1 2013-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 1 15 2013-09-06 Jessica Pease <jessica_n_pease@apple.com> 2 16 -
trunk/Source/WebKit2/Shared/Plugins/NPObjectProxy.h
r156069 r157342 47 47 static NPObjectProxy* toNPObjectProxy(NPObject* npObject) 48 48 { 49 ASSERT (isNPObjectProxy(npObject));49 ASSERT_WITH_SECURITY_IMPLICATION(isNPObjectProxy(npObject)); 50 50 return static_cast<NPObjectProxy*>(npObject); 51 51 } -
trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NPJSObject.h
r148696 r157342 57 57 static NPJSObject* toNPJSObject(NPObject* npObject) 58 58 { 59 ASSERT (isNPJSObject(npObject));59 ASSERT_WITH_SECURITY_IMPLICATION(isNPJSObject(npObject)); 60 60 return static_cast<NPJSObject*>(npObject); 61 61 }
Note: See TracChangeset
for help on using the changeset viewer.