diff options
Diffstat (limited to 'Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp')
-rw-r--r-- | Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp b/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp index 0b6f98ce1..471897834 100644 --- a/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp +++ b/Source/WebCore/bindings/js/JSPerformanceEntryCustom.cpp @@ -30,7 +30,7 @@ #include "config.h" -#if ENABLE(PERFORMANCE_TIMELINE) +#if ENABLE(WEB_TIMING) #include "JSPerformanceEntry.h" @@ -46,27 +46,25 @@ using namespace JSC; namespace WebCore { -JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, PerformanceEntry* entry) +JSValue toJSNewlyCreated(ExecState*, JSDOMGlobalObject* globalObject, Ref<PerformanceEntry>&& entry) { - if (!entry) - return jsNull(); + if (is<PerformanceResourceTiming>(entry)) + return createWrapper<PerformanceResourceTiming>(globalObject, WTFMove(entry)); -#if ENABLE(RESOURCE_TIMING) - if (entry->isResource()) - return wrap<JSPerformanceResourceTiming>(exec, globalObject, static_cast<PerformanceResourceTiming*>(entry)); -#endif + if (is<PerformanceMark>(entry)) + return createWrapper<PerformanceMark>(globalObject, WTFMove(entry)); -#if ENABLE(USER_TIMING) - if (entry->isMark()) - return wrap<JSPerformanceMark>(exec, globalObject, static_cast<PerformanceMark*>(entry)); + if (is<PerformanceMeasure>(entry)) + return createWrapper<PerformanceMeasure>(globalObject, WTFMove(entry)); - if (entry->isMeasure()) - return wrap<JSPerformanceMeasure>(exec, globalObject, static_cast<PerformanceMeasure*>(entry)); -#endif + return createWrapper<PerformanceEntry>(globalObject, WTFMove(entry)); +} - return wrap<JSPerformanceEntry>(exec, globalObject, entry); +JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, PerformanceEntry& entry) +{ + return wrap(state, globalObject, entry); } } // namespace WebCore -#endif // ENABLE(PERFORMANCE_TIMELINE) +#endif // ENABLE(WEB_TIMING) |