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

Unified Diff: base/files/file_path_watcher_stub.cc

Issue 2596273003: Remove ref-counting from FilePathWatcher. (Closed)
Patch Set: self-review Created 4 years 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
Index: base/files/file_path_watcher_stub.cc
diff --git a/base/files/file_path_watcher_stub.cc b/base/files/file_path_watcher_stub.cc
index c224e379f3754e86f938c6b4ef0815b1d798161d..04e84fe3645e2137e0562d8f74ce83d906d34325 100644
--- a/base/files/file_path_watcher_stub.cc
+++ b/base/files/file_path_watcher_stub.cc
@@ -7,12 +7,17 @@
#include "base/files/file_path_watcher.h"
+#include "base/macros.h"
+#include "base/memory/ptr_util.h"
+
namespace base {
namespace {
class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
public:
+ ~FilePathWatcherImpl() override = default;
+
bool Watch(const FilePath& path,
bool recursive,
const FilePathWatcher::Callback& callback) override {
@@ -21,15 +26,15 @@ class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
void Cancel() override {}
- protected:
- ~FilePathWatcherImpl() override {}
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl);
gab 2017/01/05 21:22:53 Probably need an explicit public default construct
fdoray 2017/01/05 23:04:11 Done.
};
} // namespace
FilePathWatcher::FilePathWatcher() {
sequence_checker_.DetachFromSequence();
- impl_ = new FilePathWatcherImpl();
+ impl_ = MakeUnique<FilePathWatcherImpl>();
}
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698