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 14 matching lines...) Expand all Loading... |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
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 "platform/heap/Handle.h" |
35 #include "wtf/OwnPtr.h" | 36 #include "wtf/OwnPtr.h" |
36 #include "wtf/PassOwnPtr.h" | 37 #include "wtf/PassOwnPtr.h" |
37 #include "wtf/PassRefPtr.h" | 38 #include "wtf/PassRefPtr.h" |
38 #include "wtf/RefCounted.h" | 39 #include "wtf/RefCounted.h" |
39 #include "wtf/RefPtr.h" | 40 #include "wtf/RefPtr.h" |
40 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
41 | 42 |
42 namespace WebCore { | 43 namespace WebCore { |
43 | 44 |
44 class CustomElementMicrotaskQueue : public RefCounted<CustomElementMicrotaskQueu
e> { | 45 class CustomElementMicrotaskQueue FINAL : public RefCountedWillBeGarbageCollecte
dFinalized<CustomElementMicrotaskQueue> { |
45 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskQueue); | 46 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskQueue); |
46 public: | 47 public: |
47 static PassRefPtr<CustomElementMicrotaskQueue> create() { return adoptRef(ne
w CustomElementMicrotaskQueue()); } | 48 static PassRefPtrWillBeRawPtr<CustomElementMicrotaskQueue> create() |
48 | 49 { |
| 50 return adoptRefWillBeNoop(new CustomElementMicrotaskQueue()); |
| 51 } |
49 | 52 |
50 bool isEmpty() const { return m_queue.isEmpty(); } | 53 bool isEmpty() const { return m_queue.isEmpty(); } |
51 void enqueue(PassOwnPtr<CustomElementMicrotaskStep>); | 54 void enqueue(PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep>); |
52 | 55 |
53 typedef CustomElementMicrotaskStep::Result Result; | 56 typedef CustomElementMicrotaskStep::Result Result; |
54 Result dispatch(); | 57 Result dispatch(); |
55 bool needsProcessOrStop() const; | 58 bool needsProcessOrStop() const; |
56 | 59 |
| 60 void trace(Visitor*); |
| 61 |
57 #if !defined(NDEBUG) | 62 #if !defined(NDEBUG) |
58 void show(unsigned indent); | 63 void show(unsigned indent); |
59 #endif | 64 #endif |
60 private: | 65 private: |
61 CustomElementMicrotaskQueue() { } | 66 CustomElementMicrotaskQueue() { } |
62 | 67 |
63 Vector<OwnPtr<CustomElementMicrotaskStep> > m_queue; | 68 WillBeHeapVector<OwnPtrWillBeMember<CustomElementMicrotaskStep> > m_queue; |
64 }; | 69 }; |
65 | 70 |
66 } | 71 } |
67 | 72 |
68 #endif // CustomElementMicrotaskQueue_h | 73 #endif // CustomElementMicrotaskQueue_h |
OLD | NEW |