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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 | 135 |
136 PerformanceTiming* Performance::timing() const { | 136 PerformanceTiming* Performance::timing() const { |
137 if (!m_timing) | 137 if (!m_timing) |
138 m_timing = PerformanceTiming::create(frame()); | 138 m_timing = PerformanceTiming::create(frame()); |
139 | 139 |
140 return m_timing.get(); | 140 return m_timing.get(); |
141 } | 141 } |
142 | 142 |
143 void Performance::updateLongTaskInstrumentation() { | 143 void Performance::updateLongTaskInstrumentation() { |
144 DCHECK(frame()); | 144 DCHECK(frame()); |
145 if (!frame()->document() || | 145 if (!frame()->document()) |
146 !OriginTrials::longTaskObserverEnabled(frame()->document())) | |
147 return; | 146 return; |
148 | 147 |
149 if (hasObserverFor(PerformanceEntry::LongTask)) { | 148 if (hasObserverFor(PerformanceEntry::LongTask)) { |
150 UseCounter::count(frame()->localFrameRoot(), UseCounter::LongTaskObserver); | 149 UseCounter::count(frame()->localFrameRoot(), UseCounter::LongTaskObserver); |
151 frame()->performanceMonitor()->subscribe(PerformanceMonitor::kLongTask, | 150 frame()->performanceMonitor()->subscribe(PerformanceMonitor::kLongTask, |
152 kLongTaskThreshold, this); | 151 kLongTaskThreshold, this); |
153 } else { | 152 } else { |
154 frame()->performanceMonitor()->unsubscribeAll(this); | 153 frame()->performanceMonitor()->unsubscribeAll(this); |
155 } | 154 } |
156 } | 155 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 HTMLFrameOwnerElement* frameOwner = | 244 HTMLFrameOwnerElement* frameOwner = |
246 culpritDomWindow->frame()->deprecatedLocalOwner(); | 245 culpritDomWindow->frame()->deprecatedLocalOwner(); |
247 addLongTaskTiming(startTime, endTime, attribution.first, | 246 addLongTaskTiming(startTime, endTime, attribution.first, |
248 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), | 247 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), |
249 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), | 248 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), |
250 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); | 249 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); |
251 } | 250 } |
252 } | 251 } |
253 | 252 |
254 } // namespace blink | 253 } // namespace blink |
OLD | NEW |