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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 HTMLImportLoader* loader = element->document().importLoader(); | 77 HTMLImportLoader* loader = element->document().importLoader(); |
78 OwnPtrWillBeRawPtr<CustomElementMicrotaskResolutionStep> step = CustomElemen
tMicrotaskResolutionStep::create(context, element, descriptor); | 78 OwnPtrWillBeRawPtr<CustomElementMicrotaskResolutionStep> step = CustomElemen
tMicrotaskResolutionStep::create(context, element, descriptor); |
79 CustomElementMicrotaskDispatcher::instance().enqueue(loader, step.release())
; | 79 CustomElementMicrotaskDispatcher::instance().enqueue(loader, step.release())
; |
80 } | 80 } |
81 | 81 |
82 CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImp
ortChild* import) | 82 CustomElementMicrotaskImportStep* CustomElementScheduler::scheduleImport(HTMLImp
ortChild* import) |
83 { | 83 { |
84 ASSERT(!import->isDone()); | 84 ASSERT(!import->isDone()); |
85 ASSERT(import->parent()); | 85 ASSERT(import->parent()); |
86 | 86 |
| 87 // Ownership of the new step is transferred to the parent |
| 88 // processing step, or the base queue. |
87 OwnPtrWillBeRawPtr<CustomElementMicrotaskImportStep> step = CustomElementMic
rotaskImportStep::create(import); | 89 OwnPtrWillBeRawPtr<CustomElementMicrotaskImportStep> step = CustomElementMic
rotaskImportStep::create(import); |
88 CustomElementMicrotaskImportStep* rawStep = step.get(); | 90 CustomElementMicrotaskImportStep* rawStep = step.get(); |
89 | 91 CustomElementMicrotaskDispatcher::instance().enqueue(import->parent()->loade
r(), step.release(), import->isSync()); |
90 // Ownership of the new step is transferred to the parent | |
91 // processing step, or the base queue. | |
92 CustomElementMicrotaskDispatcher::instance().enqueue(import->parent()->loade
r(), step.release()); | |
93 | |
94 return rawStep; | 92 return rawStep; |
95 } | 93 } |
96 | 94 |
97 CustomElementScheduler& CustomElementScheduler::instance() | 95 CustomElementScheduler& CustomElementScheduler::instance() |
98 { | 96 { |
99 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CustomElementScheduler>, instance
, (adoptPtrWillBeNoop (new CustomElementScheduler()))); | 97 DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CustomElementScheduler>, instance
, (adoptPtrWillBeNoop (new CustomElementScheduler()))); |
100 return *instance; | 98 return *instance; |
101 } | 99 } |
102 | 100 |
103 CustomElementCallbackQueue& CustomElementScheduler::ensureCallbackQueue(PassRefP
trWillBeRawPtr<Element> element) | 101 CustomElementCallbackQueue& CustomElementScheduler::ensureCallbackQueue(PassRefP
trWillBeRawPtr<Element> element) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue); | 147 CustomElementMicrotaskDispatcher::instance().enqueue(&callbackQueue); |
150 return callbackQueue; | 148 return callbackQueue; |
151 } | 149 } |
152 | 150 |
153 void CustomElementScheduler::trace(Visitor* visitor) | 151 void CustomElementScheduler::trace(Visitor* visitor) |
154 { | 152 { |
155 visitor->trace(m_elementCallbackQueueMap); | 153 visitor->trace(m_elementCallbackQueueMap); |
156 } | 154 } |
157 | 155 |
158 } // namespace WebCore | 156 } // namespace WebCore |
OLD | NEW |