| 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 487873705cf0e96439468a31084aa8268612a03a..3079076866c6914bedacfdbacbb29346cfc9fe8f 100644
|
| --- a/third_party/WebKit/Source/platform/Supplementable.h
|
| +++ b/third_party/WebKit/Source/platform/Supplementable.h
|
| @@ -26,6 +26,7 @@
|
| #ifndef Supplementable_h
|
| #define Supplementable_h
|
|
|
| +#include "platform/PlatformExport.h"
|
| #include "platform/heap/Handle.h"
|
| #include "wtf/Assertions.h"
|
| #include "wtf/HashMap.h"
|
| @@ -91,8 +92,14 @@ template<typename T>
|
| class Supplementable;
|
|
|
| template<typename T>
|
| -class Supplement : public GarbageCollectedMixin {
|
| +class PLATFORM_EXPORT Supplement : public GarbageCollectedMixin {
|
| public:
|
| + // TODO(haraken): Remove the default constructor.
|
| + // All Supplement objects should be instantiated with m_host.
|
| + Supplement() { }
|
| + explicit Supplement(T& host) : m_host(&host) { }
|
| + T* host() const { return m_host; }
|
| +
|
| static void provideTo(Supplementable<T>& host, const char* key, Supplement<T>* supplement)
|
| {
|
| host.provideSupplement(key, supplement);
|
| @@ -108,7 +115,13 @@ public:
|
| return host ? host->requireSupplement(key) : 0;
|
| }
|
|
|
| - DEFINE_INLINE_VIRTUAL_TRACE() { }
|
| + DEFINE_INLINE_VIRTUAL_TRACE()
|
| + {
|
| + visitor->trace(m_host);
|
| + }
|
| +
|
| +private:
|
| + Member<T> m_host;
|
| };
|
|
|
| // Supplementable<T> inherits from GarbageCollectedMixin virtually
|
|
|