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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceTiming.cpp

Issue 1511583002: Client Side Speed Index Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp b/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
index 30688fbc61bf5201c09ef8867c9f57645f7f6b3f..4acf089e57790425fe2d699749b14bc8d393c73b 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceTiming.cpp
@@ -352,6 +352,21 @@ unsigned long long PerformanceTiming::firstImagePaint() const
return monotonicTimeToIntegerMilliseconds(timing->firstImagePaint());
}
+double PerformanceTiming::speedIndex() const
+{
+ const PaintTiming* paintTime = paintTiming();
+ DocumentLoadTiming* loadTime = documentLoadTiming();
+ if (!paintTime || !loadTime)
+ return 0;
+
+ double navigationStart = loadTime->navigationStart();
+ if (!navigationStart)
+ return 0;
+
+ double speedIndex = paintTime->speedIndex(navigationStart);
+ return speedIndex;
+}
+
DocumentLoader* PerformanceTiming::documentLoader() const
{
if (!m_frame)
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceTiming.h ('k') | third_party/WebKit/Source/platform/graphics/GraphicsLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698