Bug 1278835 - Renaming nsPerformanceNavigation to mozilla::dom::PerformanceNavigation, r=smaug

This commit is contained in:
Andrea Marchesini 2016-06-09 12:43:02 +02:00
Родитель c1ff80c475
Коммит e7022433c4
4 изменённых файлов: 29 добавлений и 33 удалений

Просмотреть файл

@ -17,17 +17,6 @@ typedef unsigned long long DOMTimeMilliSec;
typedef double DOMHighResTimeStamp;
typedef unsigned short nsDOMPerformanceNavigationType;
namespace mozilla {
namespace dom {
namespace PerformanceNavigation {
static const nsDOMPerformanceNavigationType TYPE_NAVIGATE = 0;
static const nsDOMPerformanceNavigationType TYPE_RELOAD = 1;
static const nsDOMPerformanceNavigationType TYPE_BACK_FORWARD = 2;
static const nsDOMPerformanceNavigationType TYPE_RESERVED = 255;
} // namespace PerformanceNavigation
} // namespace dom
} // namespace mozilla
class nsDOMNavigationTiming final
{
public:

Просмотреть файл

@ -899,7 +899,6 @@ DOMInterfaces = {
},
'PerformanceNavigation': {
'nativeType': 'nsPerformanceNavigation',
'headerFile': 'nsPerformance.h'
},

Просмотреть файл

@ -392,23 +392,23 @@ PerformanceTiming::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
}
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsPerformanceNavigation, mPerformance)
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PerformanceNavigation, mPerformance)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsPerformanceNavigation, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsPerformanceNavigation, Release)
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PerformanceNavigation, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PerformanceNavigation, Release)
nsPerformanceNavigation::nsPerformanceNavigation(nsPerformance* aPerformance)
PerformanceNavigation::PerformanceNavigation(nsPerformance* aPerformance)
: mPerformance(aPerformance)
{
MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
}
nsPerformanceNavigation::~nsPerformanceNavigation()
PerformanceNavigation::~PerformanceNavigation()
{
}
JSObject*
nsPerformanceNavigation::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
PerformanceNavigation::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
{
return PerformanceNavigationBinding::Wrap(cx, this, aGivenProto);
}
@ -498,11 +498,11 @@ nsPerformance::DispatchBufferFullEvent()
DispatchDOMEvent(nullptr, event, nullptr, nullptr);
}
nsPerformanceNavigation*
PerformanceNavigation*
nsPerformance::Navigation()
{
if (!mNavigation) {
mNavigation = new nsPerformanceNavigation(this);
mNavigation = new PerformanceNavigation(this);
}
return mNavigation;
}

Просмотреть файл

@ -257,19 +257,24 @@ private:
bool mReportCrossOriginRedirect;
};
} // namespace dom
} // namespace mozilla
// Script "performance.navigation" object
class nsPerformanceNavigation final : public nsWrapperCache
class PerformanceNavigation final : public nsWrapperCache
{
public:
explicit nsPerformanceNavigation(nsPerformance* aPerformance);
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsPerformanceNavigation)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsPerformanceNavigation)
enum PerformanceNavigationType {
TYPE_NAVIGATE = 0,
TYPE_RELOAD = 1,
TYPE_BACK_FORWARD = 2,
TYPE_RESERVED = 255,
};
explicit PerformanceNavigation(nsPerformance* aPerformance);
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(PerformanceNavigation)
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(PerformanceNavigation)
nsDOMNavigationTiming* GetDOMTiming() const;
mozilla::dom::PerformanceTiming* GetPerformanceTiming() const;
PerformanceTiming* GetPerformanceTiming() const;
nsPerformance* GetParentObject() const
{
@ -287,10 +292,13 @@ public:
}
private:
~nsPerformanceNavigation();
~PerformanceNavigation();
RefPtr<nsPerformance> mPerformance;
};
} // namespace dom
} // namespace mozilla
// Base class for main-thread and worker Performance API
class PerformanceBase : public mozilla::DOMEventTargetHelper
{
@ -418,7 +426,7 @@ public:
DOMHighResTimeStamp Now() const override;
mozilla::dom::PerformanceTiming* Timing();
nsPerformanceNavigation* Navigation();
mozilla::dom::PerformanceNavigation* Navigation();
void AddEntry(nsIHttpChannel* channel,
nsITimedChannel* timedChannel);
@ -462,19 +470,19 @@ protected:
RefPtr<nsDOMNavigationTiming> mDOMTiming;
nsCOMPtr<nsITimedChannel> mChannel;
RefPtr<mozilla::dom::PerformanceTiming> mTiming;
RefPtr<nsPerformanceNavigation> mNavigation;
RefPtr<mozilla::dom::PerformanceNavigation> mNavigation;
RefPtr<nsPerformance> mParentPerformance;
JS::Heap<JSObject*> mMozMemory;
};
inline nsDOMNavigationTiming*
nsPerformanceNavigation::GetDOMTiming() const
mozilla::dom::PerformanceNavigation::GetDOMTiming() const
{
return mPerformance->GetDOMTiming();
}
inline mozilla::dom::PerformanceTiming*
nsPerformanceNavigation::GetPerformanceTiming() const
mozilla::dom::PerformanceNavigation::GetPerformanceTiming() const
{
return mPerformance->Timing();
}