Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: Source/core/timing/PerformanceObserver.h

Issue 1198863006: First version of PerformanceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: remove Inspector calls and update LayoutTest. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef PerformanceObserver_h
6 #define PerformanceObserver_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/timing/PerformanceEntry.h"
10 #include "platform/heap/Handle.h"
11 #include "wtf/HashSet.h"
12 #include "wtf/PassOwnPtr.h"
13 #include "wtf/PassRefPtr.h"
14 #include "wtf/RefCounted.h"
15 #include "wtf/RefPtr.h"
16 #include "wtf/Vector.h"
17
18 namespace blink {
19
20 class ExceptionState;
21 class PerformanceBase;
22 class PerformanceObserverCallback;
23 class PerformanceObserver;
24 class PerformanceObserverInit;
25
26 using PerformanceEntryVector = HeapVector<Member<PerformanceEntry>>;
27
28 class PerformanceObserver final : public GarbageCollectedFinalized<PerformanceOb server>, public ScriptWrappable {
29 DEFINE_WRAPPERTYPEINFO();
30 friend class PerformanceBase;
31 public:
32 static PerformanceObserver* create(PerformanceBase*, PerformanceObserverCall back*);
33 static void resumeSuspendedObservers();
34
35 ~PerformanceObserver();
36
37 void observe(const PerformanceObserverInit&, ExceptionState&);
38 void disconnect();
39 void enqueuePerformanceEntry(PerformanceEntry&);
40 PerformanceEntryTypeMask filterOptions() { return m_filterOptions; }
esprehn 2015/09/09 22:41:40 const
MikeB 2015/09/10 19:53:01 Done.
41
42 // Eagerly finalized as destructor accesses heap object members.
43 EAGERLY_FINALIZE();
44 DECLARE_TRACE();
45
46 private:
47 explicit PerformanceObserver(PerformanceBase*, PerformanceObserverCallback*) ;
48 void deliver();
49 bool shouldBeSuspended() const;
50
51 Member<PerformanceObserverCallback> m_callback;
52 WeakMember<PerformanceBase> m_performance;
53 PerformanceEntryVector m_performanceEntries;
54 PerformanceEntryTypeMask m_filterOptions;
55 bool m_isRegistered;
56 };
57
58 } // namespace blink
59
60 #endif // PerformanceObserver_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698