| Index: chrome/browser/file_watcher_inotify.cc
|
| diff --git a/chrome/browser/file_watcher_inotify.cc b/chrome/browser/file_watcher_inotify.cc
|
| index c65140815398e7993dd51cae32bdb15ad4d0ec0a..20321d5cf1fc81867542bacc37ad4528e7923d58 100644
|
| --- a/chrome/browser/file_watcher_inotify.cc
|
| +++ b/chrome/browser/file_watcher_inotify.cc
|
| @@ -93,7 +93,7 @@ class FileWatcherImpl : public FileWatcher::PlatformDelegate {
|
|
|
| private:
|
| // Delegate to notify upon changes.
|
| - FileWatcher::Delegate* delegate_;
|
| + scoped_refptr<FileWatcher::Delegate> delegate_;
|
|
|
| // Watch returned by InotifyReader.
|
| InotifyReader::Watch watch_;
|
| @@ -104,24 +104,6 @@ class FileWatcherImpl : public FileWatcher::PlatformDelegate {
|
| DISALLOW_COPY_AND_ASSIGN(FileWatcherImpl);
|
| };
|
|
|
| -class FileWatcherImplNotifyTask : public Task {
|
| - public:
|
| - FileWatcherImplNotifyTask(FileWatcher::Delegate* delegate,
|
| - const FilePath& path)
|
| - : delegate_(delegate), path_(path) {
|
| - }
|
| -
|
| - virtual void Run() {
|
| - delegate_->OnFileChanged(path_);
|
| - }
|
| -
|
| - private:
|
| - FileWatcher::Delegate* delegate_;
|
| - FilePath path_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(FileWatcherImplNotifyTask);
|
| -};
|
| -
|
| class InotifyReaderTask : public Task {
|
| public:
|
| InotifyReaderTask(InotifyReader* reader, int inotify_fd, int shutdown_fd)
|
| @@ -293,7 +275,8 @@ void FileWatcherImpl::OnInotifyEvent(const inotify_event* event) {
|
| return;
|
|
|
| ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
|
| - new FileWatcherImplNotifyTask(delegate_, path_));
|
| + NewRunnableMethod(delegate_.get(), &FileWatcher::Delegate::OnFileChanged,
|
| + path_));
|
| }
|
|
|
| bool FileWatcherImpl::Watch(const FilePath& path,
|
|
|