Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1700)

Unified Diff: Source/platform/mhtml/ArchiveResourceCollection.cpp

Issue 374053002: Oilpan: move MHTML objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Make MHTMLArchive.h self-contained/closed. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/mhtml/ArchiveResourceCollection.h ('k') | Source/platform/mhtml/MHTMLArchive.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/mhtml/ArchiveResourceCollection.cpp
diff --git a/Source/platform/mhtml/ArchiveResourceCollection.cpp b/Source/platform/mhtml/ArchiveResourceCollection.cpp
index de133e87cd68668c1510fc8b2096f9edca323129..709b08c65d58fbe1d714886d61f2c234b65f022f 100644
--- a/Source/platform/mhtml/ArchiveResourceCollection.cpp
+++ b/Source/platform/mhtml/ArchiveResourceCollection.cpp
@@ -29,6 +29,8 @@
#include "config.h"
#include "platform/mhtml/ArchiveResourceCollection.h"
+#include "platform/mhtml/ArchiveResource.h"
+#include "platform/mhtml/MHTMLArchive.h"
#include "platform/weborigin/KURL.h"
namespace WebCore {
@@ -37,19 +39,23 @@ ArchiveResourceCollection::ArchiveResourceCollection()
{
}
+ArchiveResourceCollection::~ArchiveResourceCollection()
+{
+}
+
void ArchiveResourceCollection::addAllResources(MHTMLArchive* archive)
{
ASSERT(archive);
if (!archive)
return;
- const Vector<RefPtr<ArchiveResource> >& subresources = archive->subresources();
- for (Vector<RefPtr<ArchiveResource> >::const_iterator iterator = subresources.begin(); iterator != subresources.end(); ++iterator)
+ const MHTMLArchive::SubArchiveResources& subresources = archive->subresources();
+ for (MHTMLArchive::SubArchiveResources::const_iterator iterator = subresources.begin(); iterator != subresources.end(); ++iterator)
m_subresources.set((*iterator)->url(), iterator->get());
- const Vector<RefPtr<MHTMLArchive> >& subframes = archive->subframeArchives();
- for (Vector<RefPtr<MHTMLArchive> >::const_iterator iterator = subframes.begin(); iterator != subframes.end(); ++iterator) {
- RefPtr<MHTMLArchive> archive = *iterator;
+ const MHTMLArchive::SubFrameArchives& subframes = archive->subframeArchives();
+ for (MHTMLArchive::SubFrameArchives::const_iterator iterator = subframes.begin(); iterator != subframes.end(); ++iterator) {
+ RefPtrWillBeRawPtr<MHTMLArchive> archive = *iterator;
ASSERT(archive->mainResource());
const String& frameName = archive->mainResource()->frameName();
@@ -64,7 +70,7 @@ void ArchiveResourceCollection::addAllResources(MHTMLArchive* archive)
// FIXME: Adding a resource directly to a DocumentLoader/ArchiveResourceCollection seems like bad design, but is API some apps rely on.
// Can we change the design in a manner that will let us deprecate that API without reducing functionality of those apps?
-void ArchiveResourceCollection::addResource(PassRefPtr<ArchiveResource> resource)
+void ArchiveResourceCollection::addResource(PassRefPtrWillBeRawPtr<ArchiveResource> resource)
{
ASSERT(resource);
if (!resource)
@@ -83,13 +89,19 @@ ArchiveResource* ArchiveResourceCollection::archiveResourceForURL(const KURL& ur
return resource;
}
-PassRefPtr<MHTMLArchive> ArchiveResourceCollection::popSubframeArchive(const String& frameName, const KURL& url)
+PassRefPtrWillBeRawPtr<MHTMLArchive> ArchiveResourceCollection::popSubframeArchive(const String& frameName, const KURL& url)
{
- RefPtr<MHTMLArchive> archive = m_subframes.take(frameName);
+ RefPtrWillBeRawPtr<MHTMLArchive> archive = m_subframes.take(frameName);
if (archive)
return archive.release();
return m_subframes.take(url.string());
}
+void ArchiveResourceCollection::trace(Visitor* visitor)
+{
+ visitor->trace(m_subresources);
+ visitor->trace(m_subframes);
+}
+
}
« no previous file with comments | « Source/platform/mhtml/ArchiveResourceCollection.h ('k') | Source/platform/mhtml/MHTMLArchive.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698