mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Bug 1159003 - setResourceTimingBufferSize shouldn't affect user timing, but we should clean user markers if we have memory pressure, r=bz
This commit is contained in:
parent
6beccbf6ce
commit
bc3eb89dee
5 changed files with 40 additions and 17 deletions
|
|
@ -262,11 +262,6 @@ already_AddRefed<PerformanceMark> Performance::Mark(
|
|||
const PerformanceMarkOptions& aMarkOptions,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
// Don't add the entry if the buffer is full. XXX should be removed by bug 1159003.
|
||||
if (mUserEntries.Length() >= mResourceTimingBufferSize) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIGlobalObject> parent = GetParentObject();
|
||||
if (!parent || parent->IsDying() || !parent->GetGlobalJSObject()) {
|
||||
aRv.Throw(NS_ERROR_DOM_UT_UNAVAILABLE_GLOBAL_OBJECT);
|
||||
|
|
@ -490,12 +485,6 @@ Performance::Measure(JSContext* aCx,
|
|||
const Optional<nsAString>& aEndMark,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
// Don't add the entry if the buffer is full. XXX should be removed by bug
|
||||
// 1159003.
|
||||
if (mUserEntries.Length() >= mResourceTimingBufferSize) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const PerformanceMeasureOptions* options = nullptr;
|
||||
if (aStartOrMeasureOptions.IsPerformanceMeasureOptions()) {
|
||||
options = &aStartOrMeasureOptions.GetAsPerformanceMeasureOptions();
|
||||
|
|
@ -753,5 +742,11 @@ Performance::IsObserverEnabled(JSContext* aCx, JSObject* aGlobal)
|
|||
return runnable->Dispatch() && runnable->IsEnabled();
|
||||
}
|
||||
|
||||
void
|
||||
Performance::MemoryPressure()
|
||||
{
|
||||
mUserEntries.Clear();
|
||||
}
|
||||
|
||||
} // dom namespace
|
||||
} // mozilla namespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue