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

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

Issue 1198863006: First version of PerformanceObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Sync with latest spec draft (DOMString -> PerformanceEntryType and new PerformanceObserver -> windo… Created 5 years, 5 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 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
7 *
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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.
29 */
30
31 #ifndef PerformanceObserverRegistration_h
32 #define PerformanceObserverRegistration_h
33
34 #include "core/timing/PerformanceObserver.h"
35 #include "platform/heap/Handle.h"
36 #include "wtf/HashSet.h"
37 #include "wtf/text/AtomicString.h"
38 #include "wtf/text/AtomicStringHash.h"
39
40 namespace blink {
41
42 class PerformanceBase;
43
44 class PerformanceObserverRegistration final : public GarbageCollectedFinalized<P erformanceObserverRegistration> {
45 public:
46 static PerformanceObserverRegistration* create(PerformanceObserver&, Perform anceBase*, const HashSet<AtomicString>& typeFilter);
esprehn 2015/07/18 22:24:16 Why the PerformanceBase argument? The observer sho
MikeB 2015/07/20 23:06:50 Got rid of this class entirely. Simplifies things
47 ~PerformanceObserverRegistration();
48
49 void resetObservation(const HashSet<AtomicString>& typeFilter);
50
51 void unregister();
52
53 PerformanceObserver& observer() const { return *m_observer; }
54 PerformanceBase* performance() const { return m_performance.get(); }
esprehn 2015/07/18 22:24:16 Can this be null? i don't think it can, you want *
55
56 DECLARE_TRACE();
57
58 void dispose();
59
60 void addReference() { ++m_referenceCount; }
esprehn 2015/07/18 22:24:16 This manual reference count is very weird, what ar
61
62 bool shouldReceiveEntryFrom(const AtomicString& typeName) const;
63
64 private:
65 PerformanceObserverRegistration(PerformanceObserver&, PerformanceBase*, cons t HashSet<AtomicString>& typeFilter);
66
67 Member<PerformanceObserver> m_observer;
68 WeakMember<PerformanceBase> m_performance;
esprehn 2015/07/18 22:24:16 the observer should know the performance.
69
70 HashSet<AtomicString> m_typeFilter;
esprehn 2015/07/18 22:24:17 This should be an unsigned bitfield where each bit
71 unsigned m_referenceCount;
72 };
73
74 } // namespace blink
75
76 #endif // PerformanceObserverRegistration_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698