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

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

Issue 390193003: [not for review] Add Draw entries to window Performance Timeline (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Code refactoring in RenderView Created 6 years, 5 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/PerformanceDrawTiming.cpp
diff --git a/Source/core/timing/PerformanceEntry.cpp b/Source/core/timing/PerformanceDrawTiming.cpp
similarity index 59%
copy from Source/core/timing/PerformanceEntry.cpp
copy to Source/core/timing/PerformanceDrawTiming.cpp
index ee615282af2c991a4caf02bf27be698a05d72ac9..ce62b6ac892fd8ba9d1cd87016468916a2c25aa6 100644
--- a/Source/core/timing/PerformanceEntry.cpp
+++ b/Source/core/timing/PerformanceDrawTiming.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2012 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,41 +30,43 @@
*/
#include "config.h"
-#include "core/timing/PerformanceEntry.h"
+#include "core/timing/PerformanceDrawTiming.h"
-namespace WebCore {
+#include "core/dom/Document.h"
+#include "core/loader/DocumentLoadTiming.h"
+#include "core/loader/DocumentLoader.h"
+#include "platform/network/ResourceRequest.h"
+#include "platform/network/ResourceResponse.h"
-PerformanceEntry::PerformanceEntry(const String& name, const String& entryType, double startTime, double finishTime)
- : m_name(name)
- , m_entryType(entryType)
- , m_startTime(startTime)
- , m_duration(finishTime - startTime)
-{
- ScriptWrappable::init(this);
-}
+namespace WebCore {
-PerformanceEntry::~PerformanceEntry()
+static double monotonicTimeToDocumentMilliseconds(Document* document, double seconds)
{
+ ASSERT(seconds >= 0.0);
+ return document->loader()->timing()->monotonicTimeToZeroBasedDocumentTime(seconds) * 1000.0;
}
-String PerformanceEntry::name() const
+PerformanceDrawTiming::PerformanceDrawTiming(Document* requestingDocument, unsigned sourceFrame, double startTime, bool isFinal)
+ : PerformanceEntry(requestingDocument->url().string(), "draw", monotonicTimeToDocumentMilliseconds(requestingDocument, startTime), monotonicTimeToDocumentMilliseconds(requestingDocument, startTime))
+ , m_sourceFrame(sourceFrame)
+ , m_isFinal(isFinal)
+ , m_requestingDocument(requestingDocument)
{
- return m_name;
+ ScriptWrappable::init(this);
}
-String PerformanceEntry::entryType() const
+PerformanceDrawTiming::~PerformanceDrawTiming()
{
- return m_entryType;
}
-double PerformanceEntry::startTime() const
+unsigned PerformanceDrawTiming::sourceFrame() const
{
- return m_startTime;
+ return m_sourceFrame;
}
-double PerformanceEntry::duration() const
+bool PerformanceDrawTiming::isFinal() const
{
- return m_duration;
+ return m_isFinal;
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698