Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(60)

Side by Side Diff: base/files/file_path_watcher_stub.cc

Issue 2596273003: Remove ref-counting from FilePathWatcher. (Closed)
Patch Set: fix mac build error Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/files/file_path_watcher_mac.cc ('k') | base/files/file_path_watcher_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // This file exists for Unix systems which don't have the inotify headers, and 5 // This file exists for Unix systems which don't have the inotify headers, and
6 // thus cannot build file_watcher_inotify.cc 6 // thus cannot build file_watcher_inotify.cc
7 7
8 #include "base/files/file_path_watcher.h" 8 #include "base/files/file_path_watcher.h"
9 9
10 #include "base/macros.h"
11 #include "base/memory/ptr_util.h"
12
10 namespace base { 13 namespace base {
11 14
12 namespace { 15 namespace {
13 16
14 class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate { 17 class FilePathWatcherImpl : public FilePathWatcher::PlatformDelegate {
15 public: 18 public:
19 FilePathWatcherImpl() = default;
20 ~FilePathWatcherImpl() override = default;
21
16 bool Watch(const FilePath& path, 22 bool Watch(const FilePath& path,
17 bool recursive, 23 bool recursive,
18 const FilePathWatcher::Callback& callback) override { 24 const FilePathWatcher::Callback& callback) override {
19 return false; 25 return false;
20 } 26 }
21 27
22 void Cancel() override {} 28 void Cancel() override {}
23 29
24 protected: 30 private:
25 ~FilePathWatcherImpl() override {} 31 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl);
26 }; 32 };
27 33
28 } // namespace 34 } // namespace
29 35
30 FilePathWatcher::FilePathWatcher() { 36 FilePathWatcher::FilePathWatcher() {
31 sequence_checker_.DetachFromSequence(); 37 sequence_checker_.DetachFromSequence();
32 impl_ = new FilePathWatcherImpl(); 38 impl_ = MakeUnique<FilePathWatcherImpl>();
33 } 39 }
34 40
35 } // namespace base 41 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher_mac.cc ('k') | base/files/file_path_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698