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

Unified Diff: Source/core/dom/custom/CustomElement.cpp

Issue 220013003: Simplify CustomElementScheduler by passing the enum for callback type directly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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
« no previous file with comments | « no previous file | Source/core/dom/custom/CustomElementCallbackInvocation.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/custom/CustomElement.cpp
diff --git a/Source/core/dom/custom/CustomElement.cpp b/Source/core/dom/custom/CustomElement.cpp
index 4810925d22f5b1802d2e76486955a8991132c530..432b7f5ba7c94a64155427f62dc52711008a0146 100644
--- a/Source/core/dom/custom/CustomElement.cpp
+++ b/Source/core/dom/custom/CustomElement.cpp
@@ -98,7 +98,7 @@ void CustomElement::define(Element* element, PassRefPtr<CustomElementDefinition>
case Element::WaitingForUpgrade:
element->setCustomElementDefinition(definition);
- CustomElementScheduler::scheduleCreatedCallback(definition->callbacks(), element);
+ CustomElementScheduler::scheduleCallback(definition->callbacks(), element, CustomElementLifecycleCallbacks::Created);
break;
}
}
@@ -114,7 +114,7 @@ void CustomElement::didEnterDocument(Element* element, const Document& document)
ASSERT(element->customElementState() == Element::Upgraded);
if (!document.domWindow())
return;
- CustomElementScheduler::scheduleAttachedCallback(element->customElementDefinition()->callbacks(), element);
+ CustomElementScheduler::scheduleCallback(element->customElementDefinition()->callbacks(), element, CustomElementLifecycleCallbacks::Attached);
}
void CustomElement::didLeaveDocument(Element* element, const Document& document)
@@ -122,7 +122,7 @@ void CustomElement::didLeaveDocument(Element* element, const Document& document)
ASSERT(element->customElementState() == Element::Upgraded);
if (!document.domWindow())
return;
- CustomElementScheduler::scheduleDetachedCallback(element->customElementDefinition()->callbacks(), element);
+ CustomElementScheduler::scheduleCallback(element->customElementDefinition()->callbacks(), element, CustomElementLifecycleCallbacks::Detached);
}
void CustomElement::wasDestroyed(Element* element)
« no previous file with comments | « no previous file | Source/core/dom/custom/CustomElementCallbackInvocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698