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

Unified Diff: Source/modules/crypto/DOMWindowCrypto.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/DOMWindowCrypto.cpp
diff --git a/Source/modules/crypto/DOMWindowCrypto.cpp b/Source/modules/crypto/DOMWindowCrypto.cpp
index 5c4bbae261311c3fe795b68614ddddc8f4d7ea2a..3e3e0274303de313ac086fbe62ff95752ca6f490 100644
--- a/Source/modules/crypto/DOMWindowCrypto.cpp
+++ b/Source/modules/crypto/DOMWindowCrypto.cpp
@@ -36,8 +36,8 @@
namespace WebCore {
-DOMWindowCrypto::DOMWindowCrypto(DOMWindow* window)
- : DOMWindowProperty(window->frame())
+DOMWindowCrypto::DOMWindowCrypto(DOMWindow& window)
+ : DOMWindowProperty(window.frame())
{
}
@@ -50,19 +50,19 @@ const char* DOMWindowCrypto::supplementName()
return "DOMWindowCrypto";
}
-DOMWindowCrypto* DOMWindowCrypto::from(DOMWindow* window)
+DOMWindowCrypto& DOMWindowCrypto::from(DOMWindow& window)
{
DOMWindowCrypto* supplement = static_cast<DOMWindowCrypto*>(Supplement<DOMWindow>::from(window, supplementName()));
if (!supplement) {
supplement = new DOMWindowCrypto(window);
provideTo(window, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
-Crypto* DOMWindowCrypto::crypto(DOMWindow* window)
+Crypto* DOMWindowCrypto::crypto(DOMWindow& window)
{
- return DOMWindowCrypto::from(window)->crypto();
+ return DOMWindowCrypto::from(window).crypto();
}
Crypto* DOMWindowCrypto::crypto() const

Powered by Google App Engine
This is Rietveld 408576698