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

Unified Diff: Source/platform/Supplementable.h

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/platform/Supplementable.h
diff --git a/Source/platform/Supplementable.h b/Source/platform/Supplementable.h
index 646cadff40c21d47444316432a299f5bb058dfd1..7d238da4040fdde9c212a643ea4e4c870e0a8d12 100644
--- a/Source/platform/Supplementable.h
+++ b/Source/platform/Supplementable.h
@@ -98,9 +98,14 @@ public:
virtual bool isRefCountedWrapper() const { return false; }
#endif
- static void provideTo(Supplementable<T>* host, const char* key, PassOwnPtr<Supplement<T> > supplement)
+ static void provideTo(Supplementable<T>& host, const char* key, PassOwnPtr<Supplement<T> > supplement)
{
- host->provideSupplement(key, supplement);
+ host.provideSupplement(key, supplement);
+ }
+
+ static Supplement<T>* from(Supplementable<T>& host, const char* key)
+ {
+ return host.requireSupplement(key);
}
static Supplement<T>* from(Supplementable<T>* host, const char* key)

Powered by Google App Engine
This is Rietveld 408576698