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

Unified Diff: Source/core/dom/ContextFeatures.h

Issue 224113006: Apply OwnPtr|PassOwnPtr to member variables and arguments in ContextFeatures. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « no previous file | Source/core/dom/ContextFeatures.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
« no previous file with comments | « no previous file | Source/core/dom/ContextFeatures.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698