| OLD | NEW |
| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" | 44 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" |
| 45 #include "core/html/imports/HTMLImportChild.h" | 45 #include "core/html/imports/HTMLImportChild.h" |
| 46 #include "core/html/imports/HTMLImportsController.h" | 46 #include "core/html/imports/HTMLImportsController.h" |
| 47 | 47 |
| 48 namespace blink { | 48 namespace blink { |
| 49 | 49 |
| 50 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementScheduler) | 50 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementScheduler) |
| 51 | 51 |
| 52 void CustomElementScheduler::scheduleCallback(PassRefPtr<CustomElementLifecycleC
allbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, CustomElementLifec
ycleCallbacks::CallbackType type) | 52 void CustomElementScheduler::scheduleCallback(PassRefPtr<CustomElementLifecycleC
allbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, CustomElementLifec
ycleCallbacks::CallbackType type) |
| 53 { | 53 { |
| 54 ASSERT(type != CustomElementLifecycleCallbacks::AttributeChanged); | 54 ASSERT(type != CustomElementLifecycleCallbacks::AttributeChangedCallback); |
| 55 | 55 |
| 56 if (!callbacks->hasCallback(type)) | 56 if (!callbacks->hasCallback(type)) |
| 57 return; | 57 return; |
| 58 | 58 |
| 59 CustomElementCallbackQueue& queue = instance().schedule(element); | 59 CustomElementCallbackQueue& queue = instance().schedule(element); |
| 60 queue.append(CustomElementCallbackInvocation::createInvocation(callbacks, ty
pe)); | 60 queue.append(CustomElementCallbackInvocation::createInvocation(callbacks, ty
pe)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void CustomElementScheduler::scheduleAttributeChangedCallback(PassRefPtr<CustomE
lementLifecycleCallbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, co
nst AtomicString& name, const AtomicString& oldValue, const AtomicString& newVal
ue) | 63 void CustomElementScheduler::scheduleAttributeChangedCallback(PassRefPtr<CustomE
lementLifecycleCallbacks> callbacks, PassRefPtrWillBeRawPtr<Element> element, co
nst AtomicString& name, const AtomicString& oldValue, const AtomicString& newVal
ue) |
| 64 { | 64 { |
| 65 if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChange
d)) | 65 if (!callbacks->hasCallback(CustomElementLifecycleCallbacks::AttributeChange
dCallback)) |
| 66 return; | 66 return; |
| 67 | 67 |
| 68 CustomElementCallbackQueue& queue = instance().schedule(element); | 68 CustomElementCallbackQueue& queue = instance().schedule(element); |
| 69 queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocati
on(callbacks, name, oldValue, newValue)); | 69 queue.append(CustomElementCallbackInvocation::createAttributeChangedInvocati
on(callbacks, name, oldValue, newValue)); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void CustomElementScheduler::resolveOrScheduleResolution(PassRefPtrWillBeRawPtr<
CustomElementRegistrationContext> context, PassRefPtrWillBeRawPtr<Element> eleme
nt, const CustomElementDescriptor& descriptor) | 72 void CustomElementScheduler::resolveOrScheduleResolution(PassRefPtrWillBeRawPtr<
CustomElementRegistrationContext> context, PassRefPtrWillBeRawPtr<Element> eleme
nt, const CustomElementDescriptor& descriptor) |
| 73 { | 73 { |
| 74 if (CustomElementCallbackDispatcher::inCallbackDeliveryScope()) { | 74 if (CustomElementCallbackDispatcher::inCallbackDeliveryScope()) { |
| 75 context->resolve(element.get(), descriptor); | 75 context->resolve(element.get(), descriptor); |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 void CustomElementScheduler::trace(Visitor* visitor) | 159 void CustomElementScheduler::trace(Visitor* visitor) |
| 160 { | 160 { |
| 161 #if ENABLE(OILPAN) | 161 #if ENABLE(OILPAN) |
| 162 visitor->trace(m_elementCallbackQueueMap); | 162 visitor->trace(m_elementCallbackQueueMap); |
| 163 #endif | 163 #endif |
| 164 } | 164 } |
| 165 | 165 |
| 166 } // namespace blink | 166 } // namespace blink |
| OLD | NEW |