summaryrefslogtreecommitdiff
path: root/dom/performance/Performance.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 12:15:36 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 12:15:36 +0200
commit98438fa32e4f93b59359662188e164c7c828acb7 (patch)
treea32206dd3595d6e412029395ea55e3bf8438e1f5 /dom/performance/Performance.cpp
parent39d4a11267fd707df04bb06a74e24f36e2dbcd28 (diff)
downloaduxp-98438fa32e4f93b59359662188e164c7c828acb7.tar.gz
Bug 1313420 - Implement Performance.timeOrigin - part 1
https://hg.mozilla.org/mozilla-central/rev/cf0f72f0b0be
Diffstat (limited to 'dom/performance/Performance.cpp')
-rwxr-xr-xdom/performance/Performance.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp
index 074bffe8ad..d1547dc065 100755
--- a/dom/performance/Performance.cpp
+++ b/dom/performance/Performance.cpp
@@ -13,6 +13,7 @@
#include "PerformanceMeasure.h"
#include "PerformanceObserver.h"
#include "PerformanceResourceTiming.h"
+#include "PerformanceService.h"
#include "PerformanceWorker.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/PerformanceBinding.h"
@@ -119,6 +120,17 @@ Performance::Performance(nsPIDOMWindowInner* aWindow)
Performance::~Performance()
{}
+DOMHighResTimeStamp
+Performance::TimeOrigin()
+{
+ if (!mPerformanceService) {
+ mPerformanceService = PerformanceService::GetOrCreate();
+ }
+
+ MOZ_ASSERT(mPerformanceService);
+ return mPerformanceService->TimeOrigin(CreationTimeStamp());
+}
+
JSObject*
Performance::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
{
@@ -243,7 +255,7 @@ Performance::ClearMarks(const Optional<nsAString>& aName)
DOMHighResTimeStamp
Performance::ResolveTimestampFromName(const nsAString& aName,
- ErrorResult& aRv)
+ ErrorResult& aRv)
{
AutoTArray<RefPtr<PerformanceEntry>, 1> arr;
DOMHighResTimeStamp ts;