Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(325)

Unified Diff: third_party/WebKit/Source/core/html/HTMLFormElement.cpp

Issue 2258033002: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLFormElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
index 764102ff84827ab38789db1352d0d886c4b96c4d..e33938f024ce32b211d0bfa527de7d10f4d568a0 100644
--- a/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFormElement.cpp
@@ -302,7 +302,7 @@ void HTMLFormElement::prepareForSubmission(Event* event)
}
bool skipValidation = !document().page() || noValidate();
- ASSERT(event);
+ DCHECK(event);
HTMLFormControlElement* submitElement = submitElementFromEvent(event);
if (submitElement && submitElement->formNoValidate())
skipValidation = true;
@@ -395,9 +395,9 @@ void HTMLFormElement::submit(Event* event, bool activateSubmitButton)
void HTMLFormElement::scheduleFormSubmission(FormSubmission* submission)
{
- ASSERT(submission->method() == FormSubmission::PostMethod || submission->method() == FormSubmission::GetMethod);
- ASSERT(submission->data());
- ASSERT(submission->form());
+ DCHECK(submission->method() == FormSubmission::PostMethod || submission->method() == FormSubmission::GetMethod);
+ DCHECK(submission->data());
+ DCHECK(submission->form());
if (submission->action().isEmpty())
return;
if (document().isSandboxed(SandboxForms)) {
@@ -566,7 +566,7 @@ const FormAssociatedElement::List& HTMLFormElement::associatedElements() const
scope = &NodeTraversal::highestAncestorOrSelf(*mutableThis);
if (isConnected() && m_hasElementsAssociatedByFormAttribute)
scope = &treeScope().rootNode();
- ASSERT(scope);
+ DCHECK(scope);
collectAssociatedElements(*scope, mutableThis->m_associatedElements);
mutableThis->m_associatedElementsAreDirty = false;
return m_associatedElements;
@@ -673,16 +673,16 @@ Element* HTMLFormElement::elementFromPastNamesMap(const AtomicString& pastName)
if (pastName.isEmpty() || !m_pastNamesMap)
return 0;
Element* element = m_pastNamesMap->get(pastName);
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
if (!element)
return 0;
- ASSERT_WITH_SECURITY_IMPLICATION(toHTMLElement(element)->formOwner() == this);
+ SECURITY_DCHECK(toHTMLElement(element)->formOwner() == this);
if (isHTMLImageElement(*element)) {
- ASSERT_WITH_SECURITY_IMPLICATION(imageElements().find(element) != kNotFound);
+ SECURITY_DCHECK(imageElements().find(element) != kNotFound);
} else if (isHTMLObjectElement(*element)) {
- ASSERT_WITH_SECURITY_IMPLICATION(associatedElements().find(toHTMLObjectElement(element)) != kNotFound);
+ SECURITY_DCHECK(associatedElements().find(toHTMLObjectElement(element)) != kNotFound);
} else {
- ASSERT_WITH_SECURITY_IMPLICATION(associatedElements().find(toHTMLFormControlElement(element)) != kNotFound);
+ SECURITY_DCHECK(associatedElements().find(toHTMLFormControlElement(element)) != kNotFound);
}
#endif
return element;
@@ -757,7 +757,7 @@ void HTMLFormElement::anonymousNamedGetter(const AtomicString& name, RadioNodeLi
// but if the first the size cannot be zero.
HeapVector<Member<Element>> elements;
getNamedElements(name, elements);
- ASSERT(!elements.isEmpty());
+ DCHECK(!elements.isEmpty());
bool onlyMatchImg = !elements.isEmpty() && isHTMLImageElement(*elements.first());
if (onlyMatchImg) {

Powered by Google App Engine
This is Rietveld 408576698