| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 static void scheduleCallback(PassRefPtr<CustomElementLifecycleCallbacks>, Pa
ssRefPtr<Element>, CustomElementLifecycleCallbacks::CallbackType); | 56 static void scheduleCallback(PassRefPtr<CustomElementLifecycleCallbacks>, Pa
ssRefPtr<Element>, CustomElementLifecycleCallbacks::CallbackType); |
| 57 static void scheduleAttributeChangedCallback(PassRefPtr<CustomElementLifecyc
leCallbacks>, PassRefPtr<Element>, const AtomicString& name, const AtomicString&
oldValue, const AtomicString& newValue); | 57 static void scheduleAttributeChangedCallback(PassRefPtr<CustomElementLifecyc
leCallbacks>, PassRefPtr<Element>, const AtomicString& name, const AtomicString&
oldValue, const AtomicString& newValue); |
| 58 | 58 |
| 59 static void resolveOrScheduleResolution(PassRefPtr<CustomElementRegistration
Context>, PassRefPtr<Element>, const CustomElementDescriptor&); | 59 static void resolveOrScheduleResolution(PassRefPtr<CustomElementRegistration
Context>, PassRefPtr<Element>, const CustomElementDescriptor&); |
| 60 static CustomElementMicrotaskImportStep* scheduleImport(HTMLImportChild*); | 60 static CustomElementMicrotaskImportStep* scheduleImport(HTMLImportChild*); |
| 61 | 61 |
| 62 static void microtaskDispatcherDidFinish(); | 62 static void microtaskDispatcherDidFinish(); |
| 63 static void callbackDispatcherDidFinish(); | 63 static void callbackDispatcherDidFinish(); |
| 64 | 64 |
| 65 void trace(Visitor*); | |
| 66 | |
| 67 private: | 65 private: |
| 68 CustomElementScheduler() { } | 66 CustomElementScheduler() { } |
| 69 | 67 |
| 70 static CustomElementScheduler& instance(); | 68 static CustomElementScheduler& instance(); |
| 71 static void enqueueMicrotaskStep(Document&, PassOwnPtr<CustomElementMicrotas
kStep>, bool importIsSync = true); | 69 static void enqueueMicrotaskStep(Document&, PassOwnPtr<CustomElementMicrotas
kStep>, bool importIsSync = true); |
| 72 | 70 |
| 73 CustomElementCallbackQueue& ensureCallbackQueue(PassRefPtr<Element>); | 71 CustomElementCallbackQueue& ensureCallbackQueue(PassRefPtr<Element>); |
| 74 CustomElementCallbackQueue& schedule(PassRefPtr<Element>); | 72 CustomElementCallbackQueue& schedule(PassRefPtr<Element>); |
| 75 | 73 |
| 76 // FIXME: Consider moving the element's callback queue to | 74 // FIXME: Consider moving the element's callback queue to |
| 77 // ElementRareData. Then the scheduler can become completely | 75 // ElementRareData. Then the scheduler can become completely |
| 78 // static. | 76 // static. |
| 79 void clearElementCallbackQueueMap(); | 77 void clearElementCallbackQueueMap(); |
| 80 | 78 |
| 81 // The element -> callback queue map is populated by the scheduler | 79 // The element -> callback queue map is populated by the scheduler |
| 82 // and owns the lifetimes of the CustomElementCallbackQueues. | 80 // and owns the lifetimes of the CustomElementCallbackQueues. |
| 83 typedef HashMap<RawPtr<Element>, OwnPtr<CustomElementCallbackQueue> > Elemen
tCallbackQueueMap; | 81 typedef HashMap<RawPtr<Element>, OwnPtr<CustomElementCallbackQueue> > Elemen
tCallbackQueueMap; |
| 84 ElementCallbackQueueMap m_elementCallbackQueueMap; | 82 ElementCallbackQueueMap m_elementCallbackQueueMap; |
| 85 }; | 83 }; |
| 86 | 84 |
| 87 } | 85 } |
| 88 | 86 |
| 89 #endif // CustomElementScheduler_h | 87 #endif // CustomElementScheduler_h |
| OLD | NEW |