| OLD | NEW |
| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 } | 74 } |
| 75 | 75 |
| 76 MemoryInfo* Performance::memory() | 76 MemoryInfo* Performance::memory() |
| 77 { | 77 { |
| 78 return MemoryInfo::create(); | 78 return MemoryInfo::create(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 PerformanceNavigation* Performance::navigation() const | 81 PerformanceNavigation* Performance::navigation() const |
| 82 { | 82 { |
| 83 if (!m_navigation) | 83 if (!m_navigation) |
| 84 m_navigation = PerformanceNavigation::create(m_frame); | 84 m_navigation = PerformanceNavigation::create(frame()); |
| 85 | 85 |
| 86 return m_navigation.get(); | 86 return m_navigation.get(); |
| 87 } | 87 } |
| 88 | 88 |
| 89 PerformanceTiming* Performance::timing() const | 89 PerformanceTiming* Performance::timing() const |
| 90 { | 90 { |
| 91 if (!m_timing) | 91 if (!m_timing) |
| 92 m_timing = PerformanceTiming::create(m_frame); | 92 m_timing = PerformanceTiming::create(frame()); |
| 93 | 93 |
| 94 return m_timing.get(); | 94 return m_timing.get(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 void Performance::updateLongTaskInstrumentation() | 97 void Performance::updateLongTaskInstrumentation() |
| 98 { | 98 { |
| 99 if (hasObserverFor(PerformanceEntry::LongTask) && !m_longTaskInspectorAgent)
{ | 99 if (hasObserverFor(PerformanceEntry::LongTask) && !m_longTaskInspectorAgent)
{ |
| 100 m_longTaskInspectorAgent = new InspectorWebPerfAgent( | 100 m_longTaskInspectorAgent = new InspectorWebPerfAgent( |
| 101 InspectedFrames::create(frame())); | 101 InspectedFrames::create(frame())); |
| 102 m_longTaskInspectorAgent->enable(); | 102 m_longTaskInspectorAgent->enable(); |
| 103 } else if (!hasObserverFor(PerformanceEntry::LongTask) && m_longTaskInspecto
rAgent) { | 103 } else if (!hasObserverFor(PerformanceEntry::LongTask) && m_longTaskInspecto
rAgent) { |
| 104 m_longTaskInspectorAgent->disable(); | 104 m_longTaskInspectorAgent->disable(); |
| 105 m_longTaskInspectorAgent = nullptr; | 105 m_longTaskInspectorAgent = nullptr; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 DEFINE_TRACE(Performance) | 109 DEFINE_TRACE(Performance) |
| 110 { | 110 { |
| 111 visitor->trace(m_navigation); | 111 visitor->trace(m_navigation); |
| 112 visitor->trace(m_timing); | 112 visitor->trace(m_timing); |
| 113 visitor->trace(m_longTaskInspectorAgent); | 113 visitor->trace(m_longTaskInspectorAgent); |
| 114 DOMWindowProperty::trace(visitor); | 114 DOMWindowProperty::trace(visitor); |
| 115 PerformanceBase::trace(visitor); | 115 PerformanceBase::trace(visitor); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace blink | 118 } // namespace blink |
| OLD | NEW |