| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 { | 419 { |
| 420 const DocumentParserTiming* timing = documentParserTiming(); | 420 const DocumentParserTiming* timing = documentParserTiming(); |
| 421 if (!timing) | 421 if (!timing) |
| 422 return 0; | 422 return 0; |
| 423 | 423 |
| 424 return toIntegerMilliseconds(timing->parserBlockedOnScriptExecutionFromDocum
entWriteDuration()); | 424 return toIntegerMilliseconds(timing->parserBlockedOnScriptExecutionFromDocum
entWriteDuration()); |
| 425 } | 425 } |
| 426 | 426 |
| 427 DocumentLoader* PerformanceTiming::documentLoader() const | 427 DocumentLoader* PerformanceTiming::documentLoader() const |
| 428 { | 428 { |
| 429 if (!m_frame) | 429 if (!frame()) |
| 430 return nullptr; | 430 return nullptr; |
| 431 | 431 |
| 432 return m_frame->loader().documentLoader(); | 432 return frame()->loader().documentLoader(); |
| 433 } | 433 } |
| 434 | 434 |
| 435 const DocumentTiming* PerformanceTiming::documentTiming() const | 435 const DocumentTiming* PerformanceTiming::documentTiming() const |
| 436 { | 436 { |
| 437 if (!m_frame) | 437 if (!frame()) |
| 438 return nullptr; | 438 return nullptr; |
| 439 | 439 |
| 440 Document* document = m_frame->document(); | 440 Document* document = frame()->document(); |
| 441 if (!document) | 441 if (!document) |
| 442 return nullptr; | 442 return nullptr; |
| 443 | 443 |
| 444 return &document->timing(); | 444 return &document->timing(); |
| 445 } | 445 } |
| 446 | 446 |
| 447 const PaintTiming* PerformanceTiming::paintTiming() const | 447 const PaintTiming* PerformanceTiming::paintTiming() const |
| 448 { | 448 { |
| 449 if (!m_frame) | 449 if (!frame()) |
| 450 return nullptr; | 450 return nullptr; |
| 451 | 451 |
| 452 Document* document = m_frame->document(); | 452 Document* document = frame()->document(); |
| 453 if (!document) | 453 if (!document) |
| 454 return nullptr; | 454 return nullptr; |
| 455 | 455 |
| 456 return &PaintTiming::from(*document); | 456 return &PaintTiming::from(*document); |
| 457 } | 457 } |
| 458 | 458 |
| 459 const DocumentParserTiming* PerformanceTiming::documentParserTiming() const | 459 const DocumentParserTiming* PerformanceTiming::documentParserTiming() const |
| 460 { | 460 { |
| 461 if (!m_frame) | 461 if (!frame()) |
| 462 return nullptr; | 462 return nullptr; |
| 463 | 463 |
| 464 Document* document = m_frame->document(); | 464 Document* document = frame()->document(); |
| 465 if (!document) | 465 if (!document) |
| 466 return nullptr; | 466 return nullptr; |
| 467 | 467 |
| 468 return &DocumentParserTiming::from(*document); | 468 return &DocumentParserTiming::from(*document); |
| 469 } | 469 } |
| 470 | 470 |
| 471 DocumentLoadTiming* PerformanceTiming::documentLoadTiming() const | 471 DocumentLoadTiming* PerformanceTiming::documentLoadTiming() const |
| 472 { | 472 { |
| 473 DocumentLoader* loader = documentLoader(); | 473 DocumentLoader* loader = documentLoader(); |
| 474 if (!loader) | 474 if (!loader) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 | 531 |
| 532 return timing->pseudoWallTimeToMonotonicTime(toDoubleSeconds(integerMillisec
onds)); | 532 return timing->pseudoWallTimeToMonotonicTime(toDoubleSeconds(integerMillisec
onds)); |
| 533 } | 533 } |
| 534 | 534 |
| 535 DEFINE_TRACE(PerformanceTiming) | 535 DEFINE_TRACE(PerformanceTiming) |
| 536 { | 536 { |
| 537 DOMWindowProperty::trace(visitor); | 537 DOMWindowProperty::trace(visitor); |
| 538 } | 538 } |
| 539 | 539 |
| 540 } // namespace blink | 540 } // namespace blink |
| OLD | NEW |