Bug 1301301, part 3 - Implement Begin and EndCycleCollectionCallback in CCJSContext. r=smaug

This will let my later patch run code at the start and end of each CC.

This patch should not change any behavior.

MozReview-Commit-ID: Fu6v3wo8qKB
This commit is contained in:
Andrew McCreight
2016-09-26 10:19:07 -07:00
parent 94192c0ea5
commit c6500f50f1
4 changed files with 14 additions and 12 deletions

View File

@@ -1099,16 +1099,6 @@ public:
{
}
virtual void
BeginCycleCollectionCallback() override
{
}
virtual void
EndCycleCollectionCallback(CycleCollectorResults &aResults) override
{
}
void
DispatchDeferredDeletion(bool aContinuation, bool aPurge) override
{

View File

@@ -665,6 +665,7 @@ XPCJSContext::PrepareForForgetSkippable()
void
XPCJSContext::BeginCycleCollectionCallback()
{
CycleCollectedJSContext::BeginCycleCollectionCallback();
nsJSContext::BeginCycleCollectionCallback();
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
@@ -676,6 +677,7 @@ XPCJSContext::BeginCycleCollectionCallback()
void
XPCJSContext::EndCycleCollectionCallback(CycleCollectorResults& aResults)
{
CycleCollectedJSContext::EndCycleCollectionCallback(aResults);
nsJSContext::EndCycleCollectionCallback(aResults);
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();

View File

@@ -1330,6 +1330,16 @@ CycleCollectedJSContext::DumpJSHeap(FILE* aFile)
js::DumpHeap(Context(), aFile, js::CollectNurseryBeforeDump);
}
void
CycleCollectedJSContext::BeginCycleCollectionCallback()
{
}
void
CycleCollectedJSContext::EndCycleCollectionCallback(CycleCollectorResults& aResults)
{
}
void
CycleCollectedJSContext::ProcessStableStateQueue()
{

View File

@@ -321,8 +321,8 @@ public:
void DumpJSHeap(FILE* aFile);
virtual void PrepareForForgetSkippable() = 0;
virtual void BeginCycleCollectionCallback() = 0;
virtual void EndCycleCollectionCallback(CycleCollectorResults& aResults) = 0;
virtual void BeginCycleCollectionCallback();
virtual void EndCycleCollectionCallback(CycleCollectorResults& aResults);
virtual void DispatchDeferredDeletion(bool aContinuation, bool aPurge = false) = 0;
JSContext* Context() const