| 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
|
|
|