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

Unified Diff: Source/core/timing/PerformanceCompositeTiming.cpp

Issue 908453003: Blink changes to record interest rects for http://w3c.github.io/frame-timing/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code review comments (and re-sync) Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/timing/PerformanceCompositeTiming.cpp
diff --git a/Source/web/WebImageGenerator.cpp b/Source/core/timing/PerformanceCompositeTiming.cpp
similarity index 59%
copy from Source/web/WebImageGenerator.cpp
copy to Source/core/timing/PerformanceCompositeTiming.cpp
index 0ea634147fcaab0923eea06b16abcd8cdcda4b89..bb0f34e82908cb7d4fb2e54f3e8bf288abb8134f 100644
--- a/Source/web/WebImageGenerator.cpp
+++ b/Source/core/timing/PerformanceCompositeTiming.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2015 Google Inc. All rights reserved.
+ * Copyright (C) 2015 Intel Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -29,15 +30,39 @@
*/
#include "config.h"
-#include "public/platform/WebImageGenerator.h"
+#include "core/timing/PerformanceCompositeTiming.h"
-#include "platform/graphics/DecodingImageGenerator.h"
+#include "core/dom/Document.h"
+#include "core/loader/DocumentLoader.h"
namespace blink {
-SkImageGenerator* WebImageGenerator::create(SkData* data)
+static double monotonicTimeToDocumentMilliseconds(Document* document, double seconds)
{
- return DecodingImageGenerator::create(data);
+ ASSERT(seconds >= 0.0);
+ return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(seconds) * 1000.0;
+}
+
+PerformanceCompositeTiming::PerformanceCompositeTiming(Document* requestingDocument, unsigned sourceFrame, double startTime)
+ : PerformanceEntry(requestingDocument->url().string(), "composite", monotonicTimeToDocumentMilliseconds(requestingDocument, startTime), monotonicTimeToDocumentMilliseconds(requestingDocument, startTime))
+ , m_sourceFrame(sourceFrame)
+ , m_requestingDocument(requestingDocument)
+{
+}
+
+PerformanceCompositeTiming::~PerformanceCompositeTiming()
+{
+}
+
+unsigned PerformanceCompositeTiming::sourceFrame() const
+{
+ return m_sourceFrame;
+}
+
+void PerformanceCompositeTiming::trace(Visitor* visitor)
+{
+ visitor->trace(m_requestingDocument);
+ PerformanceEntry::trace(visitor);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698