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

Unified Diff: third_party/WebKit/Source/platform/Supplementable.h

Issue 2611133002: Remove ContextClient from NavigatorBeacon (Closed)
Patch Set: temp Created 3 years, 11 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
« no previous file with comments | « third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/Supplementable.h
diff --git a/third_party/WebKit/Source/platform/Supplementable.h b/third_party/WebKit/Source/platform/Supplementable.h
index c2b90df0f0a3ec2457dac03425f1d030a2dfbfe9..6ec435c81fc6819439cea6f3aaec688efd660573 100644
--- a/third_party/WebKit/Source/platform/Supplementable.h
+++ b/third_party/WebKit/Source/platform/Supplementable.h
@@ -98,7 +98,12 @@ class Supplement : public GarbageCollectedMixin {
// TODO(haraken): Remove the default constructor.
// All Supplement objects should be instantiated with m_host.
Supplement() {}
+
explicit Supplement(T& host) : m_host(&host) {}
+
+ // Supplementable and its supplements live and die together.
+ // Thus host() should never return null (if the default constructor
+ // is completely removed).
T* host() const { return m_host; }
static void provideTo(Supplementable<T>& host,
« no previous file with comments | « third_party/WebKit/Source/modules/beacon/NavigatorBeacon.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698