| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return 0.0; | 97 return 0.0; |
| 98 | 98 |
| 99 return loader->timing().referenceMonotonicTime(); | 99 return loader->timing().referenceMonotonicTime(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 Performance::Performance(LocalFrame* frame) | 102 Performance::Performance(LocalFrame* frame) |
| 103 : PerformanceBase(toTimeOrigin(frame)), | 103 : PerformanceBase(toTimeOrigin(frame)), |
| 104 ContextLifecycleObserver(frame ? frame->document() : nullptr) {} | 104 ContextLifecycleObserver(frame ? frame->document() : nullptr) {} |
| 105 | 105 |
| 106 Performance::~Performance() { | 106 Performance::~Performance() { |
| 107 if (frame()) | 107 // contextDestryoed() should have been called and the performance |
| 108 frame()->performanceMonitor()->unsubscribeAll(this); | 108 // monitors should have been unsubscribed. |
| 109 DCHECK(!frame()); |
| 109 } | 110 } |
| 110 | 111 |
| 111 void Performance::contextDestroyed() { | 112 void Performance::contextDestroyed() { |
| 112 frame()->performanceMonitor()->unsubscribeAll(this); | 113 frame()->performanceMonitor()->unsubscribeAll(this); |
| 113 } | 114 } |
| 114 | 115 |
| 115 ExecutionContext* Performance::getExecutionContext() const { | 116 ExecutionContext* Performance::getExecutionContext() const { |
| 116 if (!frame()) | 117 if (!frame()) |
| 117 return nullptr; | 118 return nullptr; |
| 118 return frame()->document(); | 119 return frame()->document(); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 HTMLFrameOwnerElement* frameOwner = | 241 HTMLFrameOwnerElement* frameOwner = |
| 241 culpritDomWindow->document()->localOwner(); | 242 culpritDomWindow->document()->localOwner(); |
| 242 addLongTaskTiming(startTime, endTime, attribution.first, | 243 addLongTaskTiming(startTime, endTime, attribution.first, |
| 243 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), | 244 getFrameAttribute(frameOwner, HTMLNames::srcAttr, false), |
| 244 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), | 245 getFrameAttribute(frameOwner, HTMLNames::idAttr, false), |
| 245 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); | 246 getFrameAttribute(frameOwner, HTMLNames::nameAttr, true)); |
| 246 } | 247 } |
| 247 } | 248 } |
| 248 | 249 |
| 249 } // namespace blink | 250 } // namespace blink |
| OLD | NEW |