diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-06-27 06:07:23 +0000 |
commit | 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c (patch) | |
tree | 46dcd36c86e7fbc6e5df36deb463b33e9967a6f7 /Source/WebCore/page/PerformanceUserTiming.h | |
parent | 32761a6cee1d0dee366b885b7b9c777e67885688 (diff) | |
download | WebKitGtk-tarball-master.tar.gz |
webkitgtk-2.16.5HEADwebkitgtk-2.16.5master
Diffstat (limited to 'Source/WebCore/page/PerformanceUserTiming.h')
-rw-r--r-- | Source/WebCore/page/PerformanceUserTiming.h | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/Source/WebCore/page/PerformanceUserTiming.h b/Source/WebCore/page/PerformanceUserTiming.h index 14c8c3f9b..783137378 100644 --- a/Source/WebCore/page/PerformanceUserTiming.h +++ b/Source/WebCore/page/PerformanceUserTiming.h @@ -23,56 +23,46 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef PerformanceUserTiming_h -#define PerformanceUserTiming_h +#pragma once -#if ENABLE(USER_TIMING) +#if ENABLE(WEB_TIMING) -#include "EventException.h" -#include "ExceptionCode.h" -#include "Performance.h" -#include "PerformanceTiming.h" +#include "ExceptionOr.h" +#include "PerformanceMark.h" +#include "PerformanceMeasure.h" #include <wtf/HashMap.h> -#include <wtf/PassRefPtr.h> -#include <wtf/RefCounted.h> #include <wtf/text/StringHash.h> -#include <wtf/text/WTFString.h> namespace WebCore { class Performance; -class PerformanceEntry; -typedef unsigned long long (PerformanceTiming::*NavigationTimingFunction)() const; -typedef HashMap<String, Vector<RefPtr<PerformanceEntry> > > PerformanceEntryMap; +using PerformanceEntryMap = HashMap<String, Vector<RefPtr<PerformanceEntry>>>; -class UserTiming : public RefCounted<UserTiming> { +class UserTiming { public: - static PassRefPtr<UserTiming> create(Performance* performance) { return adoptRef(new UserTiming(performance)); } + explicit UserTiming(Performance&); - void mark(const String& markName, ExceptionCode&); + ExceptionOr<Ref<PerformanceMark>> mark(const String& markName); void clearMarks(const String& markName); - void measure(const String& measureName, const String& startMark, const String& endMark, ExceptionCode&); + ExceptionOr<Ref<PerformanceMeasure>> measure(const String& measureName, const String& startMark, const String& endMark); void clearMeasures(const String& measureName); - Vector<RefPtr<PerformanceEntry> > getMarks() const; - Vector<RefPtr<PerformanceEntry> > getMeasures() const; + Vector<RefPtr<PerformanceEntry>> getMarks() const; + Vector<RefPtr<PerformanceEntry>> getMeasures() const; - Vector<RefPtr<PerformanceEntry> > getMarks(const String& name) const; - Vector<RefPtr<PerformanceEntry> > getMeasures(const String& name) const; + Vector<RefPtr<PerformanceEntry>> getMarks(const String& name) const; + Vector<RefPtr<PerformanceEntry>> getMeasures(const String& name) const; private: - explicit UserTiming(Performance*); + ExceptionOr<double> findExistingMarkStartTime(const String& markName); - double findExistingMarkStartTime(const String& markName, ExceptionCode&); - Performance* m_performance; + Performance& m_performance; PerformanceEntryMap m_marksMap; PerformanceEntryMap m_measuresMap; }; } -#endif // ENABLE(USER_TIMING) - -#endif // !defined(PerformanceUserTiming_h) +#endif // ENABLE(WEB_TIMING) |