OLD | NEW |
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() = default; |
| 20 ~FilePathWatcherImpl() override = default; |
| 21 |
16 bool Watch(const FilePath& path, | 22 bool Watch(const FilePath& path, |
17 bool recursive, | 23 bool recursive, |
18 const FilePathWatcher::Callback& callback) override { | 24 const FilePathWatcher::Callback& callback) override { |
19 return false; | 25 return false; |
20 } | 26 } |
21 | 27 |
22 void Cancel() override {} | 28 void Cancel() override {} |
23 | 29 |
24 protected: | 30 private: |
25 ~FilePathWatcherImpl() override {} | 31 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl); |
26 }; | 32 }; |
27 | 33 |
28 } // namespace | 34 } // namespace |
29 | 35 |
30 FilePathWatcher::FilePathWatcher() { | 36 FilePathWatcher::FilePathWatcher() { |
31 sequence_checker_.DetachFromSequence(); | 37 sequence_checker_.DetachFromSequence(); |
32 impl_ = new FilePathWatcherImpl(); | 38 impl_ = MakeUnique<FilePathWatcherImpl>(); |
33 } | 39 } |
34 | 40 |
35 } // namespace base | 41 } // namespace base |
OLD | NEW |