| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 processElementQueueAndPop(); | 56 processElementQueueAndPop(); |
| 57 s_elementQueueStart = m_savedElementQueueStart; | 57 s_elementQueueStart = m_savedElementQueueStart; |
| 58 } | 58 } |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 size_t m_savedElementQueueStart; | 61 size_t m_savedElementQueueStart; |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 static bool inCallbackDeliveryScope() { return s_elementQueueStart; } | 64 static bool inCallbackDeliveryScope() { return s_elementQueueStart; } |
| 65 | 65 |
| 66 protected: | |
| 67 friend class CustomElementScheduler; | |
| 68 static CustomElementProcessingStack& instance(); | 66 static CustomElementProcessingStack& instance(); |
| 69 void enqueue(CustomElementCallbackQueue*); | 67 void enqueue(CustomElementCallbackQueue*); |
| 70 | 68 |
| 71 private: | 69 private: |
| 72 CustomElementProcessingStack() | 70 CustomElementProcessingStack() |
| 73 { | 71 { |
| 74 // Add a null element as a sentinel. This makes it possible to | 72 // Add a null element as a sentinel. This makes it possible to |
| 75 // identify elements queued when there is no | 73 // identify elements queued when there is no |
| 76 // CallbackDeliveryScope active. Also, if the processing stack | 74 // CallbackDeliveryScope active. Also, if the processing stack |
| 77 // is popped when empty, this sentinel will cause a null deref | 75 // is popped when empty, this sentinel will cause a null deref |
| (...skipping 20 matching lines...) Expand all Loading... |
| 98 // The processing stack, flattened. Element queues lower in the | 96 // The processing stack, flattened. Element queues lower in the |
| 99 // stack appear toward the head of the vector. The first element | 97 // stack appear toward the head of the vector. The first element |
| 100 // is a null sentinel value. | 98 // is a null sentinel value. |
| 101 static const size_t kNumSentinels = 1; | 99 static const size_t kNumSentinels = 1; |
| 102 Vector<CustomElementCallbackQueue*> m_flattenedProcessingStack; | 100 Vector<CustomElementCallbackQueue*> m_flattenedProcessingStack; |
| 103 }; | 101 }; |
| 104 | 102 |
| 105 } | 103 } |
| 106 | 104 |
| 107 #endif // CustomElementProcessingStack_h | 105 #endif // CustomElementProcessingStack_h |
| OLD | NEW |