| 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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 PerformanceEntry::startTimeCompareLessThan); | 215 PerformanceEntry::startTimeCompareLessThan); |
| 216 return entries; | 216 return entries; |
| 217 } | 217 } |
| 218 | 218 |
| 219 void PerformanceBase::clearResourceTimings() { | 219 void PerformanceBase::clearResourceTimings() { |
| 220 m_resourceTimingBuffer.clear(); | 220 m_resourceTimingBuffer.clear(); |
| 221 } | 221 } |
| 222 | 222 |
| 223 void PerformanceBase::setResourceTimingBufferSize(unsigned size) { | 223 void PerformanceBase::setResourceTimingBufferSize(unsigned size) { |
| 224 m_resourceTimingBufferSize = size; | 224 m_resourceTimingBufferSize = size; |
| 225 if (isResourceTimingBufferFull()) { | 225 if (isResourceTimingBufferFull()) |
| 226 dispatchEvent(Event::create(EventTypeNames::resourcetimingbufferfull)); | 226 dispatchEvent(Event::create(EventTypeNames::resourcetimingbufferfull)); |
| 227 dispatchEvent( | |
| 228 Event::create(EventTypeNames::webkitresourcetimingbufferfull)); | |
| 229 } | |
| 230 } | 227 } |
| 231 | 228 |
| 232 void PerformanceBase::clearFrameTimings() { | 229 void PerformanceBase::clearFrameTimings() { |
| 233 m_frameTimingBuffer.clear(); | 230 m_frameTimingBuffer.clear(); |
| 234 } | 231 } |
| 235 | 232 |
| 236 void PerformanceBase::setFrameTimingBufferSize(unsigned size) { | 233 void PerformanceBase::setFrameTimingBufferSize(unsigned size) { |
| 237 m_frameTimingBufferSize = size; | 234 m_frameTimingBufferSize = size; |
| 238 if (isFrameTimingBufferFull()) | 235 if (isFrameTimingBufferFull()) |
| 239 dispatchEvent(Event::create(EventTypeNames::frametimingbufferfull)); | 236 dispatchEvent(Event::create(EventTypeNames::frametimingbufferfull)); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 allowRedirectDetails, | 396 allowRedirectDetails, |
| 400 documentLoadTiming.hasSameOriginAsPreviousDocument(), resourceLoadTiming, | 397 documentLoadTiming.hasSameOriginAsPreviousDocument(), resourceLoadTiming, |
| 401 lastRedirectEndTime, finishTime, transferSize, encodedBodyLength, | 398 lastRedirectEndTime, finishTime, transferSize, encodedBodyLength, |
| 402 decodedBodyLength, didReuseConnection); | 399 decodedBodyLength, didReuseConnection); |
| 403 notifyObserversOfEntry(*m_navigationTiming); | 400 notifyObserversOfEntry(*m_navigationTiming); |
| 404 } | 401 } |
| 405 | 402 |
| 406 void PerformanceBase::addResourceTimingBuffer(PerformanceEntry& entry) { | 403 void PerformanceBase::addResourceTimingBuffer(PerformanceEntry& entry) { |
| 407 m_resourceTimingBuffer.push_back(&entry); | 404 m_resourceTimingBuffer.push_back(&entry); |
| 408 | 405 |
| 409 if (isResourceTimingBufferFull()) { | 406 if (isResourceTimingBufferFull()) |
| 410 dispatchEvent(Event::create(EventTypeNames::resourcetimingbufferfull)); | 407 dispatchEvent(Event::create(EventTypeNames::resourcetimingbufferfull)); |
| 411 dispatchEvent( | |
| 412 Event::create(EventTypeNames::webkitresourcetimingbufferfull)); | |
| 413 } | |
| 414 } | 408 } |
| 415 | 409 |
| 416 bool PerformanceBase::isResourceTimingBufferFull() { | 410 bool PerformanceBase::isResourceTimingBufferFull() { |
| 417 return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize; | 411 return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize; |
| 418 } | 412 } |
| 419 | 413 |
| 420 void PerformanceBase::addFrameTimingBuffer(PerformanceEntry& entry) { | 414 void PerformanceBase::addFrameTimingBuffer(PerformanceEntry& entry) { |
| 421 m_frameTimingBuffer.push_back(&entry); | 415 m_frameTimingBuffer.push_back(&entry); |
| 422 | 416 |
| 423 if (isFrameTimingBufferFull()) | 417 if (isFrameTimingBufferFull()) |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 visitor->trace(m_resourceTimingBuffer); | 569 visitor->trace(m_resourceTimingBuffer); |
| 576 visitor->trace(m_navigationTiming); | 570 visitor->trace(m_navigationTiming); |
| 577 visitor->trace(m_userTiming); | 571 visitor->trace(m_userTiming); |
| 578 visitor->trace(m_observers); | 572 visitor->trace(m_observers); |
| 579 visitor->trace(m_activeObservers); | 573 visitor->trace(m_activeObservers); |
| 580 visitor->trace(m_suspendedObservers); | 574 visitor->trace(m_suspendedObservers); |
| 581 EventTargetWithInlineData::trace(visitor); | 575 EventTargetWithInlineData::trace(visitor); |
| 582 } | 576 } |
| 583 | 577 |
| 584 } // namespace blink | 578 } // namespace blink |
| OLD | NEW |