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

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

Issue 7583053: Add MessageLoopProxy::current (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No need for MessageLoopProxy destruction observer. Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « base/files/file_path_watcher_mac.cc ('k') | base/message_loop.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 // |last_modified_| time stamp. 74 // |last_modified_| time stamp.
75 base::Time first_notification_; 75 base::Time first_notification_;
76 76
77 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl); 77 DISALLOW_COPY_AND_ASSIGN(FilePathWatcherImpl);
78 }; 78 };
79 79
80 bool FilePathWatcherImpl::Watch(const FilePath& path, 80 bool FilePathWatcherImpl::Watch(const FilePath& path,
81 FilePathWatcher::Delegate* delegate) { 81 FilePathWatcher::Delegate* delegate) {
82 DCHECK(target_.value().empty()); // Can only watch one path. 82 DCHECK(target_.value().empty()); // Can only watch one path.
83 83
84 set_message_loop(base::MessageLoopProxy::CreateForCurrentThread()); 84 set_message_loop(base::MessageLoopProxy::current());
85 delegate_ = delegate; 85 delegate_ = delegate;
86 target_ = path; 86 target_ = path;
87 MessageLoop::current()->AddDestructionObserver(this); 87 MessageLoop::current()->AddDestructionObserver(this);
88 88
89 if (!UpdateWatch()) 89 if (!UpdateWatch())
90 return false; 90 return false;
91 91
92 watcher_.StartWatching(handle_, this); 92 watcher_.StartWatching(handle_, this);
93 93
94 return true; 94 return true;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 } 272 }
273 273
274 } // namespace 274 } // namespace
275 275
276 FilePathWatcher::FilePathWatcher() { 276 FilePathWatcher::FilePathWatcher() {
277 impl_ = new FilePathWatcherImpl(); 277 impl_ = new FilePathWatcherImpl();
278 } 278 }
279 279
280 } // namespace files 280 } // namespace files
281 } // namespace base 281 } // namespace base
OLDNEW
« no previous file with comments | « base/files/file_path_watcher_mac.cc ('k') | base/message_loop.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698