| 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 25 matching lines...) Expand all Loading... |
| 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/dom/TaskRunnerHelper.h" |
| 39 #include "core/frame/DOMWindow.h" | 39 #include "core/frame/DOMWindow.h" |
| 40 #include "core/frame/LocalFrame.h" | 40 #include "core/frame/LocalFrame.h" |
| 41 #include "core/frame/UseCounter.h" | 41 #include "core/frame/UseCounter.h" |
| 42 #include "core/html/HTMLFrameOwnerElement.h" | 42 #include "core/html/HTMLFrameOwnerElement.h" |
| 43 #include "core/loader/DocumentLoader.h" | 43 #include "core/loader/DocumentLoader.h" |
| 44 #include "core/origin_trials/OriginTrials.h" | 44 #include "core/origin_trials/OriginTrials.h" |
| 45 #include "core/timing/PerformanceTiming.h" | 45 #include "core/timing/PerformanceTiming.h" |
| 46 #include "platform/RuntimeEnabledFeatures.h" |
| 46 #include "platform/loader/fetch/ResourceTimingInfo.h" | 47 #include "platform/loader/fetch/ResourceTimingInfo.h" |
| 47 #include "platform/RuntimeEnabledFeatures.h" | |
| 48 | 48 |
| 49 static const double kLongTaskThreshold = 0.05; | 49 static const double kLongTaskThreshold = 0.05; |
| 50 | 50 |
| 51 static const char kUnknownAttribution[] = "unknown"; | 51 static const char kUnknownAttribution[] = "unknown"; |
| 52 static const char kAmbiguousAttribution[] = "multiple-contexts"; | 52 static const char kAmbiguousAttribution[] = "multiple-contexts"; |
| 53 static const char kSameOriginAttribution[] = "same-origin"; | 53 static const char kSameOriginAttribution[] = "same-origin"; |
| 54 static const char kSameOriginSelfAttribution[] = "self"; | 54 static const char kSameOriginSelfAttribution[] = "self"; |
| 55 static const char kSameOriginAncestorAttribution[] = "same-origin-ancestor"; | 55 static const char kSameOriginAncestorAttribution[] = "same-origin-ancestor"; |
| 56 static const char kSameOriginDescendantAttribution[] = "same-origin-descendant"; | 56 static const char kSameOriginDescendantAttribution[] = "same-origin-descendant"; |
| 57 static const char kCrossOriginAncestorAttribution[] = "cross-origin-ancestor"; | 57 static const char kCrossOriginAncestorAttribution[] = "cross-origin-ancestor"; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 return loader->GetTiming().ReferenceMonotonicTime(); | 102 return loader->GetTiming().ReferenceMonotonicTime(); |
| 103 } | 103 } |
| 104 | 104 |
| 105 Performance::Performance(LocalFrame* frame) | 105 Performance::Performance(LocalFrame* frame) |
| 106 : PerformanceBase( | 106 : PerformanceBase( |
| 107 ToTimeOrigin(frame), | 107 ToTimeOrigin(frame), |
| 108 TaskRunnerHelper::Get(TaskType::kPerformanceTimeline, frame)), | 108 TaskRunnerHelper::Get(TaskType::kPerformanceTimeline, frame)), |
| 109 DOMWindowClient(frame) {} | 109 DOMWindowClient(frame) {} |
| 110 | 110 |
| 111 Performance::~Performance() { | 111 Performance::~Performance() {} |
| 112 } | |
| 113 | 112 |
| 114 ExecutionContext* Performance::GetExecutionContext() const { | 113 ExecutionContext* Performance::GetExecutionContext() const { |
| 115 if (!GetFrame()) | 114 if (!GetFrame()) |
| 116 return nullptr; | 115 return nullptr; |
| 117 return GetFrame()->GetDocument(); | 116 return GetFrame()->GetDocument(); |
| 118 } | 117 } |
| 119 | 118 |
| 120 MemoryInfo* Performance::memory() { | 119 MemoryInfo* Performance::memory() { |
| 121 return MemoryInfo::Create(); | 120 return MemoryInfo::Create(); |
| 122 } | 121 } |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 culprit_dom_window->GetFrame()->DeprecatedLocalOwner(); | 256 culprit_dom_window->GetFrame()->DeprecatedLocalOwner(); |
| 258 AddLongTaskTiming( | 257 AddLongTaskTiming( |
| 259 start_time, end_time, attribution.first, | 258 start_time, end_time, attribution.first, |
| 260 GetFrameAttribute(frame_owner, HTMLNames::srcAttr, false), | 259 GetFrameAttribute(frame_owner, HTMLNames::srcAttr, false), |
| 261 GetFrameAttribute(frame_owner, HTMLNames::idAttr, false), | 260 GetFrameAttribute(frame_owner, HTMLNames::idAttr, false), |
| 262 GetFrameAttribute(frame_owner, HTMLNames::nameAttr, true)); | 261 GetFrameAttribute(frame_owner, HTMLNames::nameAttr, true)); |
| 263 } | 262 } |
| 264 } | 263 } |
| 265 | 264 |
| 266 } // namespace blink | 265 } // namespace blink |
| OLD | NEW |