Commit 87d37957 authored by peary2's avatar peary2 Committed by Commit bot

Clean up PerformanceCompositeTiming and PerformanceRenderTiming

delete remnants of previous Frame Timing (obsolete version).

BUG=655384

Review-Url: https://chromiumcodereview.appspot.com/2413353003
Cr-Commit-Position: refs/heads/master@{#426919}
parent ea9004b7
......@@ -4503,10 +4503,6 @@ interface Performance : EventTarget
setter onframetimingbufferfull
setter onresourcetimingbufferfull
setter onwebkitresourcetimingbufferfull
interface PerformanceCompositeTiming : PerformanceEntry
attribute @@toStringTag
getter sourceFrame
method constructor
interface PerformanceEntry
attribute @@toStringTag
getter duration
......@@ -4542,10 +4538,6 @@ interface PerformanceObserverEntryList
method getEntries
method getEntriesByName
method getEntriesByType
interface PerformanceRenderTiming : PerformanceEntry
attribute @@toStringTag
getter sourceFrame
method constructor
interface PerformanceResourceTiming : PerformanceEntry
attribute @@toStringTag
getter connectEnd
......
......@@ -395,7 +395,6 @@ core_idl_files = get_path_info([
"svg/SVGViewSpec.idl",
"timing/MemoryInfo.idl",
"timing/Performance.idl",
"timing/PerformanceCompositeTiming.idl",
"timing/PerformanceEntry.idl",
"timing/PerformanceLongTaskTiming.idl",
"timing/PerformanceMark.idl",
......@@ -403,7 +402,6 @@ core_idl_files = get_path_info([
"timing/PerformanceNavigation.idl",
"timing/PerformanceObserver.idl",
"timing/PerformanceObserverEntryList.idl",
"timing/PerformanceRenderTiming.idl",
"timing/PerformanceResourceTiming.idl",
"timing/PerformanceTiming.idl",
"timing/WorkerPerformance.idl",
......
......@@ -13,8 +13,6 @@ blink_core_sources("timing") {
"Performance.h",
"PerformanceBase.cpp",
"PerformanceBase.h",
"PerformanceCompositeTiming.cpp",
"PerformanceCompositeTiming.h",
"PerformanceEntry.cpp",
"PerformanceEntry.h",
"PerformanceLongTaskTiming.cpp",
......@@ -27,8 +25,6 @@ blink_core_sources("timing") {
"PerformanceObserver.h",
"PerformanceObserverEntryList.cpp",
"PerformanceObserverEntryList.h",
"PerformanceRenderTiming.cpp",
"PerformanceRenderTiming.h",
"PerformanceResourceTiming.cpp",
"PerformanceResourceTiming.h",
"PerformanceTiming.cpp",
......
......@@ -34,10 +34,8 @@
#include "core/dom/Document.h"
#include "core/events/Event.h"
#include "core/frame/UseCounter.h"
#include "core/timing/PerformanceCompositeTiming.h"
#include "core/timing/PerformanceLongTaskTiming.h"
#include "core/timing/PerformanceObserver.h"
#include "core/timing/PerformanceRenderTiming.h"
#include "core/timing/PerformanceResourceTiming.h"
#include "core/timing/PerformanceUserTiming.h"
#include "platform/network/ResourceTimingInfo.h"
......@@ -308,33 +306,6 @@ bool PerformanceBase::isResourceTimingBufferFull() {
return m_resourceTimingBuffer.size() >= m_resourceTimingBufferSize;
}
void PerformanceBase::addRenderTiming(Document* initiatorDocument,
unsigned sourceFrame,
double startTime,
double finishTime) {
if (isFrameTimingBufferFull() && !hasObserverFor(PerformanceEntry::Render))
return;
PerformanceEntry* entry = PerformanceRenderTiming::create(
initiatorDocument, sourceFrame, startTime, finishTime);
notifyObserversOfEntry(*entry);
if (!isFrameTimingBufferFull())
addFrameTimingBuffer(*entry);
}
void PerformanceBase::addCompositeTiming(Document* initiatorDocument,
unsigned sourceFrame,
double startTime) {
if (isFrameTimingBufferFull() && !hasObserverFor(PerformanceEntry::Composite))
return;
PerformanceEntry* entry = PerformanceCompositeTiming::create(
initiatorDocument, sourceFrame, startTime);
notifyObserversOfEntry(*entry);
if (!isFrameTimingBufferFull())
addFrameTimingBuffer(*entry);
}
void PerformanceBase::addFrameTimingBuffer(PerformanceEntry& entry) {
m_frameTimingBuffer.append(&entry);
......
......@@ -100,10 +100,6 @@ class CORE_EXPORT PerformanceBase : public EventTargetWithInlineData {
void addResourceTiming(const ResourceTimingInfo&);
void addRenderTiming(Document*, unsigned, double, double);
void addCompositeTiming(Document*, unsigned, double);
void mark(const String& markName, ExceptionState&);
void clearMarks(const String& markName);
......
/*
* 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
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "core/timing/PerformanceCompositeTiming.h"
#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/Document.h"
#include "core/loader/DocumentLoader.h"
namespace blink {
static double monotonicTimeToDocumentMilliseconds(Document* document,
double seconds) {
ASSERT(seconds >= 0.0);
return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(
seconds) *
1000.0;
}
PerformanceCompositeTiming::PerformanceCompositeTiming(
Document* requestingDocument,
unsigned sourceFrame,
double startTime)
: PerformanceEntry(
requestingDocument->url().getString(),
"composite",
monotonicTimeToDocumentMilliseconds(requestingDocument, startTime),
monotonicTimeToDocumentMilliseconds(requestingDocument, startTime)),
m_sourceFrame(sourceFrame),
m_requestingDocument(requestingDocument) {}
PerformanceCompositeTiming::~PerformanceCompositeTiming() {}
unsigned PerformanceCompositeTiming::sourceFrame() const {
return m_sourceFrame;
}
void PerformanceCompositeTiming::buildJSONValue(
V8ObjectBuilder& builder) const {
PerformanceEntry::buildJSONValue(builder);
builder.addNumber("sourceFrame", sourceFrame());
}
DEFINE_TRACE(PerformanceCompositeTiming) {
visitor->trace(m_requestingDocument);
PerformanceEntry::trace(visitor);
}
} // namespace blink
/*
* 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
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PerformanceCompositeTiming_h
#define PerformanceCompositeTiming_h
#include "core/timing/PerformanceEntry.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/text/WTFString.h"
namespace blink {
class Document;
class PerformanceCompositeTiming final : public PerformanceEntry {
DEFINE_WRAPPERTYPEINFO();
public:
static PerformanceCompositeTiming* create(Document* requestingDocument,
unsigned sourceFrame,
double startTime) {
return new PerformanceCompositeTiming(requestingDocument, sourceFrame,
startTime);
}
unsigned sourceFrame() const;
DECLARE_VIRTUAL_TRACE();
protected:
void buildJSONValue(V8ObjectBuilder&) const override;
private:
PerformanceCompositeTiming(Document* requestingDocument,
unsigned sourceFrame,
double startTime);
~PerformanceCompositeTiming() override;
unsigned m_sourceFrame;
Member<Document> m_requestingDocument;
};
} // namespace blink
#endif // PerformanceCompositeTiming_h
/*
* Copyright (C) 2015 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// https://w3c.github.io/frame-timing/#performancecompositetiming
[
RuntimeEnabled=FrameTimingSupport // Experimental flag
] interface PerformanceCompositeTiming : PerformanceEntry {
// TODO(foolip): This is named |sourceFrameNumber| in the spec.
readonly attribute unsigned long sourceFrame;
// TODO(foolip): serializer = {inherit, attribute};
};
/*
* 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
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "core/timing/PerformanceRenderTiming.h"
#include "bindings/core/v8/V8ObjectBuilder.h"
#include "core/dom/Document.h"
#include "core/loader/DocumentLoader.h"
namespace blink {
static double monotonicTimeToDocumentMilliseconds(Document* document,
double seconds) {
ASSERT(seconds >= 0.0);
return document->loader()->timing().monotonicTimeToZeroBasedDocumentTime(
seconds) *
1000.0;
}
PerformanceRenderTiming::PerformanceRenderTiming(Document* requestingDocument,
unsigned sourceFrame,
double startTime,
double finishTime)
: PerformanceEntry(
requestingDocument->url().getString(),
"render",
monotonicTimeToDocumentMilliseconds(requestingDocument, startTime),
monotonicTimeToDocumentMilliseconds(requestingDocument, finishTime)),
m_sourceFrame(sourceFrame),
m_requestingDocument(requestingDocument) {}
PerformanceRenderTiming::~PerformanceRenderTiming() {}
unsigned PerformanceRenderTiming::sourceFrame() const {
return m_sourceFrame;
}
void PerformanceRenderTiming::buildJSONValue(V8ObjectBuilder& builder) const {
PerformanceEntry::buildJSONValue(builder);
builder.addNumber("sourceFrame", sourceFrame());
}
DEFINE_TRACE(PerformanceRenderTiming) {
visitor->trace(m_requestingDocument);
PerformanceEntry::trace(visitor);
}
} // namespace blink
/*
* 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
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef PerformanceRenderTiming_h
#define PerformanceRenderTiming_h
#include "core/timing/PerformanceEntry.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
#include "wtf/text/WTFString.h"
namespace blink {
class Document;
class PerformanceRenderTiming final : public PerformanceEntry {
DEFINE_WRAPPERTYPEINFO();
public:
static PerformanceRenderTiming* create(Document* requestingDocument,
unsigned sourceFrame,
double startTime,
double finishTime) {
return new PerformanceRenderTiming(requestingDocument, sourceFrame,
startTime, finishTime);
}
unsigned sourceFrame() const;
DECLARE_VIRTUAL_TRACE();
protected:
void buildJSONValue(V8ObjectBuilder&) const override;
private:
PerformanceRenderTiming(Document* requestingDocument,
unsigned sourceFrame,
double startTime,
double finishTime);
~PerformanceRenderTiming() override;
unsigned m_sourceFrame;
Member<Document> m_requestingDocument;
};
} // namespace blink
#endif // PerformanceRenderTiming_h
/*
* Copyright (C) 2015 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// https://w3c.github.io/frame-timing/#performancerendertiming
[
RuntimeEnabled=FrameTimingSupport // Experimental flag
] interface PerformanceRenderTiming : PerformanceEntry {
// TODO(foolip): This is named |sourceFrameNumber| in the spec.
readonly attribute unsigned long sourceFrame;
// TODO(foolip): serializer = {inherit, attribute};
};
......@@ -54,7 +54,6 @@
#include "core/paint/PaintLayerPainter.h"
#include "core/timing/DOMWindowPerformance.h"
#include "core/timing/Performance.h"
#include "core/timing/PerformanceCompositeTiming.h"
#include "platform/KeyboardCodes.h"
#include "platform/UserGestureIndicator.h"
#include "platform/geometry/IntRect.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment