Source/WebCore: [User Timing]Change class name that presented in Javascript for user timing entry.

https://bugs.webkit.org/show_bug.cgi?id=107925.

Patch by Pan Deng <pan.deng@intel.com> on 2013-01-25
Reviewed by Tony Gentilcore.

In current implementation, class type of user timing entries are PerformanceEntry, according
to W3C spec, they should be PerformanceMark and PerformanceMeasure.

Test: http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type.html

* bindings/v8/custom/V8PerformanceEntryCustom.cpp:
(WebCore::wrap):
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::isMark):
(WebCore::PerformanceEntry::isMeasure):
* page/PerformanceMark.h:
(WebCore::PerformanceMark::isMark):
(PerformanceMark):
* page/PerformanceMeasure.h:
(WebCore::PerformanceMeasure::isMeasure):
(PerformanceMeasure):

LayoutTests: [User Timing] Class name of user timing entries should be PerformanceMark/PerformanceMeasure.
https://bugs.webkit.org/show_bug.cgi?id=107925.

Patch by Pan Deng <pan.deng@intel.com> on 2013-01-25
Reviewed by Tony Gentilcore.

* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type-expected.txt: Added.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@140882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 65ab04a4
2013-01-25 Pan Deng <pan.deng@intel.com>
[User Timing] Class name of user timing entries should be PerformanceMark/PerformanceMeasure.
https://bugs.webkit.org/show_bug.cgi?id=107925.
Reviewed by Tony Gentilcore.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type-expected.txt: Added.
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type.html: Added.
2013-01-24 Ojan Vafai <ojan@chromium.org>
MathML preferred widths should not depend on layout information
Description
This test validates the user timing entry type, PerformanceMark and PerformanceMeasure.
PASS Class name of mark entry should be PerformanceMark.
PASS Class name of measure entry should be PerformanceMeasure.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>user timing entry type</title>
<link rel="author" title="Intel" href="http://www.intel.com/" />
<link rel="help" href="http://www.w3.org/TR/user-timing/#extensions-performance-interface"/>
<script src="/w3c/resources/testharness.js"></script>
<script src="/w3c/resources/testharnessreport.js"></script>
<script src="/w3c/webperf/resources/webperftestharness.js"></script>
<script src="/w3c/webperf/resources/webperftestharnessextension.js"></script>
</head>
<body>
<h1>Description</h1>
<p>This test validates the user timing entry type, PerformanceMark and PerformanceMeasure.</p>
<div id="log"></div>
<script>
var context = new PerformanceContext(window.performance);
context.mark('mark');
context.measure('measure');
var mark_entry = context.getEntriesByName('mark')[0];
var measure_entry = context.getEntriesByName('measure')[0];
test_equals(Object.prototype.toString.call(mark_entry), '[object PerformanceMark]', 'Class name of mark entry should be PerformanceMark.');
test_equals(Object.prototype.toString.call(measure_entry), '[object PerformanceMeasure]', 'Class name of measure entry should be PerformanceMeasure.');
</script>
</body>
</html>
2013-01-25 Pan Deng <pan.deng@intel.com>
[User Timing]Change class name that presented in Javascript for user timing entry.
https://bugs.webkit.org/show_bug.cgi?id=107925.
Reviewed by Tony Gentilcore.
In current implementation, class type of user timing entries are PerformanceEntry, according
to W3C spec, they should be PerformanceMark and PerformanceMeasure.
Test: http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_entry_type.html
* bindings/v8/custom/V8PerformanceEntryCustom.cpp:
(WebCore::wrap):
* page/PerformanceEntry.h:
(WebCore::PerformanceEntry::isMark):
(WebCore::PerformanceEntry::isMeasure):
* page/PerformanceMark.h:
(WebCore::PerformanceMark::isMark):
(PerformanceMark):
* page/PerformanceMeasure.h:
(WebCore::PerformanceMeasure::isMeasure):
(PerformanceMeasure):
2013-01-24 Roger Fong <roger_fong@apple.com>
Updated WebCore property sheets and added a WebCore solution file.
......@@ -34,9 +34,13 @@
#if ENABLE(PERFORMANCE_TIMELINE)
#include "Performance.h"
#include "PerformanceMark.h"
#include "PerformanceMeasure.h"
#include "PerformanceResourceTiming.h"
#include "V8PerformanceEntry.h"
#include "V8PerformanceMark.h"
#include "V8PerformanceMeasure.h"
#include "V8PerformanceResourceTiming.h"
#include <wtf/RefPtr.h>
......@@ -50,6 +54,15 @@ v8::Handle<v8::Object> wrap(PerformanceEntry* impl, v8::Handle<v8::Object> creat
if (impl->isResource())
return wrap(static_cast<PerformanceResourceTiming*>(impl), creationContext, isolate);
#endif
#if ENABLE(USER_TIMING)
if (impl->isMark())
return wrap(static_cast<PerformanceMark*>(impl), creationContext, isolate);
if (impl->isMeasure())
return wrap(static_cast<PerformanceMeasure*>(impl), creationContext, isolate);
#endif
return V8PerformanceEntry::createWrapper(impl, creationContext, isolate);
}
......
......@@ -51,6 +51,8 @@ public:
double duration() const;
virtual bool isResource() { return false; }
virtual bool isMark() { return false; }
virtual bool isMeasure() { return false; }
static bool startTimeCompareLessThan(PassRefPtr<PerformanceEntry> a, PassRefPtr<PerformanceEntry> b)
{
......
......@@ -38,6 +38,8 @@ class PerformanceMark : public PerformanceEntry {
public:
static PassRefPtr<PerformanceMark> create(const String& name, double startTime) { return adoptRef(new PerformanceMark(name, startTime)); }
virtual bool isMark() { return true; }
private:
PerformanceMark(const String& name, double startTime) : PerformanceEntry(name, "mark", startTime, startTime) { }
~PerformanceMark() { }
......
......@@ -38,6 +38,8 @@ class PerformanceMeasure : public PerformanceEntry {
public:
static PassRefPtr<PerformanceMeasure> create(const String& name, double startTime, double duration) { return adoptRef(new PerformanceMeasure(name, startTime, duration)); }
virtual bool isMeasure() { return true; }
private:
PerformanceMeasure(const String& name, double startTime, double duration) : PerformanceEntry(name, "measure", startTime, duration) { }
~PerformanceMeasure() { }
......
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