Bug 1377131 - Try to trigger collector slices at times which disturb page js less (at least with iframes loaded after the top level page has been loaded), r=mccr8,bz
When triggering an iframe load or starting to parse a document for an iframe, the main thread may often have some time before the new page has been created. Try to trigger CC/GC slice at such point in order to avoid collector later when page is already executing its JS
This commit is contained in:
@@ -222,6 +222,7 @@
|
||||
#include "mozilla/dom/PerformanceNavigation.h"
|
||||
#include "mozilla/dom/ScriptSettings.h"
|
||||
#include "mozilla/Encoding.h"
|
||||
#include "nsJSEnvironment.h"
|
||||
#include "IUrlClassifierUITelemetry.h"
|
||||
|
||||
#ifdef MOZ_TOOLKIT_SEARCH
|
||||
@@ -11704,6 +11705,11 @@ nsDocShell::DoChannelLoad(nsIChannel* aChannel,
|
||||
rv = aURILoader->OpenURI(aChannel, openFlags, this);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// We're about to load a new page and it may take time before necko
|
||||
// gives back any data, so main thread might have a chance to process a
|
||||
// collector slice
|
||||
nsJSContext::MaybeRunNextCollectorSlice(this, JS::gcreason::DOCSHELL);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user