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

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

Issue 11118004: Fix a couple small problems in base/ (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 2 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 | « no previous file | base/posix/unix_domain_socket.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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 watches_.clear(); 416 watches_.clear();
417 target_.clear(); 417 target_.clear();
418 } 418 }
419 419
420 void FilePathWatcherImpl::WillDestroyCurrentMessageLoop() { 420 void FilePathWatcherImpl::WillDestroyCurrentMessageLoop() {
421 CancelOnMessageLoopThread(); 421 CancelOnMessageLoopThread();
422 } 422 }
423 423
424 bool FilePathWatcherImpl::UpdateWatches() { 424 bool FilePathWatcherImpl::UpdateWatches() {
425 // Ensure this runs on the message_loop_ exclusively in order to avoid 425 // Ensure this runs on the |message_loop_| exclusively in order to avoid
426 // concurrency issues. 426 // concurrency issues.
427 DCHECK(message_loop()->BelongsToCurrentThread()); 427 DCHECK(message_loop()->BelongsToCurrentThread());
428 428
429 // Walk the list of watches and update them as we go. 429 // Walk the list of watches and update them as we go.
430 FilePath path(FILE_PATH_LITERAL("/")); 430 FilePath path(FILE_PATH_LITERAL("/"));
431 bool path_valid = true; 431 bool path_valid = true;
432 for (WatchVector::iterator watch_entry(watches_.begin()); 432 for (WatchVector::iterator watch_entry(watches_.begin());
433 watch_entry != watches_.end(); ++watch_entry) { 433 watch_entry != watches_.end(); ++watch_entry) {
434 InotifyReader::Watch old_watch = watch_entry->watch_; 434 InotifyReader::Watch old_watch = watch_entry->watch_;
435 if (path_valid) { 435 if (path_valid) {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 } 474 }
475 475
476 } // namespace 476 } // namespace
477 477
478 FilePathWatcher::FilePathWatcher() { 478 FilePathWatcher::FilePathWatcher() {
479 impl_ = new FilePathWatcherImpl(); 479 impl_ = new FilePathWatcherImpl();
480 } 480 }
481 481
482 } // namespace files 482 } // namespace files
483 } // namespace base 483 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/posix/unix_domain_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698