| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 return; | 344 return; |
| 345 DCHECK(frame); | 345 DCHECK(frame); |
| 346 const DocumentLoader* documentLoader = frame->loader().documentLoader(); | 346 const DocumentLoader* documentLoader = frame->loader().documentLoader(); |
| 347 DCHECK(documentLoader); | 347 DCHECK(documentLoader); |
| 348 | 348 |
| 349 const DocumentLoadTiming& documentLoadTiming = documentLoader->timing(); | 349 const DocumentLoadTiming& documentLoadTiming = documentLoader->timing(); |
| 350 | 350 |
| 351 const DocumentTiming* documentTiming = | 351 const DocumentTiming* documentTiming = |
| 352 frame->document() ? &(frame->document()->timing()) : nullptr; | 352 frame->document() ? &(frame->document()->timing()) : nullptr; |
| 353 | 353 |
| 354 const ResourceResponse& finalResponse = documentLoader->response(); | |
| 355 ResourceTimingInfo* navigationTimingInfo = | 354 ResourceTimingInfo* navigationTimingInfo = |
| 356 documentLoader->getNavigationTimingInfo(); | 355 documentLoader->getNavigationTimingInfo(); |
| 357 if (!navigationTimingInfo) | 356 if (!navigationTimingInfo) |
| 358 return; | 357 return; |
| 359 | 358 |
| 359 const ResourceResponse& finalResponse = navigationTimingInfo->finalResponse(); |
| 360 |
| 360 ResourceLoadTiming* resourceLoadTiming = finalResponse.resourceLoadTiming(); | 361 ResourceLoadTiming* resourceLoadTiming = finalResponse.resourceLoadTiming(); |
| 361 // Don't create a navigation timing instance when | 362 // Don't create a navigation timing instance when |
| 362 // resourceLoadTiming is null, which could happen when visiting non-http sites | 363 // resourceLoadTiming is null, which could happen when visiting non-http sites |
| 363 // such as about:blank or in some error cases. | 364 // such as about:blank or in some error cases. |
| 364 if (!resourceLoadTiming) | 365 if (!resourceLoadTiming) |
| 365 return; | 366 return; |
| 366 double lastRedirectEndTime = documentLoadTiming.redirectEnd(); | 367 double lastRedirectEndTime = documentLoadTiming.redirectEnd(); |
| 367 double finishTime = documentLoadTiming.loadEventEnd(); | 368 double finishTime = documentLoadTiming.loadEventEnd(); |
| 368 | 369 |
| 369 ExecutionContext* context = getExecutionContext(); | 370 ExecutionContext* context = getExecutionContext(); |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 visitor->trace(m_resourceTimingBuffer); | 577 visitor->trace(m_resourceTimingBuffer); |
| 577 visitor->trace(m_navigationTiming); | 578 visitor->trace(m_navigationTiming); |
| 578 visitor->trace(m_userTiming); | 579 visitor->trace(m_userTiming); |
| 579 visitor->trace(m_observers); | 580 visitor->trace(m_observers); |
| 580 visitor->trace(m_activeObservers); | 581 visitor->trace(m_activeObservers); |
| 581 visitor->trace(m_suspendedObservers); | 582 visitor->trace(m_suspendedObservers); |
| 582 EventTargetWithInlineData::trace(visitor); | 583 EventTargetWithInlineData::trace(visitor); |
| 583 } | 584 } |
| 584 | 585 |
| 585 } // namespace blink | 586 } // namespace blink |
| OLD | NEW |