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 #include "config.h" | 5 #include "config.h" |
6 #include "core/timing/DOMWindowPerformance.h" | 6 #include "core/timing/DOMWindowPerformance.h" |
7 | 7 |
8 #include "core/frame/LocalDOMWindow.h" | 8 #include "core/frame/LocalDOMWindow.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/timing/Performance.h" | 10 #include "core/timing/Performance.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 DOMWindowPerformance::DOMWindowPerformance(LocalDOMWindow& window) | 14 DOMWindowPerformance::DOMWindowPerformance(LocalDOMWindow& window) |
15 : DOMWindowProperty(window.frame()) | 15 : DOMWindowProperty(window.frame()) |
16 , m_window(window) | 16 , m_window(&window) |
17 { | 17 { |
18 } | 18 } |
19 | 19 |
20 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowPerformance); | 20 DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(DOMWindowPerformance); |
21 | 21 |
22 DEFINE_TRACE(DOMWindowPerformance) | 22 DEFINE_TRACE(DOMWindowPerformance) |
23 { | 23 { |
| 24 visitor->trace(m_window); |
24 visitor->trace(m_performance); | 25 visitor->trace(m_performance); |
25 WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); | 26 WillBeHeapSupplement<LocalDOMWindow>::trace(visitor); |
26 DOMWindowProperty::trace(visitor); | 27 DOMWindowProperty::trace(visitor); |
27 } | 28 } |
28 | 29 |
29 // static | 30 // static |
30 const char* DOMWindowPerformance::supplementName() | 31 const char* DOMWindowPerformance::supplementName() |
31 { | 32 { |
32 return "DOMWindowPerformance"; | 33 return "DOMWindowPerformance"; |
33 } | 34 } |
(...skipping 11 matching lines...) Expand all Loading... |
45 | 46 |
46 // static | 47 // static |
47 Performance* DOMWindowPerformance::performance(DOMWindow& window) | 48 Performance* DOMWindowPerformance::performance(DOMWindow& window) |
48 { | 49 { |
49 return from(toLocalDOMWindow(window)).performance(); | 50 return from(toLocalDOMWindow(window)).performance(); |
50 } | 51 } |
51 | 52 |
52 Performance* DOMWindowPerformance::performance() | 53 Performance* DOMWindowPerformance::performance() |
53 { | 54 { |
54 if (!m_performance) | 55 if (!m_performance) |
55 m_performance = Performance::create(m_window.frame()); | 56 m_performance = Performance::create(m_window->frame()); |
56 return m_performance.get(); | 57 return m_performance.get(); |
57 } | 58 } |
58 | 59 |
59 } // namespace blink | 60 } // namespace blink |
OLD | NEW |