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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 return nullptr; | 148 return nullptr; |
149 return new PerformanceNavigationTiming(GetFrame(), info, TimeOrigin()); | 149 return new PerformanceNavigationTiming(GetFrame(), info, TimeOrigin()); |
150 } | 150 } |
151 | 151 |
152 void Performance::UpdateLongTaskInstrumentation() { | 152 void Performance::UpdateLongTaskInstrumentation() { |
153 DCHECK(GetFrame()); | 153 DCHECK(GetFrame()); |
154 if (!GetFrame()->GetDocument()) | 154 if (!GetFrame()->GetDocument()) |
155 return; | 155 return; |
156 | 156 |
157 if (HasObserverFor(PerformanceEntry::kLongTask)) { | 157 if (HasObserverFor(PerformanceEntry::kLongTask)) { |
158 UseCounter::Count(GetFrame()->LocalFrameRoot(), | 158 UseCounter::Count(&GetFrame()->LocalFrameRoot(), |
159 UseCounter::kLongTaskObserver); | 159 UseCounter::kLongTaskObserver); |
160 GetFrame()->GetPerformanceMonitor()->Subscribe( | 160 GetFrame()->GetPerformanceMonitor()->Subscribe( |
161 PerformanceMonitor::kLongTask, kLongTaskThreshold, this); | 161 PerformanceMonitor::kLongTask, kLongTaskThreshold, this); |
162 } else { | 162 } else { |
163 GetFrame()->GetPerformanceMonitor()->UnsubscribeAll(this); | 163 GetFrame()->GetPerformanceMonitor()->UnsubscribeAll(this); |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 ScriptValue Performance::toJSONForBinding(ScriptState* script_state) const { | 167 ScriptValue Performance::toJSONForBinding(ScriptState* script_state) const { |
168 V8ObjectBuilder result(script_state); | 168 V8ObjectBuilder result(script_state); |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 culprit_dom_window->GetFrame()->DeprecatedLocalOwner(); | 257 culprit_dom_window->GetFrame()->DeprecatedLocalOwner(); |
258 AddLongTaskTiming( | 258 AddLongTaskTiming( |
259 start_time, end_time, attribution.first, | 259 start_time, end_time, attribution.first, |
260 GetFrameAttribute(frame_owner, HTMLNames::srcAttr, false), | 260 GetFrameAttribute(frame_owner, HTMLNames::srcAttr, false), |
261 GetFrameAttribute(frame_owner, HTMLNames::idAttr, false), | 261 GetFrameAttribute(frame_owner, HTMLNames::idAttr, false), |
262 GetFrameAttribute(frame_owner, HTMLNames::nameAttr, true)); | 262 GetFrameAttribute(frame_owner, HTMLNames::nameAttr, true)); |
263 } | 263 } |
264 } | 264 } |
265 | 265 |
266 } // namespace blink | 266 } // namespace blink |
OLD | NEW |