Skip to content

Commit

Permalink
[FilePathWatcher] Remove the deprecated Watch(bool) overload.
Browse files Browse the repository at this point in the history
Also remove the casting that was introduced in https://crrev.com/830328,
as it is no longer necessary.

BUG=1147071

Change-Id: Id41ef7ae9c8aff4f74c7e67e0024af651de0e239
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2550676
Commit-Queue: Greg Thompson <grt@chromium.org>
Reviewed-by: Xiyuan Xia <xiyuan@chromium.org>
Reviewed-by: Robert Kroeger <rjkroege@chromium.org>
Reviewed-by: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: Mark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#832052}
  • Loading branch information
GregTho authored and Chromium LUCI CQ committed Nov 30, 2020
1 parent 7bd5796 commit d8f940d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 25 deletions.
7 changes: 0 additions & 7 deletions base/files/file_path_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,4 @@ bool FilePathWatcher::Watch(const FilePath& path,
return impl_->Watch(path, type, callback);
}

bool FilePathWatcher::Watch(const FilePath& path,
bool recursive,
const Callback& callback) {
return Watch(path, recursive ? Type::kRecursive : Type::kNonRecursive,
callback);
}

} // namespace base
3 changes: 0 additions & 3 deletions base/files/file_path_watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ class BASE_EXPORT FilePathWatcher {
// FileDescriptorWatcher.
bool Watch(const FilePath& path, Type type, const Callback& callback);

// Compatibility function (deprecated) for the above.
bool Watch(const FilePath& path, bool recursive, const Callback& callback);

private:
std::unique_ptr<PlatformDelegate> impl_;

Expand Down
8 changes: 3 additions & 5 deletions chrome/browser/chromeos/guest_os/guest_os_share_path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,9 @@ void GuestOsSharePath::RegisterSharedPath(const std::string& vm_name,
file_watcher_task_runner_->PostTask(
FROM_HERE,
base::BindOnce(
base::IgnoreResult(static_cast<bool (base::FilePathWatcher::*)(
const base::FilePath&, bool,
const base::FilePathWatcher::Callback&)>(
&base::FilePathWatcher::Watch)),
base::Unretained(watcher.get()), path, false,
base::IgnoreResult(&base::FilePathWatcher::Watch),
base::Unretained(watcher.get()), path,
base::FilePathWatcher::Type::kNonRecursive,
base::BindRepeating(std::move(changed), std::move(deleted))));
shared_paths_.emplace(path, SharedPathInfo(std::move(watcher), vm_name));
}
Expand Down
7 changes: 2 additions & 5 deletions chrome/browser/upgrade_detector/directory_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,8 @@ void DirectoryMonitor::Start(Callback on_change_callback) {
task_runner_->PostTaskAndReplyWithResult(
FROM_HERE,
base::BindOnce(
static_cast<bool (base::FilePathWatcher::*)(
const base::FilePath&, base::FilePathWatcher::Type,
const base::FilePathWatcher::Callback&)>(
&base::FilePathWatcher::Watch),
base::Unretained(watcher_.get()), std::move(install_dir_), watch_type,
&base::FilePathWatcher::Watch, base::Unretained(watcher_.get()),
std::move(install_dir_), watch_type,
base::BindRepeating(
[](base::SequencedTaskRunner* main_sequence,
const Callback& on_change_callback, const base::FilePath&,
Expand Down
7 changes: 2 additions & 5 deletions ui/events/ozone/device/device_manager_manual.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ void DeviceManagerManual::StartWatching() {
base::PostTaskAndReplyWithResult(
blocking_task_runner_.get(), FROM_HERE,
base::BindOnce(
static_cast<bool (base::FilePathWatcher::*)(
const base::FilePath&, bool,
const base::FilePathWatcher::Callback&)>(
&base::FilePathWatcher::Watch),
base::Unretained(watcher_.get()), base::FilePath(kDevInput), false,
&base::FilePathWatcher::Watch, base::Unretained(watcher_.get()),
base::FilePath(kDevInput), base::FilePathWatcher::Type::kNonRecursive,
base::BindRepeating(&DeviceManagerManual::OnWatcherEventOnUiSequence,
base::SequencedTaskRunnerHandle::Get(),
weak_ptr_factory_.GetWeakPtr())),
Expand Down

0 comments on commit d8f940d

Please sign in to comment.