OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PerformanceObserver_h | 5 #ifndef PerformanceObserver_h |
6 #define PerformanceObserver_h | 6 #define PerformanceObserver_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
9 #include "core/timing/PerformanceEntry.h" | 9 #include "core/timing/PerformanceEntry.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
11 #include "wtf/HashSet.h" | |
sof
2016/04/26 11:07:39
oops, these unused ones were mistakenly re-added h
| |
12 #include "wtf/PassOwnPtr.h" | |
13 #include "wtf/PassRefPtr.h" | |
14 #include "wtf/RefCounted.h" | |
15 #include "wtf/RefPtr.h" | |
11 #include "wtf/Vector.h" | 16 #include "wtf/Vector.h" |
12 | 17 |
13 namespace blink { | 18 namespace blink { |
14 | 19 |
15 class ExceptionState; | 20 class ExceptionState; |
16 class PerformanceBase; | 21 class PerformanceBase; |
17 class PerformanceObserverCallback; | 22 class PerformanceObserverCallback; |
18 class PerformanceObserver; | 23 class PerformanceObserver; |
19 class PerformanceObserverInit; | 24 class PerformanceObserverInit; |
20 | 25 |
21 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; | 26 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>; |
22 | 27 |
23 class PerformanceObserver final : public GarbageCollectedFinalized<PerformanceOb server>, public ScriptWrappable { | 28 class PerformanceObserver final : public GarbageCollected<PerformanceObserver>, public ScriptWrappable { |
24 DEFINE_WRAPPERTYPEINFO(); | 29 DEFINE_WRAPPERTYPEINFO(); |
25 friend class PerformanceBase; | 30 friend class PerformanceBase; |
26 public: | 31 public: |
27 static PerformanceObserver* create(PerformanceBase*, PerformanceObserverCall back*); | 32 static PerformanceObserver* create(PerformanceBase*, PerformanceObserverCall back*); |
28 static void resumeSuspendedObservers(); | 33 static void resumeSuspendedObservers(); |
29 | 34 |
30 ~PerformanceObserver(); | |
31 | |
32 void observe(const PerformanceObserverInit&, ExceptionState&); | 35 void observe(const PerformanceObserverInit&, ExceptionState&); |
33 void disconnect(); | 36 void disconnect(); |
34 void enqueuePerformanceEntry(PerformanceEntry&); | 37 void enqueuePerformanceEntry(PerformanceEntry&); |
35 PerformanceEntryTypeMask filterOptions() const { return m_filterOptions; } | 38 PerformanceEntryTypeMask filterOptions() const { return m_filterOptions; } |
36 | 39 |
37 // Eagerly finalized as destructor accesses heap object members. | |
38 EAGERLY_FINALIZE(); | |
39 DECLARE_TRACE(); | 40 DECLARE_TRACE(); |
40 | 41 |
41 private: | 42 private: |
42 explicit PerformanceObserver(PerformanceBase*, PerformanceObserverCallback*) ; | 43 explicit PerformanceObserver(PerformanceBase*, PerformanceObserverCallback*) ; |
43 void deliver(); | 44 void deliver(); |
44 bool shouldBeSuspended() const; | 45 bool shouldBeSuspended() const; |
45 | 46 |
46 Member<PerformanceObserverCallback> m_callback; | 47 Member<PerformanceObserverCallback> m_callback; |
47 WeakMember<PerformanceBase> m_performance; | 48 WeakMember<PerformanceBase> m_performance; |
48 PerformanceEntryVector m_performanceEntries; | 49 PerformanceEntryVector m_performanceEntries; |
49 PerformanceEntryTypeMask m_filterOptions; | 50 PerformanceEntryTypeMask m_filterOptions; |
50 bool m_isRegistered; | 51 bool m_isRegistered; |
51 }; | 52 }; |
52 | 53 |
53 } // namespace blink | 54 } // namespace blink |
54 | 55 |
55 #endif // PerformanceObserver_h | 56 #endif // PerformanceObserver_h |
OLD | NEW |