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

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

Issue 283423003: Use FSEvents for recursive file watch on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 7 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) 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 #include "base/files/file_path_watcher.h" 5 #include "base/files/file_path_watcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/file.h" 9 #include "base/files/file.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 if (!message_loop()->BelongsToCurrentThread()) { 116 if (!message_loop()->BelongsToCurrentThread()) {
117 message_loop()->PostTask(FROM_HERE, 117 message_loop()->PostTask(FROM_HERE,
118 Bind(&FilePathWatcher::CancelWatch, 118 Bind(&FilePathWatcher::CancelWatch,
119 make_scoped_refptr(this))); 119 make_scoped_refptr(this)));
120 } else { 120 } else {
121 CancelOnMessageLoopThread(); 121 CancelOnMessageLoopThread();
122 } 122 }
123 } 123 }
124 124
125 void FilePathWatcherImpl::CancelOnMessageLoopThread() { 125 void FilePathWatcherImpl::CancelOnMessageLoopThread() {
126 DCHECK(message_loop()->BelongsToCurrentThread());
126 set_cancelled(); 127 set_cancelled();
127 128
128 if (handle_ != INVALID_HANDLE_VALUE) 129 if (handle_ != INVALID_HANDLE_VALUE)
129 DestroyWatch(); 130 DestroyWatch();
130 131
131 if (!callback_.is_null()) { 132 if (!callback_.is_null()) {
132 MessageLoop::current()->RemoveDestructionObserver(this); 133 MessageLoop::current()->RemoveDestructionObserver(this);
133 callback_.Reset(); 134 callback_.Reset();
134 } 135 }
135 } 136 }
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 handle_ = INVALID_HANDLE_VALUE; 284 handle_ = INVALID_HANDLE_VALUE;
284 } 285 }
285 286
286 } // namespace 287 } // namespace
287 288
288 FilePathWatcher::FilePathWatcher() { 289 FilePathWatcher::FilePathWatcher() {
289 impl_ = new FilePathWatcherImpl(); 290 impl_ = new FilePathWatcherImpl();
290 } 291 }
291 292
292 } // namespace base 293 } // namespace base
OLDNEW
« base/files/file_path_watcher_kqueue.h ('K') | « base/files/file_path_watcher_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698