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

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: another 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 if (!message_loop()->BelongsToCurrentThread()) { 122 if (!message_loop()->BelongsToCurrentThread()) {
123 message_loop()->PostTask(FROM_HERE, 123 message_loop()->PostTask(FROM_HERE,
124 Bind(&FilePathWatcher::CancelWatch, 124 Bind(&FilePathWatcher::CancelWatch,
125 make_scoped_refptr(this))); 125 make_scoped_refptr(this)));
126 } else { 126 } else {
127 CancelOnMessageLoopThread(); 127 CancelOnMessageLoopThread();
128 } 128 }
129 } 129 }
130 130
131 void FilePathWatcherImpl::CancelOnMessageLoopThread() { 131 void FilePathWatcherImpl::CancelOnMessageLoopThread() {
132 DCHECK(message_loop()->BelongsToCurrentThread());
132 set_cancelled(); 133 set_cancelled();
133 134
134 if (handle_ != INVALID_HANDLE_VALUE) 135 if (handle_ != INVALID_HANDLE_VALUE)
135 DestroyWatch(); 136 DestroyWatch();
136 137
137 if (!callback_.is_null()) { 138 if (!callback_.is_null()) {
138 MessageLoop::current()->RemoveDestructionObserver(this); 139 MessageLoop::current()->RemoveDestructionObserver(this);
139 callback_.Reset(); 140 callback_.Reset();
140 } 141 }
141 } 142 }
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 handle_ = INVALID_HANDLE_VALUE; 293 handle_ = INVALID_HANDLE_VALUE;
293 } 294 }
294 295
295 } // namespace 296 } // namespace
296 297
297 FilePathWatcher::FilePathWatcher() { 298 FilePathWatcher::FilePathWatcher() {
298 impl_ = new FilePathWatcherImpl(); 299 impl_ = new FilePathWatcherImpl();
299 } 300 }
300 301
301 } // namespace base 302 } // namespace base
OLDNEW
« base/files/file_path_watcher_mac.cc ('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