diff options
author | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 12:07:20 +0200 |
---|---|---|
committer | janekptacijarabaci <janekptacijarabaci@seznam.cz> | 2018-04-29 12:07:20 +0200 |
commit | 7ee501103ad2efe1d28ef3c10b4111a685746c06 (patch) | |
tree | 11a8b24d352d2a457b6c3a060c2c3d338391093c | |
parent | de9560af3e0e0d0dc93c5401c9b6ca2f0a173e36 (diff) | |
download | UXP-7ee501103ad2efe1d28ef3c10b4111a685746c06.tar UXP-7ee501103ad2efe1d28ef3c10b4111a685746c06.tar.gz UXP-7ee501103ad2efe1d28ef3c10b4111a685746c06.tar.lz UXP-7ee501103ad2efe1d28ef3c10b4111a685746c06.tar.xz UXP-7ee501103ad2efe1d28ef3c10b4111a685746c06.zip |
Bug 1322966 - Cleanup performance.cpp
https://hg.mozilla.org/mozilla-central/rev/0ad76084c4c3
-rw-r--r-- | dom/base/nsGlobalWindow.cpp | 20 | ||||
-rwxr-xr-x | dom/performance/Performance.cpp | 6 | ||||
-rw-r--r-- | dom/performance/Performance.h | 5 | ||||
-rw-r--r-- | dom/performance/PerformanceMainThread.cpp | 10 | ||||
-rw-r--r-- | dom/performance/PerformanceMainThread.h | 9 | ||||
-rw-r--r-- | dom/performance/PerformanceWorker.h | 6 |
6 files changed, 9 insertions, 47 deletions
diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 3d5c44a78..738703ef1 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -3124,8 +3124,7 @@ nsGlobalWindow::SetNewDocument(nsIDocument* aDocument, newInnerWindow->mPerformance = Performance::CreateForMainThread(newInnerWindow->AsInner(), currentInner->mPerformance->GetDOMTiming(), - currentInner->mPerformance->GetChannel(), - currentInner->mPerformance->GetParentPerformance()); + currentInner->mPerformance->GetChannel()); } } @@ -4339,22 +4338,7 @@ nsPIDOMWindowInner::CreatePerformanceObjectIfNeeded() timedChannel = nullptr; } if (timing) { - // If we are dealing with an iframe, we will need the parent's performance - // object (so we can add the iframe as a resource of that page). - Performance* parentPerformance = nullptr; - nsCOMPtr<nsPIDOMWindowOuter> parentWindow = GetScriptableParentOrNull(); - if (parentWindow) { - nsPIDOMWindowInner* parentInnerWindow = nullptr; - if (parentWindow) { - parentInnerWindow = parentWindow->GetCurrentInnerWindow(); - } - if (parentInnerWindow) { - parentPerformance = parentInnerWindow->GetPerformance(); - } - } - mPerformance = - Performance::CreateForMainThread(this, timing, timedChannel, - parentPerformance); + mPerformance = Performance::CreateForMainThread(this, timing, timedChannel); } } diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 497bdea27..074bffe8a 100755 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -82,14 +82,12 @@ NS_IMPL_RELEASE_INHERITED(Performance, DOMEventTargetHelper) /* static */ already_AddRefed<Performance> Performance::CreateForMainThread(nsPIDOMWindowInner* aWindow, nsDOMNavigationTiming* aDOMTiming, - nsITimedChannel* aChannel, - Performance* aParentPerformance) + nsITimedChannel* aChannel) { MOZ_ASSERT(NS_IsMainThread()); RefPtr<Performance> performance = - new PerformanceMainThread(aWindow, aDOMTiming, aChannel, - aParentPerformance); + new PerformanceMainThread(aWindow, aDOMTiming, aChannel); return performance.forget(); } diff --git a/dom/performance/Performance.h b/dom/performance/Performance.h index bc70589a5..6a374c7f0 100644 --- a/dom/performance/Performance.h +++ b/dom/performance/Performance.h @@ -45,8 +45,7 @@ public: static already_AddRefed<Performance> CreateForMainThread(nsPIDOMWindowInner* aWindow, nsDOMNavigationTiming* aDOMTiming, - nsITimedChannel* aChannel, - Performance* aParentPerformance); + nsITimedChannel* aChannel); static already_AddRefed<Performance> CreateForWorker(workers::WorkerPrivate* aWorkerPrivate); @@ -101,8 +100,6 @@ public: virtual nsITimedChannel* GetChannel() const = 0; - virtual Performance* GetParentPerformance() const = 0; - protected: Performance(); explicit Performance(nsPIDOMWindowInner* aWindow); diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp index fa03408c6..d67c0c906 100644 --- a/dom/performance/PerformanceMainThread.cpp +++ b/dom/performance/PerformanceMainThread.cpp @@ -16,8 +16,7 @@ NS_IMPL_CYCLE_COLLECTION_CLASS(PerformanceMainThread) NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PerformanceMainThread, Performance) NS_IMPL_CYCLE_COLLECTION_UNLINK(mTiming, - mNavigation, - mParentPerformance) + mNavigation) tmp->mMozMemory = nullptr; mozilla::DropJSObjects(this); NS_IMPL_CYCLE_COLLECTION_UNLINK_END @@ -25,8 +24,7 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PerformanceMainThread, Performance) NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mTiming, - mNavigation, - mParentPerformance) + mNavigation) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END @@ -46,12 +44,10 @@ NS_INTERFACE_MAP_END_INHERITING(Performance) PerformanceMainThread::PerformanceMainThread(nsPIDOMWindowInner* aWindow, nsDOMNavigationTiming* aDOMTiming, - nsITimedChannel* aChannel, - Performance* aParentPerformance) + nsITimedChannel* aChannel) : Performance(aWindow) , mDOMTiming(aDOMTiming) , mChannel(aChannel) - , mParentPerformance(aParentPerformance) { MOZ_ASSERT(aWindow, "Parent window object should be provided"); } diff --git a/dom/performance/PerformanceMainThread.h b/dom/performance/PerformanceMainThread.h index 84773f29b..fcaa6b903 100644 --- a/dom/performance/PerformanceMainThread.h +++ b/dom/performance/PerformanceMainThread.h @@ -17,8 +17,7 @@ class PerformanceMainThread final : public Performance public: PerformanceMainThread(nsPIDOMWindowInner* aWindow, nsDOMNavigationTiming* aDOMTiming, - nsITimedChannel* aChannel, - Performance* aParentPerformance); + nsITimedChannel* aChannel); NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(PerformanceMainThread, @@ -51,11 +50,6 @@ public: return mChannel; } - virtual Performance* GetParentPerformance() const override - { - return mParentPerformance; - } - protected: ~PerformanceMainThread(); @@ -77,7 +71,6 @@ protected: nsCOMPtr<nsITimedChannel> mChannel; RefPtr<PerformanceTiming> mTiming; RefPtr<PerformanceNavigation> mNavigation; - RefPtr<Performance> mParentPerformance; JS::Heap<JSObject*> mMozMemory; }; diff --git a/dom/performance/PerformanceWorker.h b/dom/performance/PerformanceWorker.h index 7eef0d974..d8635e98a 100644 --- a/dom/performance/PerformanceWorker.h +++ b/dom/performance/PerformanceWorker.h @@ -64,12 +64,6 @@ public: return nullptr; } - virtual Performance* GetParentPerformance() const override - { - MOZ_CRASH("This should not be called on workers."); - return nullptr; - } - protected: ~PerformanceWorker(); |