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

Side by Side Diff: base/files/file_path_watcher_browsertest.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/file_util_proxy.cc ('k') | base/files/file_path_watcher_linux.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) 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 <set> 7 #include <set>
8 8
9 #if defined(OS_WIN) 9 #if defined(OS_WIN)
10 #include <windows.h> 10 #include <windows.h>
(...skipping 23 matching lines...) Expand all
34 namespace { 34 namespace {
35 35
36 class TestDelegate; 36 class TestDelegate;
37 37
38 // Aggregates notifications from the test delegates and breaks the message loop 38 // Aggregates notifications from the test delegates and breaks the message loop
39 // the test thread is waiting on once they all came in. 39 // the test thread is waiting on once they all came in.
40 class NotificationCollector 40 class NotificationCollector
41 : public base::RefCountedThreadSafe<NotificationCollector> { 41 : public base::RefCountedThreadSafe<NotificationCollector> {
42 public: 42 public:
43 NotificationCollector() 43 NotificationCollector()
44 : loop_(base::MessageLoopProxy::CreateForCurrentThread()) {} 44 : loop_(base::MessageLoopProxy::current()) {}
45 45
46 // Called from the file thread by the delegates. 46 // Called from the file thread by the delegates.
47 void OnChange(TestDelegate* delegate) { 47 void OnChange(TestDelegate* delegate) {
48 loop_->PostTask(FROM_HERE, 48 loop_->PostTask(FROM_HERE,
49 NewRunnableMethod(this, 49 NewRunnableMethod(this,
50 &NotificationCollector::RecordChange, 50 &NotificationCollector::RecordChange,
51 make_scoped_refptr(delegate))); 51 make_scoped_refptr(delegate)));
52 } 52 }
53 53
54 void Register(TestDelegate* delegate) { 54 void Register(TestDelegate* delegate) {
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false)); 619 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, false));
620 ASSERT_TRUE(WaitForEvents()); 620 ASSERT_TRUE(WaitForEvents());
621 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true)); 621 ASSERT_TRUE(ChangeFilePermissions(test_dir1, Execute, true));
622 } 622 }
623 623
624 #endif // OS_MACOSX 624 #endif // OS_MACOSX
625 } // namespace 625 } // namespace
626 626
627 } // namespace files 627 } // namespace files
628 } // namespace base 628 } // namespace base
OLDNEW
« no previous file with comments | « base/file_util_proxy.cc ('k') | base/files/file_path_watcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698