| Index: third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/custom/CustomElementScheduler.cpp b/third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp
|
| similarity index 52%
|
| rename from third_party/WebKit/Source/core/dom/custom/CustomElementScheduler.cpp
|
| rename to third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp
|
| index 574569327e73c2ad59ebd450520621835577fe41..21e5b843d1c834e0ca5b2db8c7ccff34f1dcc8d6 100644
|
| --- a/third_party/WebKit/Source/core/dom/custom/CustomElementScheduler.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/custom/V0CustomElementScheduler.cpp
|
| @@ -28,26 +28,26 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#include "core/dom/custom/CustomElementScheduler.h"
|
| +#include "core/dom/custom/V0CustomElementScheduler.h"
|
|
|
| #include "core/dom/Document.h"
|
| #include "core/dom/Element.h"
|
| -#include "core/dom/custom/CustomElementCallbackInvocation.h"
|
| -#include "core/dom/custom/CustomElementLifecycleCallbacks.h"
|
| -#include "core/dom/custom/CustomElementMicrotaskDispatcher.h"
|
| -#include "core/dom/custom/CustomElementMicrotaskImportStep.h"
|
| -#include "core/dom/custom/CustomElementMicrotaskResolutionStep.h"
|
| -#include "core/dom/custom/CustomElementMicrotaskRunQueue.h"
|
| -#include "core/dom/custom/CustomElementProcessingStack.h"
|
| -#include "core/dom/custom/CustomElementRegistrationContext.h"
|
| -#include "core/dom/custom/CustomElementSyncMicrotaskQueue.h"
|
| +#include "core/dom/custom/V0CustomElementCallbackInvocation.h"
|
| +#include "core/dom/custom/V0CustomElementLifecycleCallbacks.h"
|
| +#include "core/dom/custom/V0CustomElementMicrotaskDispatcher.h"
|
| +#include "core/dom/custom/V0CustomElementMicrotaskImportStep.h"
|
| +#include "core/dom/custom/V0CustomElementMicrotaskResolutionStep.h"
|
| +#include "core/dom/custom/V0CustomElementMicrotaskRunQueue.h"
|
| +#include "core/dom/custom/V0CustomElementProcessingStack.h"
|
| +#include "core/dom/custom/V0CustomElementRegistrationContext.h"
|
| +#include "core/dom/custom/V0CustomElementSyncMicrotaskQueue.h"
|
| #include "core/html/imports/HTMLImportChild.h"
|
| #include "core/html/imports/HTMLImportsController.h"
|
|
|
| namespace blink {
|
|
|
| // FIXME: Consider moving the element's callback queue to ElementRareData.
|
| -typedef HeapHashMap<Member<Element>, Member<CustomElementCallbackQueue>> ElementCallbackQueueMap;
|
| +typedef HeapHashMap<Member<Element>, Member<V0CustomElementCallbackQueue>> ElementCallbackQueueMap;
|
|
|
| static ElementCallbackQueueMap& callbackQueues()
|
| {
|
| @@ -55,18 +55,18 @@ static ElementCallbackQueueMap& callbackQueues()
|
| return map;
|
| }
|
|
|
| -static CustomElementCallbackQueue& ensureCallbackQueue(Element* element)
|
| +static V0CustomElementCallbackQueue& ensureCallbackQueue(Element* element)
|
| {
|
| ElementCallbackQueueMap::ValueType* it = callbackQueues().add(element, nullptr).storedValue;
|
| if (!it->value)
|
| - it->value = CustomElementCallbackQueue::create(element);
|
| + it->value = V0CustomElementCallbackQueue::create(element);
|
| return *it->value.get();
|
| }
|
|
|
| // Finds or creates the callback queue for element.
|
| -static CustomElementCallbackQueue& scheduleCallbackQueue(Element* element)
|
| +static V0CustomElementCallbackQueue& scheduleCallbackQueue(Element* element)
|
| {
|
| - CustomElementCallbackQueue& callbackQueue = ensureCallbackQueue(element);
|
| + V0CustomElementCallbackQueue& callbackQueue = ensureCallbackQueue(element);
|
| if (callbackQueue.inCreatedCallback()) {
|
| // Don't move it. Authors use the createdCallback like a
|
| // constructor. By not moving it, the createdCallback
|
| @@ -75,77 +75,77 @@ static CustomElementCallbackQueue& scheduleCallbackQueue(Element* element)
|
| return callbackQueue;
|
| }
|
|
|
| - if (CustomElementProcessingStack::inCallbackDeliveryScope()) {
|
| + if (V0CustomElementProcessingStack::inCallbackDeliveryScope()) {
|
| // The processing stack is active.
|
| - CustomElementProcessingStack::instance().enqueue(&callbackQueue);
|
| + V0CustomElementProcessingStack::instance().enqueue(&callbackQueue);
|
| return callbackQueue;
|
| }
|
|
|
| - CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue);
|
| + V0CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue);
|
| return callbackQueue;
|
| }
|
|
|
| -void CustomElementScheduler::scheduleCallback(CustomElementLifecycleCallbacks* callbacks, Element* element, CustomElementLifecycleCallbacks::CallbackType type)
|
| +void V0CustomElementScheduler::scheduleCallback(V0CustomElementLifecycleCallbacks* callbacks, Element* element, V0CustomElementLifecycleCallbacks::CallbackType type)
|
| {
|
| - DCHECK(type != CustomElementLifecycleCallbacks::AttributeChangedCallback);
|
| + DCHECK(type != V0CustomElementLifecycleCallbacks::AttributeChangedCallback);
|
|
|
| if (!callbacks->hasCallback(type))
|
| return;
|
|
|
| - CustomElementCallbackQueue& queue = scheduleCallbackQueue(element);
|
| - queue.append(CustomElementCallbackInvocation::createInvocation(callbacks, type));
|
| + V0CustomElementCallbackQueue& queue = scheduleCallbackQueue(element);
|
| + queue.append(V0CustomElementCallbackInvocation::createInvocation(callbacks, type));
|
| }
|
|
|
| -void CustomElementScheduler::scheduleAttributeChangedCallback(CustomElementLifecycleCallbacks* callbacks, Element* element, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue)
|
| +void V0CustomElementScheduler::scheduleAttributeChangedCallback(V0CustomElementLifecycleCallbacks* callbacks, Element* element, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue)
|
| {
|
| - if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChangedCallback))
|
| + if (!callbacks->hasCallback(V0CustomElementLifecycleCallbacks::AttributeChangedCallback))
|
| return;
|
|
|
| - CustomElementCallbackQueue& queue = scheduleCallbackQueue(element);
|
| - queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocation(callbacks, name, oldValue, newValue));
|
| + V0CustomElementCallbackQueue& queue = scheduleCallbackQueue(element);
|
| + queue.append(V0CustomElementCallbackInvocation::createAttributeChangedInvocation(callbacks, name, oldValue, newValue));
|
| }
|
|
|
| -void CustomElementScheduler::resolveOrScheduleResolution(CustomElementRegistrationContext* context, Element* element, const CustomElementDescriptor& descriptor)
|
| +void V0CustomElementScheduler::resolveOrScheduleResolution(V0CustomElementRegistrationContext* context, Element* element, const V0CustomElementDescriptor& descriptor)
|
| {
|
| - if (CustomElementProcessingStack::inCallbackDeliveryScope()) {
|
| + if (V0CustomElementProcessingStack::inCallbackDeliveryScope()) {
|
| context->resolve(element, descriptor);
|
| return;
|
| }
|
|
|
| Document& document = element->document();
|
| - CustomElementMicrotaskResolutionStep* step = CustomElementMicrotaskResolutionStep::create(context, element, descriptor);
|
| + V0CustomElementMicrotaskResolutionStep* step = V0CustomElementMicrotaskResolutionStep::create(context, element, descriptor);
|
| enqueueMicrotaskStep(document, step);
|
| }
|
|
|
| -CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImportChild* import)
|
| +V0CustomElementMicrotaskImportStep* V0CustomElementScheduler::scheduleImport(HTMLImportChild* import)
|
| {
|
| DCHECK(!import->hasFinishedLoading());
|
| DCHECK(import->parent());
|
|
|
| // Ownership of the new step is transferred to the parent
|
| // processing step, or the base queue.
|
| - CustomElementMicrotaskImportStep* step = CustomElementMicrotaskImportStep::create(import);
|
| - CustomElementMicrotaskImportStep* rawStep = step;
|
| + V0CustomElementMicrotaskImportStep* step = V0CustomElementMicrotaskImportStep::create(import);
|
| + V0CustomElementMicrotaskImportStep* rawStep = step;
|
| enqueueMicrotaskStep(*(import->parent()->document()), step, import->isSync());
|
| return rawStep;
|
| }
|
|
|
| -void CustomElementScheduler::enqueueMicrotaskStep(Document& document, CustomElementMicrotaskStep* step, bool importIsSync)
|
| +void V0CustomElementScheduler::enqueueMicrotaskStep(Document& document, V0CustomElementMicrotaskStep* step, bool importIsSync)
|
| {
|
| Document& master = document.importsController() ? *(document.importsController()->master()) : document;
|
| master.customElementMicrotaskRunQueue()->enqueue(document.importLoader(), step, importIsSync);
|
| }
|
|
|
|
|
| -void CustomElementScheduler::callbackDispatcherDidFinish()
|
| +void V0CustomElementScheduler::callbackDispatcherDidFinish()
|
| {
|
| - if (CustomElementMicrotaskDispatcher::instance().elementQueueIsEmpty())
|
| + if (V0CustomElementMicrotaskDispatcher::instance().elementQueueIsEmpty())
|
| callbackQueues().clear();
|
| }
|
|
|
| -void CustomElementScheduler::microtaskDispatcherDidFinish()
|
| +void V0CustomElementScheduler::microtaskDispatcherDidFinish()
|
| {
|
| - DCHECK(!CustomElementProcessingStack::inCallbackDeliveryScope());
|
| + DCHECK(!V0CustomElementProcessingStack::inCallbackDeliveryScope());
|
| callbackQueues().clear();
|
| }
|
|
|
|
|