OLD | NEW |
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/files/file.h" | 8 #include "base/files/file.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 } | 143 } |
144 | 144 |
145 void FilePathWatcherImpl::WillDestroyCurrentMessageLoop() { | 145 void FilePathWatcherImpl::WillDestroyCurrentMessageLoop() { |
146 CancelOnMessageLoopThread(); | 146 CancelOnMessageLoopThread(); |
147 } | 147 } |
148 | 148 |
149 void FilePathWatcherImpl::OnObjectSignaled(HANDLE object) { | 149 void FilePathWatcherImpl::OnObjectSignaled(HANDLE object) { |
150 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 150 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
151 tracked_objects::ScopedTracker tracking_profile( | 151 tracked_objects::ScopedTracker tracking_profile( |
152 FROM_HERE_WITH_EXPLICIT_FUNCTION("FilePathWatcherImpl_OnObjectSignaled")); | 152 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 153 "418183 FilePathWatcherImpl::OnObjectSignaled")); |
153 | 154 |
154 DCHECK(object == handle_); | 155 DCHECK(object == handle_); |
155 // Make sure we stay alive through the body of this function. | 156 // Make sure we stay alive through the body of this function. |
156 scoped_refptr<FilePathWatcherImpl> keep_alive(this); | 157 scoped_refptr<FilePathWatcherImpl> keep_alive(this); |
157 | 158 |
158 if (!UpdateWatch()) { | 159 if (!UpdateWatch()) { |
159 callback_.Run(target_, true /* error */); | 160 callback_.Run(target_, true /* error */); |
160 return; | 161 return; |
161 } | 162 } |
162 | 163 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 handle_ = INVALID_HANDLE_VALUE; | 298 handle_ = INVALID_HANDLE_VALUE; |
298 } | 299 } |
299 | 300 |
300 } // namespace | 301 } // namespace |
301 | 302 |
302 FilePathWatcher::FilePathWatcher() { | 303 FilePathWatcher::FilePathWatcher() { |
303 impl_ = new FilePathWatcherImpl(); | 304 impl_ = new FilePathWatcherImpl(); |
304 } | 305 } |
305 | 306 |
306 } // namespace base | 307 } // namespace base |
OLD | NEW |