| 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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 return; | 347 return; |
| 348 DCHECK(frame); | 348 DCHECK(frame); |
| 349 const DocumentLoader* documentLoader = frame->loader().documentLoader(); | 349 const DocumentLoader* documentLoader = frame->loader().documentLoader(); |
| 350 DCHECK(documentLoader); | 350 DCHECK(documentLoader); |
| 351 | 351 |
| 352 const DocumentLoadTiming& documentLoadTiming = documentLoader->timing(); | 352 const DocumentLoadTiming& documentLoadTiming = documentLoader->timing(); |
| 353 | 353 |
| 354 const DocumentTiming* documentTiming = | 354 const DocumentTiming* documentTiming = |
| 355 frame->document() ? &(frame->document()->timing()) : nullptr; | 355 frame->document() ? &(frame->document()->timing()) : nullptr; |
| 356 | 356 |
| 357 const ResourceResponse& finalResponse = documentLoader->response(); | |
| 358 ResourceTimingInfo* navigationTimingInfo = | 357 ResourceTimingInfo* navigationTimingInfo = |
| 359 documentLoader->getNavigationTimingInfo(); | 358 documentLoader->getNavigationTimingInfo(); |
| 360 if (!navigationTimingInfo) | 359 if (!navigationTimingInfo) |
| 361 return; | 360 return; |
| 362 | 361 |
| 362 const ResourceResponse& finalResponse = navigationTimingInfo->finalResponse(); |
| 363 |
| 363 ResourceLoadTiming* resourceLoadTiming = finalResponse.resourceLoadTiming(); | 364 ResourceLoadTiming* resourceLoadTiming = finalResponse.resourceLoadTiming(); |
| 364 // Don't create a navigation timing instance when | 365 // Don't create a navigation timing instance when |
| 365 // resourceLoadTiming is null, which could happen when visiting non-http sites | 366 // resourceLoadTiming is null, which could happen when visiting non-http sites |
| 366 // such as about:blank or in some error cases. | 367 // such as about:blank or in some error cases. |
| 367 if (!resourceLoadTiming) | 368 if (!resourceLoadTiming) |
| 368 return; | 369 return; |
| 369 double lastRedirectEndTime = documentLoadTiming.redirectEnd(); | 370 double lastRedirectEndTime = documentLoadTiming.redirectEnd(); |
| 370 double finishTime = documentLoadTiming.loadEventEnd(); | 371 double finishTime = documentLoadTiming.loadEventEnd(); |
| 371 | 372 |
| 372 ExecutionContext* context = getExecutionContext(); | 373 ExecutionContext* context = getExecutionContext(); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 visitor->trace(m_resourceTimingBuffer); | 598 visitor->trace(m_resourceTimingBuffer); |
| 598 visitor->trace(m_navigationTiming); | 599 visitor->trace(m_navigationTiming); |
| 599 visitor->trace(m_userTiming); | 600 visitor->trace(m_userTiming); |
| 600 visitor->trace(m_observers); | 601 visitor->trace(m_observers); |
| 601 visitor->trace(m_activeObservers); | 602 visitor->trace(m_activeObservers); |
| 602 visitor->trace(m_suspendedObservers); | 603 visitor->trace(m_suspendedObservers); |
| 603 EventTargetWithInlineData::trace(visitor); | 604 EventTargetWithInlineData::trace(visitor); |
| 604 } | 605 } |
| 605 | 606 |
| 606 } // namespace blink | 607 } // namespace blink |
| OLD | NEW |