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

Unified Diff: Source/modules/quota/NavigatorStorageQuota.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/modules/quota/NavigatorStorageQuota.cpp
diff --git a/Source/modules/quota/NavigatorStorageQuota.cpp b/Source/modules/quota/NavigatorStorageQuota.cpp
index 42629aaf566352760db40c0551648e368dc5e6eb..20e8eb97da1d68ec7d49b6a66a8531ec2bfe73cd 100644
--- a/Source/modules/quota/NavigatorStorageQuota.cpp
+++ b/Source/modules/quota/NavigatorStorageQuota.cpp
@@ -51,29 +51,29 @@ const char* NavigatorStorageQuota::supplementName()
return "NavigatorStorageQuota";
}
-NavigatorStorageQuota* NavigatorStorageQuota::from(Navigator* navigator)
+NavigatorStorageQuota& NavigatorStorageQuota::from(Navigator& navigator)
{
NavigatorStorageQuota* supplement = static_cast<NavigatorStorageQuota*>(Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorStorageQuota(navigator->frame());
+ supplement = new NavigatorStorageQuota(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
-StorageQuota* NavigatorStorageQuota::storageQuota(Navigator* navigator)
+StorageQuota* NavigatorStorageQuota::storageQuota(Navigator& navigator)
{
- return NavigatorStorageQuota::from(navigator)->storageQuota();
+ return NavigatorStorageQuota::from(navigator).storageQuota();
}
-DeprecatedStorageQuota* NavigatorStorageQuota::webkitTemporaryStorage(Navigator* navigator)
+DeprecatedStorageQuota* NavigatorStorageQuota::webkitTemporaryStorage(Navigator& navigator)
{
- return NavigatorStorageQuota::from(navigator)->webkitTemporaryStorage();
+ return NavigatorStorageQuota::from(navigator).webkitTemporaryStorage();
}
-DeprecatedStorageQuota* NavigatorStorageQuota::webkitPersistentStorage(Navigator* navigator)
+DeprecatedStorageQuota* NavigatorStorageQuota::webkitPersistentStorage(Navigator& navigator)
{
- return NavigatorStorageQuota::from(navigator)->webkitPersistentStorage();
+ return NavigatorStorageQuota::from(navigator).webkitPersistentStorage();
}
StorageQuota* NavigatorStorageQuota::storageQuota() const

Powered by Google App Engine
This is Rietveld 408576698