| 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);
|
| +}
|
| +
|
| }
|
|
|