| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 PerformanceTiming* Performance::timing() const { | 80 PerformanceTiming* Performance::timing() const { |
| 81 if (!m_timing) | 81 if (!m_timing) |
| 82 m_timing = PerformanceTiming::create(frame()); | 82 m_timing = PerformanceTiming::create(frame()); |
| 83 | 83 |
| 84 return m_timing.get(); | 84 return m_timing.get(); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void Performance::updateLongTaskInstrumentation() { | 87 void Performance::updateLongTaskInstrumentation() { |
| 88 if (hasObserverFor(PerformanceEntry::LongTask) && !m_longTaskInspectorAgent) { | 88 if (hasObserverFor(PerformanceEntry::LongTask) && !m_longTaskInspectorAgent) { |
| 89 m_longTaskInspectorAgent = | 89 m_longTaskInspectorAgent = new InspectorWebPerfAgent(frame()); |
| 90 new InspectorWebPerfAgent(InspectedFrames::create(frame())); | |
| 91 m_longTaskInspectorAgent->enable(); | 90 m_longTaskInspectorAgent->enable(); |
| 92 } else if (!hasObserverFor(PerformanceEntry::LongTask) && | 91 } else if (!hasObserverFor(PerformanceEntry::LongTask) && |
| 93 m_longTaskInspectorAgent) { | 92 m_longTaskInspectorAgent) { |
| 94 m_longTaskInspectorAgent->disable(); | 93 m_longTaskInspectorAgent->disable(); |
| 95 m_longTaskInspectorAgent = nullptr; | 94 m_longTaskInspectorAgent = nullptr; |
| 96 } | 95 } |
| 97 } | 96 } |
| 98 | 97 |
| 99 DEFINE_TRACE(Performance) { | 98 DEFINE_TRACE(Performance) { |
| 100 visitor->trace(m_navigation); | 99 visitor->trace(m_navigation); |
| 101 visitor->trace(m_timing); | 100 visitor->trace(m_timing); |
| 102 visitor->trace(m_longTaskInspectorAgent); | 101 visitor->trace(m_longTaskInspectorAgent); |
| 103 DOMWindowProperty::trace(visitor); | 102 DOMWindowProperty::trace(visitor); |
| 104 PerformanceBase::trace(visitor); | 103 PerformanceBase::trace(visitor); |
| 105 } | 104 } |
| 106 | 105 |
| 107 } // namespace blink | 106 } // namespace blink |
| OLD | NEW |