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

Unified Diff: Source/modules/crypto/WorkerGlobalScopeCrypto.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/crypto/WorkerGlobalScopeCrypto.cpp
diff --git a/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp b/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp
index a264514901364eb4d96574be84af87f9844d122b..2442e297aa611ea3fec5f93abbbe3e0f34e96f8c 100644
--- a/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp
+++ b/Source/modules/crypto/WorkerGlobalScopeCrypto.cpp
@@ -49,19 +49,19 @@ const char* WorkerGlobalScopeCrypto::supplementName()
return "WorkerGlobalScopeCrypto";
}
-WorkerGlobalScopeCrypto* WorkerGlobalScopeCrypto::from(WorkerSupplementable* context)
+WorkerGlobalScopeCrypto& WorkerGlobalScopeCrypto::from(WorkerSupplementable& context)
{
WorkerGlobalScopeCrypto* supplement = static_cast<WorkerGlobalScopeCrypto*>(WorkerSupplement::from(context, supplementName()));
if (!supplement) {
supplement = new WorkerGlobalScopeCrypto();
provideTo(context, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
-WorkerCrypto* WorkerGlobalScopeCrypto::crypto(WorkerSupplementable* context)
+WorkerCrypto* WorkerGlobalScopeCrypto::crypto(WorkerSupplementable& context)
{
- return WorkerGlobalScopeCrypto::from(context)->crypto();
+ return WorkerGlobalScopeCrypto::from(context).crypto();
}
WorkerCrypto* WorkerGlobalScopeCrypto::crypto() const

Powered by Google App Engine
This is Rietveld 408576698