file_path_watcher.cc revision ddb351dbec246cf1fab5ec20d2d5520909041de1
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
3// found in the LICENSE file.
4
5// Cross platform methods for FilePathWatcher. See the various platform
6// specific implementation files, too.
7
8#include "base/files/file_path_watcher.h"
9
10#include "base/logging.h"
11#include "base/message_loop.h"
12
13namespace base {
14namespace files {
15
16FilePathWatcher::~FilePathWatcher() {
17  impl_->Cancel();
18}
19
20bool FilePathWatcher::Watch(const FilePath& path, Delegate* delegate) {
21  DCHECK(path.IsAbsolute());
22  return impl_->Watch(path, delegate);
23}
24
25FilePathWatcher::PlatformDelegate::PlatformDelegate(): cancelled_(false) {
26}
27
28FilePathWatcher::PlatformDelegate::~PlatformDelegate() {
29  DCHECK(is_cancelled());
30}
31
32}  // namespace files
33}  // namespace base
34