Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(471)

Side by Side Diff: Source/core/timing/PerformanceTiming.cpp

Issue 1314843009: Add DocumentTiming metrics for "time to first text paint" (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/timing/PerformanceTiming.h ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 315
316 unsigned long long PerformanceTiming::firstLayout() const 316 unsigned long long PerformanceTiming::firstLayout() const
317 { 317 {
318 const DocumentTiming* timing = documentTiming(); 318 const DocumentTiming* timing = documentTiming();
319 if (!timing) 319 if (!timing)
320 return 0; 320 return 0;
321 321
322 return monotonicTimeToIntegerMilliseconds(timing->firstLayout()); 322 return monotonicTimeToIntegerMilliseconds(timing->firstLayout());
323 } 323 }
324 324
325 unsigned long long PerformanceTiming::firstNonBlankText() const
326 {
327 const DocumentTiming* timing = documentTiming();
328 if (!timing)
329 return 0;
330
331 return monotonicTimeToIntegerMilliseconds(timing->firstNonBlankText());
332 }
333
334 unsigned long long PerformanceTiming::firstCustomFontText() const
335 {
336 const DocumentTiming* timing = documentTiming();
337 if (!timing)
338 return 0;
339
340 return monotonicTimeToIntegerMilliseconds(timing->firstCustomFontText());
341 }
342
325 DocumentLoader* PerformanceTiming::documentLoader() const 343 DocumentLoader* PerformanceTiming::documentLoader() const
326 { 344 {
327 if (!m_frame) 345 if (!m_frame)
328 return nullptr; 346 return nullptr;
329 347
330 return m_frame->loader().documentLoader(); 348 return m_frame->loader().documentLoader();
331 } 349 }
332 350
333 const DocumentTiming* PerformanceTiming::documentTiming() const 351 const DocumentTiming* PerformanceTiming::documentTiming() const
334 { 352 {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 423
406 return timing->pseudoWallTimeToMonotonicTime(toDoubleSeconds(integerMillisec onds)); 424 return timing->pseudoWallTimeToMonotonicTime(toDoubleSeconds(integerMillisec onds));
407 } 425 }
408 426
409 DEFINE_TRACE(PerformanceTiming) 427 DEFINE_TRACE(PerformanceTiming)
410 { 428 {
411 DOMWindowProperty::trace(visitor); 429 DOMWindowProperty::trace(visitor);
412 } 430 }
413 431
414 } // namespace blink 432 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/timing/PerformanceTiming.h ('k') | Source/platform/fonts/Font.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698