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

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

Issue 18286004: Move PathExists to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « base/file_util_win.cc ('k') | base/files/file_util_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "base/files/file_path_watcher.h" 5 #include "base/files/file_path_watcher.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <string.h> 8 #include <string.h>
9 #include <sys/inotify.h> 9 #include <sys/inotify.h>
10 #include <sys/ioctl.h> 10 #include <sys/ioctl.h>
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 // Report the following events: 344 // Report the following events:
345 // - The target or a direct child of the target got changed (in case the 345 // - The target or a direct child of the target got changed (in case the
346 // watched path refers to a directory). 346 // watched path refers to a directory).
347 // - One of the parent directories got moved or deleted, since the target 347 // - One of the parent directories got moved or deleted, since the target
348 // disappears in this case. 348 // disappears in this case.
349 // - One of the parent directories appears. The event corresponding to 349 // - One of the parent directories appears. The event corresponding to
350 // the target appearing might have been missed in this case, so 350 // the target appearing might have been missed in this case, so
351 // recheck. 351 // recheck.
352 if (target_changed || 352 if (target_changed ||
353 (change_on_target_path && !created) || 353 (change_on_target_path && !created) ||
354 (change_on_target_path && file_util::PathExists(target_))) { 354 (change_on_target_path && PathExists(target_))) {
355 callback_.Run(target_, false); 355 callback_.Run(target_, false);
356 return; 356 return;
357 } 357 }
358 } 358 }
359 } 359 }
360 } 360 }
361 361
362 bool FilePathWatcherImpl::Watch(const FilePath& path, 362 bool FilePathWatcherImpl::Watch(const FilePath& path,
363 bool recursive, 363 bool recursive,
364 const FilePathWatcher::Callback& callback) { 364 const FilePathWatcher::Callback& callback) {
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 return true; 478 return true;
479 } 479 }
480 480
481 } // namespace 481 } // namespace
482 482
483 FilePathWatcher::FilePathWatcher() { 483 FilePathWatcher::FilePathWatcher() {
484 impl_ = new FilePathWatcherImpl(); 484 impl_ = new FilePathWatcherImpl();
485 } 485 }
486 486
487 } // namespace base 487 } // namespace base
OLDNEW
« no previous file with comments | « base/file_util_win.cc ('k') | base/files/file_util_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698