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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElement.cpp

Issue 1854423002: ASSERT -> {DCHECK|DCHECK_XX}, ENABLE(ASSERT) -> DCHECK_IS_ON() in dom (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mark svg/as-image/svg-nested.html crash on win Created 4 years, 8 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 case Element::WaitingForUpgrade: 115 case Element::WaitingForUpgrade:
116 element->setCustomElementDefinition(definition); 116 element->setCustomElementDefinition(definition);
117 CustomElementScheduler::scheduleCallback(definition->callbacks(), elemen t, CustomElementLifecycleCallbacks::CreatedCallback); 117 CustomElementScheduler::scheduleCallback(definition->callbacks(), elemen t, CustomElementLifecycleCallbacks::CreatedCallback);
118 break; 118 break;
119 } 119 }
120 } 120 }
121 121
122 void CustomElement::attributeDidChange(Element* element, const AtomicString& nam e, const AtomicString& oldValue, const AtomicString& newValue) 122 void CustomElement::attributeDidChange(Element* element, const AtomicString& nam e, const AtomicString& oldValue, const AtomicString& newValue)
123 { 123 {
124 ASSERT(element->getCustomElementState() == Element::Upgraded); 124 DCHECK_EQ(element->getCustomElementState(), Element::Upgraded);
125 CustomElementScheduler::scheduleAttributeChangedCallback(element->customElem entDefinition()->callbacks(), element, name, oldValue, newValue); 125 CustomElementScheduler::scheduleAttributeChangedCallback(element->customElem entDefinition()->callbacks(), element, name, oldValue, newValue);
126 } 126 }
127 127
128 void CustomElement::didAttach(Element* element, const Document& document) 128 void CustomElement::didAttach(Element* element, const Document& document)
129 { 129 {
130 ASSERT(element->getCustomElementState() == Element::Upgraded); 130 DCHECK_EQ(element->getCustomElementState(), Element::Upgraded);
131 if (!document.domWindow()) 131 if (!document.domWindow())
132 return; 132 return;
133 CustomElementScheduler::scheduleCallback(element->customElementDefinition()- >callbacks(), element, CustomElementLifecycleCallbacks::AttachedCallback); 133 CustomElementScheduler::scheduleCallback(element->customElementDefinition()- >callbacks(), element, CustomElementLifecycleCallbacks::AttachedCallback);
134 } 134 }
135 135
136 void CustomElement::didDetach(Element* element, const Document& document) 136 void CustomElement::didDetach(Element* element, const Document& document)
137 { 137 {
138 ASSERT(element->getCustomElementState() == Element::Upgraded); 138 DCHECK_EQ(element->getCustomElementState(), Element::Upgraded);
139 if (!document.domWindow()) 139 if (!document.domWindow())
140 return; 140 return;
141 CustomElementScheduler::scheduleCallback(element->customElementDefinition()- >callbacks(), element, CustomElementLifecycleCallbacks::DetachedCallback); 141 CustomElementScheduler::scheduleCallback(element->customElementDefinition()- >callbacks(), element, CustomElementLifecycleCallbacks::DetachedCallback);
142 } 142 }
143 143
144 void CustomElement::wasDestroyed(Element* element) 144 void CustomElement::wasDestroyed(Element* element)
145 { 145 {
146 switch (element->getCustomElementState()) { 146 switch (element->getCustomElementState()) {
147 case Element::NotCustomElement: 147 case Element::NotCustomElement:
148 ASSERT_NOT_REACHED(); 148 ASSERT_NOT_REACHED();
149 break; 149 break;
150 150
151 case Element::WaitingForUpgrade: 151 case Element::WaitingForUpgrade:
152 case Element::Upgraded: 152 case Element::Upgraded:
153 CustomElementObserver::notifyElementWasDestroyed(element); 153 CustomElementObserver::notifyElementWasDestroyed(element);
154 break; 154 break;
155 } 155 }
156 } 156 }
157 157
158 } // namespace blink 158 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698