Chromium Code Reviews| Index: base/files/file_path_watcher_linux.cc |
| diff --git a/base/files/file_path_watcher_linux.cc b/base/files/file_path_watcher_linux.cc |
| index 2444b4453db2ce76c3745c1ec686efd991f29397..90164c3374f59dada2402f7e2d0f954718894400 100644 |
| --- a/base/files/file_path_watcher_linux.cc |
| +++ b/base/files/file_path_watcher_linux.cc |
| @@ -521,6 +521,10 @@ void FilePathWatcherImpl::UpdateRecursiveWatches( |
| return; |
| } |
| + // Underneath |target_|, only directory changes trigger watch updates. |
| + if (!is_dir && fired_watch != InotifyReader::kInvalidWatch) |
| + return; |
| + |
| // Check to see if this is a forced update or if some component of |target_| |
| // has changed. For these cases, redo the watches for |target_| and below. |
| if (!ContainsKey(recursive_paths_by_watch_, fired_watch)) { |
|
Shuhei Takahashi
2016/09/08 05:10:52
Hmm, reordering the checks is fragile and I'm afra
dspaid
2016/09/09 02:00:55
Done.
|
| @@ -528,10 +532,6 @@ void FilePathWatcherImpl::UpdateRecursiveWatches( |
| return; |
| } |
| - // Underneath |target_|, only directory changes trigger watch updates. |
| - if (!is_dir) |
| - return; |
| - |
| const FilePath& changed_dir = recursive_paths_by_watch_[fired_watch]; |
| std::map<FilePath, InotifyReader::Watch>::iterator start_it = |