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

Unified Diff: Source/core/testing/InternalSettings.cpp

Issue 255983003: Oilpan: Move all supplements of Page, Document, and WorkerClients to the managed heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: using namespace WebCore Created 6 years, 8 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/core/testing/InternalSettings.h ('k') | Source/core/workers/WorkerClients.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/testing/InternalSettings.cpp
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index eb67522da8a943360ee1faaec04647b0b8187174..1f29cca8eb2f9388260a807ae7220c66f7d1082a 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -100,6 +100,14 @@ void InternalSettings::Backup::restoreTo(Settings* settings)
settings->genericFontFamilySettings().reset();
}
+#if ENABLE(OILPAN)
+InternalSettings* InternalSettings::from(Page& page)
+{
+ if (!HeapSupplement<Page>::from(page, supplementName()))
+ HeapSupplement<Page>::provideTo(page, supplementName(), new InternalSettings(page));
+ return static_cast<InternalSettings*>(HeapSupplement<Page>::from(page, supplementName()));
+}
+#else
// We can't use RefCountedSupplement because that would try to make InternalSettings RefCounted
// and InternalSettings is already RefCounted via its base class, InternalSettingsGenerated.
// Instead, we manually make InternalSettings supplement Page.
@@ -116,20 +124,21 @@ public:
virtual void trace(Visitor*) OVERRIDE { }
private:
- RefPtrWillBePersistent<InternalSettings> m_internalSettings;
+ RefPtr<InternalSettings> m_internalSettings;
};
-const char* InternalSettings::supplementName()
-{
- return "InternalSettings";
-}
-
InternalSettings* InternalSettings::from(Page& page)
{
if (!Supplement<Page>::from(page, supplementName()))
Supplement<Page>::provideTo(page, supplementName(), adoptPtr(new InternalSettingsWrapper(page)));
return static_cast<InternalSettingsWrapper*>(Supplement<Page>::from(page, supplementName()))->internalSettings();
}
+#endif
+
+const char* InternalSettings::supplementName()
+{
+ return "InternalSettings";
+}
InternalSettings::~InternalSettings()
{
@@ -346,4 +355,10 @@ void InternalSettings::setPasswordGenerationDecorationEnabled(bool enabled, Exce
settings()->setPasswordGenerationDecorationEnabled(enabled);
}
+void InternalSettings::trace(Visitor* visitor)
+{
+ visitor->trace(m_page);
+ InternalSettingsGenerated::trace(visitor);
+}
+
}
« no previous file with comments | « Source/core/testing/InternalSettings.h ('k') | Source/core/workers/WorkerClients.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698