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

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

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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
Index: Source/core/testing/InternalSettings.cpp
diff --git a/Source/core/testing/InternalSettings.cpp b/Source/core/testing/InternalSettings.cpp
index 12b39530c7ee179e4b5d3ce4e9919bbd2239410b..2bbe6814b1afbd64e96a4cfae480fa2af866d274 100644
--- a/Source/core/testing/InternalSettings.cpp
+++ b/Source/core/testing/InternalSettings.cpp
@@ -113,7 +113,7 @@ void InternalSettings::Backup::restoreTo(Settings* settings)
// Instead, we manually make InternalSettings supplement Page.
class InternalSettingsWrapper : public Supplement<Page> {
public:
- explicit InternalSettingsWrapper(Page* page)
+ explicit InternalSettingsWrapper(Page& page)
: m_internalSettings(InternalSettings::create(page)) { }
virtual ~InternalSettingsWrapper() { m_internalSettings->hostDestroyed(); }
#if !ASSERT_DISABLED
@@ -130,7 +130,7 @@ const char* InternalSettings::supplementName()
return "InternalSettings";
}
-InternalSettings* InternalSettings::from(Page* page)
+InternalSettings* InternalSettings::from(Page& page)
{
if (!Supplement<Page>::from(page, supplementName()))
Supplement<Page>::provideTo(page, supplementName(), adoptPtr(new InternalSettingsWrapper(page)));
@@ -141,10 +141,10 @@ InternalSettings::~InternalSettings()
{
}
-InternalSettings::InternalSettings(Page* page)
- : InternalSettingsGenerated(page)
- , m_page(page)
- , m_backup(&page->settings())
+InternalSettings::InternalSettings(Page& page)
+ : InternalSettingsGenerated(&page)
+ , m_page(&page)
+ , m_backup(&page.settings())
{
}

Powered by Google App Engine
This is Rietveld 408576698