EntryList.cpp (829B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=2 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "EntryList.h" 8 9 #include "nsIWeakReferenceUtils.h" 10 #include "nsSHistory.h" 11 12 namespace mozilla::dom { 13 14 EntryList::EntryList(nsSHistory* aSessionHistory, const nsID& aHistoryID) 15 : mSessionHistory(do_GetWeakReference(aSessionHistory)), 16 mHistoryID(aHistoryID) {} 17 18 EntryList::~EntryList() { 19 clear(); 20 if (nsCOMPtr<nsISHistory> shistory = do_QueryReferent(mSessionHistory)) { 21 static_cast<nsSHistory*>(shistory.get())->RemoveEntryList(mHistoryID); 22 } 23 } 24 25 } // namespace mozilla::dom