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

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

Issue 8677015: base::Bind: Convert FilePathWatcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix. Created 9 years 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/files/file_path_watcher.h ('k') | base/files/file_path_watcher_browsertest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 // Cross platform methods for FilePathWatcher. See the various platform 5 // Cross platform methods for FilePathWatcher. See the various platform
6 // specific implementation files, too. 6 // specific implementation files, too.
7 7
8 #include "base/files/file_path_watcher.h" 8 #include "base/files/file_path_watcher.h"
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/message_loop.h" 11 #include "base/message_loop.h"
12 12
13 namespace base { 13 namespace base {
14 namespace files { 14 namespace files {
15 15
16 FilePathWatcher::~FilePathWatcher() { 16 FilePathWatcher::~FilePathWatcher() {
17 impl_->Cancel(); 17 impl_->Cancel();
18 } 18 }
19 19
20 // static
21 void FilePathWatcher::CancelWatch(
22 const scoped_refptr<PlatformDelegate>& delegate) {
23 delegate->CancelOnMessageLoopThread();
24 }
25
20 bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) { 26 bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) {
21 DCHECK(path.IsAbsolute()); 27 DCHECK(path.IsAbsolute());
22 return impl_->Watch(path, delegate); 28 return impl_->Watch(path, delegate);
23 } 29 }
24 30
25 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) { 31 FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
26 } 32 }
27 33
28 FilePathWatcher::PlatformDelegate::~PlatformDelegate() { 34 FilePathWatcher::PlatformDelegate::~PlatformDelegate() {
29 DCHECK(is_cancelled()); 35 DCHECK(is_cancelled());
30 } 36 }
31 37
32 } // namespace files 38 } // namespace files
33 } // namespace base 39 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher.h ('k') | base/files/file_path_watcher_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698