summaryrefslogtreecommitdiff
path: root/Source/WebCore/loader/archive/Archive.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/loader/archive/Archive.cpp')
-rw-r--r--Source/WebCore/loader/archive/Archive.cpp20
1 files changed, 10 insertions, 10 deletions
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<RefPtr<Archive>> clearedArchives;
- clearAllSubframeArchivesImpl(&clearedArchives);
+ HashSet<Archive*> clearedArchives;
+ clearedArchives.add(this);
+ clearAllSubframeArchives(clearedArchives);
}
-void Archive::clearAllSubframeArchivesImpl(Vector<RefPtr<Archive>>* clearedArchives)
+void Archive::clearAllSubframeArchives(HashSet<Archive*>& clearedArchives)
{
- for (Vector<RefPtr<Archive>>::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();
}