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

Side by Side Diff: third_party/WebKit/Source/core/timing/Performance.h

Issue 2484213003: Convert performance monitor to the subscription model. (Closed)
Patch Set: core export Created 4 years, 1 month 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
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 16 matching lines...) Expand all
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32 #ifndef Performance_h 32 #ifndef Performance_h
33 #define Performance_h 33 #define Performance_h
34 34
35 #include "core/CoreExport.h" 35 #include "core/CoreExport.h"
36 #include "core/frame/DOMWindowProperty.h" 36 #include "core/frame/DOMWindowProperty.h"
37 #include "core/frame/PerformanceMonitor.h"
37 #include "core/timing/MemoryInfo.h" 38 #include "core/timing/MemoryInfo.h"
38 #include "core/timing/PerformanceBase.h" 39 #include "core/timing/PerformanceBase.h"
39 #include "core/timing/PerformanceNavigation.h" 40 #include "core/timing/PerformanceNavigation.h"
40 #include "core/timing/PerformanceTiming.h" 41 #include "core/timing/PerformanceTiming.h"
41 42
42 namespace blink { 43 namespace blink {
43 44
44 class ScriptState; 45 class ScriptState;
45 class ScriptValue; 46 class ScriptValue;
46 47
47 class CORE_EXPORT Performance final : public PerformanceBase, 48 class CORE_EXPORT Performance final : public PerformanceBase,
48 public DOMWindowProperty { 49 public DOMWindowProperty,
50 public PerformanceMonitor::Client {
49 DEFINE_WRAPPERTYPEINFO(); 51 DEFINE_WRAPPERTYPEINFO();
50 USING_GARBAGE_COLLECTED_MIXIN(Performance); 52 USING_GARBAGE_COLLECTED_MIXIN(Performance);
51 friend class PerformanceTest; 53 friend class PerformanceTest;
52 54
53 public: 55 public:
54 static Performance* create(LocalFrame* frame) { 56 static Performance* create(LocalFrame* frame) {
55 return new Performance(frame); 57 return new Performance(frame);
56 } 58 }
57 ~Performance() override; 59 ~Performance() override;
58 60
59 ExecutionContext* getExecutionContext() const override; 61 ExecutionContext* getExecutionContext() const override;
60 62
61 MemoryInfo* memory(); 63 MemoryInfo* memory();
62 PerformanceNavigation* navigation() const; 64 PerformanceNavigation* navigation() const;
63 PerformanceTiming* timing() const override; 65 PerformanceTiming* timing() const override;
64 66
65 void updateLongTaskInstrumentation() override; 67 void updateLongTaskInstrumentation() override;
66 68
67 ScriptValue toJSONForBinding(ScriptState*) const; 69 ScriptValue toJSONForBinding(ScriptState*) const;
68 70
69 DECLARE_VIRTUAL_TRACE(); 71 DECLARE_VIRTUAL_TRACE();
70 72
71 private: 73 private:
72 explicit Performance(LocalFrame*); 74 explicit Performance(LocalFrame*);
73 75
74 // DOMWindowProperty overrides. 76 // DOMWindowProperty overrides.
75 void frameDestroyed() override; 77 void frameDestroyed() override;
76 78
79 static std::pair<String, DOMWindow*> sanitizedAttribution(
80 const HeapHashSet<Member<Frame>>& frames,
81 Frame* observerFrame);
82
83 // PerformanceMonitor::Client implementation.
84 void reportLongTask(double startTime,
85 double endTime,
86 const HeapHashSet<Member<Frame>>& contextFrames) override;
87
77 mutable Member<PerformanceNavigation> m_navigation; 88 mutable Member<PerformanceNavigation> m_navigation;
78 mutable Member<PerformanceTiming> m_timing; 89 mutable Member<PerformanceTiming> m_timing;
79 }; 90 };
80 91
81 } // namespace blink 92 } // namespace blink
82 93
83 #endif // Performance_h 94 #endif // Performance_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/browser_protocol.json ('k') | third_party/WebKit/Source/core/timing/Performance.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698