| 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 "content/common/file_path_watcher/file_path_watcher.h" | 5 #include "base/files/file_path_watcher.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/message_loop_proxy.h" | 11 #include "base/message_loop_proxy.h" |
| 12 #include "base/time.h" | 12 #include "base/time.h" |
| 13 #include "base/win/object_watcher.h" | 13 #include "base/win/object_watcher.h" |
| 14 | 14 |
| 15 using ::base::files::FilePathWatcher; |
| 16 |
| 15 namespace { | 17 namespace { |
| 16 | 18 |
| 17 class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, | 19 class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate, |
| 18 public base::win::ObjectWatcher::Delegate, | 20 public base::win::ObjectWatcher::Delegate, |
| 19 public MessageLoop::DestructionObserver { | 21 public MessageLoop::DestructionObserver { |
| 20 public: | 22 public: |
| 21 FilePathWatcherImpl() : delegate_(NULL), handle_(INVALID_HANDLE_VALUE) {} | 23 FilePathWatcherImpl() : delegate_(NULL), handle_(INVALID_HANDLE_VALUE) {} |
| 22 | 24 |
| 23 // FilePathWatcher::PlatformDelegate overrides. | 25 // FilePathWatcher::PlatformDelegate overrides. |
| 24 virtual bool Watch(const FilePath& path, | 26 virtual bool Watch(const FilePath& path, |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 watcher_.StopWatching(); | 267 watcher_.StopWatching(); |
| 266 FindCloseChangeNotification(handle_); | 268 FindCloseChangeNotification(handle_); |
| 267 handle_ = INVALID_HANDLE_VALUE; | 269 handle_ = INVALID_HANDLE_VALUE; |
| 268 } | 270 } |
| 269 | 271 |
| 270 } // namespace | 272 } // namespace |
| 271 | 273 |
| 272 FilePathWatcher::FilePathWatcher() { | 274 FilePathWatcher::FilePathWatcher() { |
| 273 impl_ = new FilePathWatcherImpl(); | 275 impl_ = new FilePathWatcherImpl(); |
| 274 } | 276 } |
| OLD | NEW |