From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/loader/archive/Archive.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'Source/WebCore/loader/archive/Archive.cpp') diff --git a/Source/WebCore/loader/archive/Archive.cpp b/Source/WebCore/loader/archive/Archive.cpp index 86d7558e1..5e05be22c 100644 --- a/Source/WebCore/loader/archive/Archive.cpp +++ b/Source/WebCore/loader/archive/Archive.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008-2017 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * 3. Neither the name of Apple Inc. ("Apple") nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -37,17 +37,17 @@ Archive::~Archive() void Archive::clearAllSubframeArchives() { - Vector> clearedArchives; - clearAllSubframeArchivesImpl(&clearedArchives); + HashSet clearedArchives; + clearedArchives.add(this); + clearAllSubframeArchives(clearedArchives); } -void Archive::clearAllSubframeArchivesImpl(Vector>* clearedArchives) +void Archive::clearAllSubframeArchives(HashSet& clearedArchives) { - for (Vector>::iterator it = m_subframeArchives.begin(); it != m_subframeArchives.end(); ++it) { - if (!clearedArchives->contains(*it)) { - clearedArchives->append(*it); - (*it)->clearAllSubframeArchivesImpl(clearedArchives); - } + ASSERT(clearedArchives.contains(this)); + for (auto& archive : m_subframeArchives) { + if (clearedArchives.add(archive.ptr())) + archive->clearAllSubframeArchives(clearedArchives); } m_subframeArchives.clear(); } -- cgit v1.2.1