Index: Source/core/dom/ContextFeatures.h |
diff --git a/Source/core/dom/ContextFeatures.h b/Source/core/dom/ContextFeatures.h |
index 8868cc8e2b14f7be08392ed608b3a849c56ea923..7a72256ac49788cf5637e2fce97572dc841c7727 100644 |
--- a/Source/core/dom/ContextFeatures.h |
+++ b/Source/core/dom/ContextFeatures.h |
@@ -48,7 +48,7 @@ public: |
static const char* supplementName(); |
static ContextFeatures* defaultSwitch(); |
- static PassRefPtr<ContextFeatures> create(ContextFeaturesClient*); |
+ static PassRefPtr<ContextFeatures> create(PassOwnPtr<ContextFeaturesClient>); |
static bool dialogElementEnabled(Document*); |
static bool styleScopedEnabled(Document*); |
@@ -60,35 +60,27 @@ public: |
void urlDidChange(Document*); |
private: |
- explicit ContextFeatures(ContextFeaturesClient* client) |
+ explicit ContextFeatures(PassOwnPtr<ContextFeaturesClient> client) |
: m_client(client) |
{ } |
- virtual void hostDestroyed() OVERRIDE; |
- |
- ContextFeaturesClient* m_client; |
+ OwnPtr<ContextFeaturesClient> m_client; |
}; |
-inline void ContextFeatures::hostDestroyed() |
-{ |
- m_client = 0; |
-} |
- |
- |
class ContextFeaturesClient { |
WTF_MAKE_FAST_ALLOCATED; |
public: |
- static ContextFeaturesClient* empty(); |
+ static PassOwnPtr<ContextFeaturesClient> empty(); |
virtual ~ContextFeaturesClient() { } |
virtual bool isEnabled(Document*, ContextFeatures::FeatureType, bool defaultValue) { return defaultValue; } |
virtual void urlDidChange(Document*) { } |
}; |
-void provideContextFeaturesTo(Page&, ContextFeaturesClient*); |
+void provideContextFeaturesTo(Page&, PassOwnPtr<ContextFeaturesClient>); |
void provideContextFeaturesToDocumentFrom(Document&, Page&); |
-inline PassRefPtr<ContextFeatures> ContextFeatures::create(ContextFeaturesClient* client) |
+inline PassRefPtr<ContextFeatures> ContextFeatures::create(PassOwnPtr<ContextFeaturesClient> client) |
{ |
return adoptRef(new ContextFeatures(client)); |
} |