diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 12:15:36 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 12:15:36 +0200 |
commit | 98438fa32e4f93b59359662188e164c7c828acb7 (patch) | |
tree | a32206dd3595d6e412029395ea55e3bf8438e1f5 /dom/performance/Performance.cpp | |
parent | 39d4a11267fd707df04bb06a74e24f36e2dbcd28 (diff) | |
download | UXP-98438fa32e4f93b59359662188e164c7c828acb7.tar UXP-98438fa32e4f93b59359662188e164c7c828acb7.tar.gz UXP-98438fa32e4f93b59359662188e164c7c828acb7.tar.lz UXP-98438fa32e4f93b59359662188e164c7c828acb7.tar.xz UXP-98438fa32e4f93b59359662188e164c7c828acb7.zip |
Bug 1313420 - Implement Performance.timeOrigin - part 1
https://hg.mozilla.org/mozilla-central/rev/cf0f72f0b0be
Diffstat (limited to 'dom/performance/Performance.cpp')
-rwxr-xr-x | dom/performance/Performance.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 074bffe8a..d1547dc06 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; |