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

Unified Diff: Source/platform/mhtml/MHTMLArchive.h

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.cpp ('k') | Source/platform/mhtml/MHTMLArchive.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/mhtml/MHTMLArchive.h
diff --git a/Source/platform/mhtml/MHTMLArchive.h b/Source/platform/mhtml/MHTMLArchive.h
index 7a6282101472bb85e29b27110f6f51807a5b81a6..2573f151b506dc8f8b6b20cb3b1512aab9deb70a 100644
--- a/Source/platform/mhtml/MHTMLArchive.h
+++ b/Source/platform/mhtml/MHTMLArchive.h
@@ -31,7 +31,7 @@
#ifndef MHTMLArchive_h
#define MHTMLArchive_h
-#include "platform/mhtml/ArchiveResource.h"
+#include "platform/heap/Handle.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
@@ -39,16 +39,18 @@
namespace WebCore {
+class ArchiveResource;
class KURL;
class MHTMLParser;
class SharedBuffer;
struct SerializedResource;
-class PLATFORM_EXPORT MHTMLArchive FINAL : public RefCounted<MHTMLArchive> {
+class PLATFORM_EXPORT MHTMLArchive FINAL : public RefCountedWillBeGarbageCollectedFinalized<MHTMLArchive> {
public:
- static PassRefPtr<MHTMLArchive> create();
- static PassRefPtr<MHTMLArchive> create(const KURL&, SharedBuffer*);
+ static PassRefPtrWillBeRawPtr<MHTMLArchive> create();
+ static PassRefPtrWillBeRawPtr<MHTMLArchive> create(const KURL&, SharedBuffer*);
+ ~MHTMLArchive();
enum EncodingPolicy {
UseDefaultEncoding,
@@ -58,25 +60,31 @@ public:
// Binary encoding results in smaller MHTML files but they might not work in other browsers.
static PassRefPtr<SharedBuffer> generateMHTMLData(const Vector<SerializedResource>&, EncodingPolicy, const String& title, const String& mimeType);
- ~MHTMLArchive();
+ typedef WillBeHeapVector<RefPtrWillBeMember<ArchiveResource> > SubArchiveResources;
+ typedef WillBeHeapVector<RefPtrWillBeMember<MHTMLArchive> > SubFrameArchives;
+
ArchiveResource* mainResource() { return m_mainResource.get(); }
- const Vector<RefPtr<ArchiveResource> >& subresources() const { return m_subresources; }
- const Vector<RefPtr<MHTMLArchive> >& subframeArchives() const { return m_subframeArchives; }
+ const SubArchiveResources& subresources() const { return m_subresources; }
+ const SubFrameArchives& subframeArchives() const { return m_subframeArchives; }
+
+ void trace(Visitor*);
private:
friend class MHTMLParser;
MHTMLArchive();
- void setMainResource(PassRefPtr<ArchiveResource> mainResource) { m_mainResource = mainResource; }
- void addSubresource(PassRefPtr<ArchiveResource> subResource) { m_subresources.append(subResource); }
- void addSubframeArchive(PassRefPtr<MHTMLArchive> subframeArchive) { m_subframeArchives.append(subframeArchive); }
+ void setMainResource(PassRefPtrWillBeRawPtr<ArchiveResource>);
+ void addSubresource(PassRefPtrWillBeRawPtr<ArchiveResource>);
+ void addSubframeArchive(PassRefPtrWillBeRawPtr<MHTMLArchive>);
+#if !ENABLE(OILPAN)
void clearAllSubframeArchives();
- void clearAllSubframeArchivesImpl(Vector<RefPtr<MHTMLArchive> >* clearedArchives);
+ void clearAllSubframeArchivesImpl(SubFrameArchives* clearedArchives);
+#endif
- RefPtr<ArchiveResource> m_mainResource;
- Vector<RefPtr<ArchiveResource> > m_subresources;
- Vector<RefPtr<MHTMLArchive> > m_subframeArchives;
+ RefPtrWillBeMember<ArchiveResource> m_mainResource;
+ SubArchiveResources m_subresources;
+ SubFrameArchives m_subframeArchives;
};
}
« no previous file with comments | « Source/platform/mhtml/ArchiveResourceCollection.cpp ('k') | Source/platform/mhtml/MHTMLArchive.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698