Commit a75b9554 authored by Olli Pettay's avatar Olli Pettay
Browse files

Bug 1421607 - Do black marking of bfcache documents during GC, r=mystor

--HG--
extra : rebase_source : 395dddb461c065b780aeead12150c0feff550d5d
parent 4ce4e295
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -509,11 +509,21 @@ mozilla::dom::TraceBlackJS(JSTracer* aTrc, bool aIsShutdownGC)
    for (auto iter = windowsById->Iter(); !iter.Done(); iter.Next()) {
      nsGlobalWindowOuter* window = iter.Data();
      if (!window->IsCleanedUp()) {
        window->TraceGlobalJSObject(aTrc);
        EventListenerManager* elm = window->GetExistingListenerManager();
        nsGlobalWindowInner* inner = nullptr;
        for (PRCList* win = PR_LIST_HEAD(window);
             win != window;
             win = PR_NEXT_LINK(inner)) {
          inner = static_cast<nsGlobalWindowInner*>(win);
          if (inner->IsCurrentInnerWindow() ||
              (inner->GetExtantDoc() &&
               inner->GetExtantDoc()->GetBFCacheEntry())) {
            inner->TraceGlobalJSObject(aTrc);
            EventListenerManager* elm = inner->GetExistingListenerManager();
            if (elm) {
              elm->TraceListeners(aTrc);
            }
          }
        }

        if (window->IsRootOuterWindow()) {
          // In child process trace all the TabChildGlobals.