RefCounted types should not have public destructors, base/ edition
BUG=123295
TEST=none
Review URL: http://codereview.chromium.org/10065037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@133825 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: a9aaa9d16ba4bfc0a1e765d349cae8470301749e
diff --git a/base/files/file_path_watcher.h b/base/files/file_path_watcher.h
index 3174a9e..3140628 100644
--- a/base/files/file_path_watcher.h
+++ b/base/files/file_path_watcher.h
@@ -33,11 +33,14 @@
// corresponding FileWatcher object to prevent a reference cycle.
class Delegate : public base::RefCountedThreadSafe<Delegate> {
public:
- virtual ~Delegate() {}
virtual void OnFilePathChanged(const FilePath& path) = 0;
// Called when platform specific code detected an error. The watcher will
// not call OnFilePathChanged for future changes.
virtual void OnFilePathError(const FilePath& path) {}
+
+ protected:
+ friend class base::RefCountedThreadSafe<Delegate>;
+ virtual ~Delegate() {}
};
// Used internally to encapsulate different members on different platforms.
@@ -57,6 +60,7 @@
virtual void Cancel() = 0;
protected:
+ friend class base::RefCountedThreadSafe<PlatformDelegate>;
friend class FilePathWatcher;
virtual ~PlatformDelegate();
@@ -84,8 +88,6 @@
}
private:
- friend class base::RefCountedThreadSafe<PlatformDelegate>;
-
scoped_refptr<base::MessageLoopProxy> message_loop_;
bool cancelled_;
};