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 17 matching lines...) Expand all Loading... |
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 */ | 30 */ |
31 | 31 |
32 #include "core/timing/Performance.h" | 32 #include "core/timing/Performance.h" |
33 | 33 |
34 #include "bindings/core/v8/ScriptValue.h" | 34 #include "bindings/core/v8/ScriptValue.h" |
35 #include "bindings/core/v8/V8ObjectBuilder.h" | 35 #include "bindings/core/v8/V8ObjectBuilder.h" |
36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
37 #include "core/dom/QualifiedName.h" | 37 #include "core/dom/QualifiedName.h" |
| 38 #include "core/dom/TaskRunnerHelper.h" |
38 #include "core/frame/DOMWindow.h" | 39 #include "core/frame/DOMWindow.h" |
39 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
40 #include "core/frame/UseCounter.h" | 41 #include "core/frame/UseCounter.h" |
41 #include "core/html/HTMLFrameOwnerElement.h" | 42 #include "core/html/HTMLFrameOwnerElement.h" |
42 #include "core/loader/DocumentLoader.h" | 43 #include "core/loader/DocumentLoader.h" |
43 #include "core/origin_trials/OriginTrials.h" | 44 #include "core/origin_trials/OriginTrials.h" |
44 #include "core/timing/PerformanceTiming.h" | 45 #include "core/timing/PerformanceTiming.h" |
45 | 46 |
46 static const double kLongTaskThreshold = 0.05; | 47 static const double kLongTaskThreshold = 0.05; |
47 | 48 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return 0.0; | 94 return 0.0; |
94 | 95 |
95 DocumentLoader* loader = document->loader(); | 96 DocumentLoader* loader = document->loader(); |
96 if (!loader) | 97 if (!loader) |
97 return 0.0; | 98 return 0.0; |
98 | 99 |
99 return loader->timing().referenceMonotonicTime(); | 100 return loader->timing().referenceMonotonicTime(); |
100 } | 101 } |
101 | 102 |
102 Performance::Performance(LocalFrame* frame) | 103 Performance::Performance(LocalFrame* frame) |
103 : PerformanceBase(toTimeOrigin(frame)), | 104 : PerformanceBase( |
| 105 toTimeOrigin(frame), |
| 106 TaskRunnerHelper::get(TaskType::PerformanceTimeline, frame)), |
104 ContextLifecycleObserver(frame ? frame->document() : nullptr) {} | 107 ContextLifecycleObserver(frame ? frame->document() : nullptr) {} |
105 | 108 |
106 Performance::~Performance() { | 109 Performance::~Performance() { |
107 } | 110 } |
108 | 111 |
109 void Performance::contextDestroyed(ExecutionContext* destroyedContext) { | 112 void Performance::contextDestroyed(ExecutionContext* destroyedContext) { |
110 toDocument(destroyedContext) | 113 toDocument(destroyedContext) |
111 ->frame() | 114 ->frame() |
112 ->performanceMonitor() | 115 ->performanceMonitor() |
113 ->unsubscribeAll(this); | 116 ->unsubscribeAll(this); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 HTMLFrameOwnerElement* frameOwner = | 244 HTMLFrameOwnerElement* frameOwner = |
242 culpritDomWindow->document()->localOwner(); | 245 culpritDomWindow->document()->localOwner(); |
243 addLongTaskTiming(startTime, endTime, attribution.first, | 246 addLongTaskTiming(startTime, endTime, attribution.first, |
244 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), | 247 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), |
245 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), | 248 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), |
246 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); | 249 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); |
247 } | 250 } |
248 } | 251 } |
249 | 252 |
250 } // namespace blink | 253 } // namespace blink |
OLD | NEW |