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

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

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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
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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 bool recursive, 363 bool recursive,
364 const FilePathWatcher::Callback& callback) { 364 const FilePathWatcher::Callback& callback) {
365 DCHECK(target_.empty()); 365 DCHECK(target_.empty());
366 DCHECK(MessageLoopForIO::current()); 366 DCHECK(MessageLoopForIO::current());
367 if (recursive) { 367 if (recursive) {
368 // Recursive watch is not supported on this platform. 368 // Recursive watch is not supported on this platform.
369 NOTIMPLEMENTED(); 369 NOTIMPLEMENTED();
370 return false; 370 return false;
371 } 371 }
372 372
373 set_message_loop(base::MessageLoopProxy::current()); 373 set_message_loop(base::MessageLoopProxy::current().get());
374 callback_ = callback; 374 callback_ = callback;
375 target_ = path; 375 target_ = path;
376 MessageLoop::current()->AddDestructionObserver(this); 376 MessageLoop::current()->AddDestructionObserver(this);
377 377
378 std::vector<FilePath::StringType> comps; 378 std::vector<FilePath::StringType> comps;
379 target_.GetComponents(&comps); 379 target_.GetComponents(&comps);
380 DCHECK(!comps.empty()); 380 DCHECK(!comps.empty());
381 std::vector<FilePath::StringType>::const_iterator comp = comps.begin(); 381 std::vector<FilePath::StringType>::const_iterator comp = comps.begin();
382 for (++comp; comp != comps.end(); ++comp) 382 for (++comp; comp != comps.end(); ++comp)
383 watches_.push_back(WatchEntry(InotifyReader::kInvalidWatch, *comp)); 383 watches_.push_back(WatchEntry(InotifyReader::kInvalidWatch, *comp));
(...skipping 94 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 | « apps/shell_window_geometry_cache_unittest.cc ('k') | base/files/important_file_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698