Replace ExceptionCode assertions with ASSERT_NO_EXCEPTION macro.
authormkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 15:14:05 +0000 (15:14 +0000)
committermkwst@chromium.org <mkwst@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Feb 2013 15:14:05 +0000 (15:14 +0000)
commitb95214571c699aedb4301cfe8c80b8b03137dee3
tree19206fdb8c178ba646dbc5130d53fbc6fd83e44a
parentc19aa996da8b478dfcf6008e76d2ee63177e9efe
Replace ExceptionCode assertions with ASSERT_NO_EXCEPTION macro.
https://bugs.webkit.org/show_bug.cgi?id=109044

Reviewed by Darin Adler.

The pattern:

    ExceptionCode ec = 0;
    methodThatGeneratesException(ec);
    ASSERT(!ec);

is more clearly and succinctly written as:

    methodThatGeneratesException(ASSERT_NO_EXCEPTION);

This patch replaces the occurances of the former that never touch 'ec'
again with the latter. It does the same for 'ASSERT(ec == 0);' (and, as
a drive-by, replaces 'ASSERT(ec == 0)' with 'ASSERT(!ec)' in places
where it does indeed matter that 'ec' get set properly.

No change in behavior should result from this refactoring.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::direction):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::mode):
* dom/ContainerNode.cpp:
(WebCore::ContainerNode::takeAllChildrenFrom):
* dom/Document.cpp:
(WebCore::Document::setTitle):
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::disentanglePorts):
* editing/DeleteButtonController.cpp:
(WebCore::enclosingDeletableElement):
(WebCore::DeleteButtonController::createDeletionUI):
    Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
(WebCore::DeleteButtonController::show):
    Replaced 'ASSERT(ec == 0)' with 'ASSERT(!ec)' to match the style guide.
* editing/EditorCommand.cpp:
(WebCore::unionDOMRanges):
* editing/ReplaceNodeWithSpanCommand.cpp:
(WebCore::swapInNodePreservingAttributesAndChildren):
* editing/ReplaceSelectionCommand.cpp:
(WebCore::ReplacementFragment::ReplacementFragment):
(WebCore::ReplacementFragment::removeNode):
(WebCore::ReplacementFragment::insertNodeBefore):
(WebCore::ReplacementFragment::insertFragmentForTestRendering):
(WebCore::ReplacementFragment::restoreAndRemoveTestRenderingNodesToFragment):
(WebCore::ReplaceSelectionCommand::insertAsListItems):
* editing/SplitTextNodeCommand.cpp:
(WebCore::SplitTextNodeCommand::doUnapply):
* editing/TextIterator.cpp:
(WebCore::CharacterIterator::range):
(WebCore::BackwardsCharacterIterator::range):
(WebCore::TextIterator::rangeFromLocationAndLength):
(WebCore::collapsedToBoundary):
* editing/htmlediting.cpp:
(WebCore::createTabSpanElement):
* editing/mac/EditorMac.mm:
(WebCore::Editor::fontForSelection):
(WebCore::Editor::fontAttributesForSelectionStart):
* editing/markup.cpp:
(WebCore::createMarkup):
(WebCore::trimFragment):
(WebCore::createFragmentFromMarkupWithContext):
(WebCore::fillContainerFromString):
(WebCore::createFragmentFromText):
(WebCore::createFragmentFromNodes):
* html/ColorInputType.cpp:
(WebCore::ColorInputType::createShadowSubtree):
    Replaced inline ASSERT with ASSERT_NO_EXCEPTION.
* html/HTMLOptionsCollection.cpp:
(WebCore::HTMLOptionsCollection::add):
    Replaced 'ASSERT(ec == 0)' with 'ASSERT(!ec)' to match the style guide.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updatePlaceholderText):
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::indexForVisiblePosition):
(WebCore::HTMLTextFormControlElement::setInnerTextValue):
* html/TextFieldInputType.cpp:
(WebCore::TextFieldInputType::updatePlaceholderText):
* html/ValidationMessage.cpp:
(WebCore::ValidationMessage::buildBubbleTree):
* html/shadow/MediaControlElementTypes.cpp:
(WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::getCookies):
* inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::addRule):
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::dispatchDOMEvent):
* page/DOMSelection.cpp:
(WebCore::DOMSelection::deleteFromDocument):
* page/DragController.cpp:
(WebCore::prepareClipboardForImageDrag):
* rendering/RenderTextControl.cpp:
(WebCore::RenderTextControl::visiblePositionForIndex):
* rendering/style/SVGRenderStyle.h:
(WebCore::SVGRenderStyle::initialBaselineShiftValue):
(WebCore::SVGRenderStyle::initialKerning):
(WebCore::SVGRenderStyle::initialStrokeDashOffset):
(WebCore::SVGRenderStyle::initialStrokeWidth):
* svg/SVGAnimatedLength.cpp:
(WebCore::sharedSVGLength):
(WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
* svg/SVGAnimatedLengthList.cpp:
(WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
(WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
* svg/SVGLength.cpp:
(WebCore::SVGLength::SVGLength):
* svg/SVGTextContentElement.cpp:
(WebCore::SVGTextContentElement::textLengthAnimated):
* svg/animation/SVGSMILElement.cpp:
(WebCore::constructQualifiedName):
    Replaced inline ASSERT with ASSERT_NO_EXCEPTION.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
35 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/indexeddb/IDBCursor.cpp
Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp
Source/WebCore/Modules/indexeddb/IDBTransaction.cpp
Source/WebCore/dom/ContainerNode.cpp
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/MessagePort.cpp
Source/WebCore/editing/DeleteButtonController.cpp
Source/WebCore/editing/EditorCommand.cpp
Source/WebCore/editing/ReplaceNodeWithSpanCommand.cpp
Source/WebCore/editing/ReplaceSelectionCommand.cpp
Source/WebCore/editing/SplitTextNodeCommand.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/editing/htmlediting.cpp
Source/WebCore/editing/mac/EditorMac.mm
Source/WebCore/editing/markup.cpp
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/HTMLOptionsCollection.cpp
Source/WebCore/html/HTMLTextAreaElement.cpp
Source/WebCore/html/HTMLTextFormControlElement.cpp
Source/WebCore/html/TextFieldInputType.cpp
Source/WebCore/html/ValidationMessage.cpp
Source/WebCore/html/shadow/MediaControlElementTypes.cpp
Source/WebCore/inspector/InspectorPageAgent.cpp
Source/WebCore/inspector/InspectorStyleSheet.cpp
Source/WebCore/loader/appcache/ApplicationCacheHost.cpp
Source/WebCore/page/DOMSelection.cpp
Source/WebCore/page/DragController.cpp
Source/WebCore/rendering/RenderTextControl.cpp
Source/WebCore/rendering/style/SVGRenderStyle.h
Source/WebCore/svg/SVGAnimatedLength.cpp
Source/WebCore/svg/SVGAnimatedLengthList.cpp
Source/WebCore/svg/SVGLength.cpp
Source/WebCore/svg/SVGTextContentElement.cpp
Source/WebCore/svg/animation/SVGSMILElement.cpp