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

Side by Side Diff: base/files/file_path_watcher_stub.cc

Issue 2596273003: Remove ref-counting from FilePathWatcher. (Closed)
Patch Set: self-review Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file exists for Unix systems which don't have the inotify headers, and 5 // This file exists for Unix systems which don't have the inotify headers, and
6 // thus cannot build file_watcher_inotify.cc 6 // thus cannot build file_watcher_inotify.cc
7 7
8 #include "base/files/file_path_watcher.h" 8 #include "base/files/file_path_watcher.h"
9 9
10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h"
12
10 namespace base { 13 namespace base {
11 14
12 namespace { 15 namespace {
13 16
14 class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate { 17 class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
15 public: 18 public:
19 ~FilePathWatcherImpl() override = default;
20
16 bool Watch(const FilePath& path, 21 bool Watch(const FilePath& path,
17 bool recursive, 22 bool recursive,
18 const FilePathWatcher::Callback& callback) override { 23 const FilePathWatcher::Callback& callback) override {
19 return false; 24 return false;
20 } 25 }
21 26
22 void Cancel() override {} 27 void Cancel() override {}
23 28
24 protected: 29 private:
25 ~FilePathWatcherImpl() override {} 30 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.
26 }; 31 };
27 32
28 } // namespace 33 } // namespace
29 34
30 FilePathWatcher::FilePathWatcher() { 35 FilePathWatcher::FilePathWatcher() {
31 sequence_checker_.DetachFromSequence(); 36 sequence_checker_.DetachFromSequence();
32 impl_ = new FilePathWatcherImpl(); 37 impl_ = MakeUnique<FilePathWatcherImpl>();
33 } 38 }
34 39
35 } // namespace base 40 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698