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

Side by Side Diff: base/directory_watcher.h

Issue 360042: First patch in making destructors of refcounted objects private. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 module provides a way to monitor a directory for changes. 5 // This module provides a way to monitor a directory for changes.
6 6
7 #ifndef BASE_DIRECTORY_WATCHER_H_ 7 #ifndef BASE_DIRECTORY_WATCHER_H_
8 #define BASE_DIRECTORY_WATCHER_H_ 8 #define BASE_DIRECTORY_WATCHER_H_
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 28 matching lines...) Expand all
39 // is consistent on any particular version of Windows, but not across 39 // is consistent on any particular version of Windows, but not across
40 // different versions. 40 // different versions.
41 bool Watch(const FilePath& path, Delegate* delegate, 41 bool Watch(const FilePath& path, Delegate* delegate,
42 MessageLoop* backend_loop, bool recursive) { 42 MessageLoop* backend_loop, bool recursive) {
43 return impl_->Watch(path, delegate, backend_loop, recursive); 43 return impl_->Watch(path, delegate, backend_loop, recursive);
44 } 44 }
45 45
46 // Used internally to encapsulate different members on different platforms. 46 // Used internally to encapsulate different members on different platforms.
47 class PlatformDelegate : public base::RefCounted<PlatformDelegate> { 47 class PlatformDelegate : public base::RefCounted<PlatformDelegate> {
48 public: 48 public:
49 virtual ~PlatformDelegate() {}
50 virtual bool Watch(const FilePath& path, Delegate* delegate, 49 virtual bool Watch(const FilePath& path, Delegate* delegate,
51 MessageLoop* backend_loop, bool recursive) = 0; 50 MessageLoop* backend_loop, bool recursive) = 0;
51
52 protected:
53 friend class base::RefCounted<PlatformDelegate>;
54
55 virtual ~PlatformDelegate() {}
52 }; 56 };
53 57
54 private: 58 private:
55 scoped_refptr<PlatformDelegate> impl_; 59 scoped_refptr<PlatformDelegate> impl_;
56 60
57 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher); 61 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher);
58 }; 62 };
59 63
60 #endif // BASE_DIRECTORY_WATCHER_H_ 64 #endif // BASE_DIRECTORY_WATCHER_H_
OLDNEW
« no previous file with comments | « app/sql/connection.h ('k') | base/directory_watcher_win.cc » ('j') | base/field_trial.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698