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

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

Issue 1851743002: Simplify Supplementables post Oilpan. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix component build Created 4 years, 9 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 | « third_party/WebKit/Source/core/page/Page.cpp ('k') | third_party/WebKit/Source/core/workers/SharedWorker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/testing/InternalSettings.cpp
diff --git a/third_party/WebKit/Source/core/testing/InternalSettings.cpp b/third_party/WebKit/Source/core/testing/InternalSettings.cpp
index 69012c4d41e2f2a5cc1f3a5ea6a352eb29c07bb7..aae34cf7655fc57a15309cbab84eb95dea4b4fa3 100644
--- a/third_party/WebKit/Source/core/testing/InternalSettings.cpp
+++ b/third_party/WebKit/Source/core/testing/InternalSettings.cpp
@@ -100,39 +100,12 @@ void InternalSettings::Backup::restoreTo(Settings* settings)
RuntimeEnabledFeatures::setCompositorWorkerEnabled(m_originalCompositorWorkerEnabled);
}
-#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.
-class InternalSettingsWrapper : public Supplement<Page> {
-public:
- explicit InternalSettingsWrapper(Page& page)
- : m_internalSettings(InternalSettings::create(page)) { }
- virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); }
-#if ENABLE(ASSERT)
- bool isRefCountedWrapper() const override { return true; }
-#endif
- InternalSettings* internalSettings() const { return m_internalSettings.get(); }
-
-private:
- RefPtr<InternalSettings> m_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";
@@ -356,9 +329,7 @@ DEFINE_TRACE(InternalSettings)
{
visitor->trace(m_page);
InternalSettingsGenerated::trace(visitor);
-#if ENABLE(OILPAN)
- HeapSupplement<Page>::trace(visitor);
-#endif
+ Supplement<Page>::trace(visitor);
}
void InternalSettings::setAvailablePointerTypes(const String& pointers, ExceptionState& exceptionState)
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.cpp ('k') | third_party/WebKit/Source/core/workers/SharedWorker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698