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

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

Issue 588003002: Remove implicit conversions from scoped_refptr to T* in FileWatcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« no previous file with comments | « base/files/file_path_watcher.h ('k') | no next file » | 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 411 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 callback_.Run(target_, false /* error */); 422 callback_.Run(target_, false /* error */);
423 } 423 }
424 } 424 }
425 425
426 bool FilePathWatcherImpl::Watch(const FilePath& path, 426 bool FilePathWatcherImpl::Watch(const FilePath& path,
427 bool recursive, 427 bool recursive,
428 const FilePathWatcher::Callback& callback) { 428 const FilePathWatcher::Callback& callback) {
429 DCHECK(target_.empty()); 429 DCHECK(target_.empty());
430 DCHECK(MessageLoopForIO::current()); 430 DCHECK(MessageLoopForIO::current());
431 431
432 set_message_loop(MessageLoopProxy::current().get()); 432 set_message_loop(MessageLoopProxy::current());
433 callback_ = callback; 433 callback_ = callback;
434 target_ = path; 434 target_ = path;
435 recursive_ = recursive; 435 recursive_ = recursive;
436 MessageLoop::current()->AddDestructionObserver(this); 436 MessageLoop::current()->AddDestructionObserver(this);
437 437
438 std::vector<FilePath::StringType> comps; 438 std::vector<FilePath::StringType> comps;
439 target_.GetComponents(&comps); 439 target_.GetComponents(&comps);
440 DCHECK(!comps.empty()); 440 DCHECK(!comps.empty());
441 for (size_t i = 1; i < comps.size(); ++i) 441 for (size_t i = 1; i < comps.size(); ++i)
442 watches_.push_back(WatchEntry(comps[i])); 442 watches_.push_back(WatchEntry(comps[i]));
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 return watches_[watches_.size() - 1].subdir.empty(); 660 return watches_[watches_.size() - 1].subdir.empty();
661 } 661 }
662 662
663 } // namespace 663 } // namespace
664 664
665 FilePathWatcher::FilePathWatcher() { 665 FilePathWatcher::FilePathWatcher() {
666 impl_ = new FilePathWatcherImpl(); 666 impl_ = new FilePathWatcherImpl();
667 } 667 }
668 668
669 } // namespace base 669 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698