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 16 matching lines...) Expand all Loading... |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef CustomElementMicrotaskQueue_h | 31 #ifndef CustomElementMicrotaskQueue_h |
32 #define CustomElementMicrotaskQueue_h | 32 #define CustomElementMicrotaskQueue_h |
33 | 33 |
34 #include "core/dom/custom/CustomElementMicrotaskStep.h" | 34 #include "core/dom/custom/CustomElementMicrotaskStep.h" |
35 #include "wtf/OwnPtr.h" | 35 #include "wtf/OwnPtr.h" |
36 #include "wtf/PassOwnPtr.h" | 36 #include "wtf/PassOwnPtr.h" |
| 37 #include "wtf/PassRefPtr.h" |
| 38 #include "wtf/RefCounted.h" |
| 39 #include "wtf/RefPtr.h" |
37 #include "wtf/Vector.h" | 40 #include "wtf/Vector.h" |
38 | 41 |
39 namespace WebCore { | 42 namespace WebCore { |
40 | 43 |
41 class CustomElementMicrotaskQueue { | 44 class CustomElementMicrotaskQueue : public RefCounted<CustomElementMicrotaskQueu
e> { |
42 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskQueue); | 45 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskQueue); |
43 public: | 46 public: |
44 CustomElementMicrotaskQueue() { } | 47 static PassRefPtr<CustomElementMicrotaskQueue> create() { return adoptRef(ne
w CustomElementMicrotaskQueue()); } |
45 | 48 |
46 bool isEmpty() { return m_queue.isEmpty(); } | 49 |
| 50 bool isEmpty() const { return m_queue.isEmpty(); } |
47 void enqueue(PassOwnPtr<CustomElementMicrotaskStep>); | 51 void enqueue(PassOwnPtr<CustomElementMicrotaskStep>); |
48 | 52 |
49 typedef CustomElementMicrotaskStep::Result Result; | 53 typedef CustomElementMicrotaskStep::Result Result; |
50 Result dispatch(); | 54 Result dispatch(); |
51 | 55 |
52 private: | 56 private: |
| 57 CustomElementMicrotaskQueue() { } |
| 58 |
53 Vector<OwnPtr<CustomElementMicrotaskStep> > m_queue; | 59 Vector<OwnPtr<CustomElementMicrotaskStep> > m_queue; |
54 }; | 60 }; |
55 | 61 |
56 } | 62 } |
57 | 63 |
58 #endif // CustomElementMicrotaskQueue_h | 64 #endif // CustomElementMicrotaskQueue_h |
OLD | NEW |