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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 { | 110 { |
111 DEFINE_STATIC_LOCAL(CustomElementScheduler, instance, ()); | 111 DEFINE_STATIC_LOCAL(CustomElementScheduler, instance, ()); |
112 return instance; | 112 return instance; |
113 } | 113 } |
114 | 114 |
115 CustomElementCallbackQueue* CustomElementScheduler::ensureCallbackQueue(PassRefP
tr<Element> element) | 115 CustomElementCallbackQueue* CustomElementScheduler::ensureCallbackQueue(PassRefP
tr<Element> element) |
116 { | 116 { |
117 Element* key = element.get(); | 117 Element* key = element.get(); |
118 ElementCallbackQueueMap::iterator it = m_elementCallbackQueueMap.find(key); | 118 ElementCallbackQueueMap::iterator it = m_elementCallbackQueueMap.find(key); |
119 if (it == m_elementCallbackQueueMap.end()) | 119 if (it == m_elementCallbackQueueMap.end()) |
120 it = m_elementCallbackQueueMap.add(key, CustomElementCallbackQueue::crea
te(element)).iterator; | 120 return m_elementCallbackQueueMap.add(key, CustomElementCallbackQueue::cr
eate(element)).storedValue->value.get(); |
121 return it->value.get(); | 121 return it->value.get(); |
122 } | 122 } |
123 | 123 |
124 void CustomElementScheduler::callbackDispatcherDidFinish() | 124 void CustomElementScheduler::callbackDispatcherDidFinish() |
125 { | 125 { |
126 if (CustomElementMicrotaskDispatcher::instance().elementQueueIsEmpty()) | 126 if (CustomElementMicrotaskDispatcher::instance().elementQueueIsEmpty()) |
127 instance().clearElementCallbackQueueMap(); | 127 instance().clearElementCallbackQueueMap(); |
128 } | 128 } |
129 | 129 |
130 void CustomElementScheduler::microtaskDispatcherDidFinish() | 130 void CustomElementScheduler::microtaskDispatcherDidFinish() |
(...skipping 26 matching lines...) Expand all Loading... |
157 // The processing stack is active. | 157 // The processing stack is active. |
158 CustomElementCallbackDispatcher::instance().enqueue(callbackQueue); | 158 CustomElementCallbackDispatcher::instance().enqueue(callbackQueue); |
159 return callbackQueue; | 159 return callbackQueue; |
160 } | 160 } |
161 | 161 |
162 CustomElementMicrotaskDispatcher::instance().enqueue(callbackQueue); | 162 CustomElementMicrotaskDispatcher::instance().enqueue(callbackQueue); |
163 return callbackQueue; | 163 return callbackQueue; |
164 } | 164 } |
165 | 165 |
166 } // namespace WebCore | 166 } // namespace WebCore |
OLD | NEW |