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

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

Issue 584883003: Remove implicit conversions from scoped_refptr to T* in base/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "base/files/file_path_watcher.h" 5 #include "base/files/file_path_watcher.h"
6 #include "base/files/file_path_watcher_kqueue.h" 6 #include "base/files/file_path_watcher_kqueue.h"
7 7
8 #if !defined(OS_IOS) 8 #if !defined(OS_IOS)
9 #include "base/files/file_path_watcher_fsevents.h" 9 #include "base/files/file_path_watcher_fsevents.h"
10 #endif 10 #endif
(...skipping 16 matching lines...) Expand all
27 impl_ = new FilePathWatcherFSEvents(); 27 impl_ = new FilePathWatcherFSEvents();
28 #endif // OS_IOS 28 #endif // OS_IOS
29 } else { 29 } else {
30 impl_ = new FilePathWatcherKQueue(); 30 impl_ = new FilePathWatcherKQueue();
31 } 31 }
32 DCHECK(impl_.get()); 32 DCHECK(impl_.get());
33 return impl_->Watch(path, recursive, callback); 33 return impl_->Watch(path, recursive, callback);
34 } 34 }
35 35
36 virtual void Cancel() OVERRIDE { 36 virtual void Cancel() OVERRIDE {
37 if (impl_) 37 if (impl_.get())
38 impl_->Cancel(); 38 impl_->Cancel();
39 set_cancelled(); 39 set_cancelled();
40 } 40 }
41 41
42 virtual void CancelOnMessageLoopThread() OVERRIDE { 42 virtual void CancelOnMessageLoopThread() OVERRIDE {
43 if (impl_) 43 if (impl_.get())
44 impl_->Cancel(); 44 impl_->Cancel();
45 set_cancelled(); 45 set_cancelled();
46 } 46 }
47 47
48 protected: 48 protected:
49 virtual ~FilePathWatcherImpl() {} 49 virtual ~FilePathWatcherImpl() {}
50 50
51 scoped_refptr<PlatformDelegate> impl_; 51 scoped_refptr<PlatformDelegate> impl_;
52 }; 52 };
53 53
54 } // namespace 54 } // namespace
55 55
56 FilePathWatcher::FilePathWatcher() { 56 FilePathWatcher::FilePathWatcher() {
57 impl_ = new FilePathWatcherImpl(); 57 impl_ = new FilePathWatcherImpl();
58 } 58 }
59 59
60 } // namespace base 60 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698