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

Side by Side Diff: chrome/browser/sync/profile_sync_test_util.cc

Issue 1143343005: chrome/browser: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 6 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
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 "chrome/browser/sync/profile_sync_test_util.h" 5 #include "chrome/browser/sync/profile_sync_test_util.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h"
8 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
9 11
10 using content::BrowserThread; 12 using content::BrowserThread;
11 13
12 SyncServiceObserverMock::SyncServiceObserverMock() { 14 SyncServiceObserverMock::SyncServiceObserverMock() {
13 } 15 }
14 16
15 SyncServiceObserverMock::~SyncServiceObserverMock() { 17 SyncServiceObserverMock::~SyncServiceObserverMock() {
16 } 18 }
17 19
18 ThreadNotifier::ThreadNotifier(base::Thread* notify_thread) 20 ThreadNotifier::ThreadNotifier(base::Thread* notify_thread)
19 : done_event_(false, false), 21 : done_event_(false, false),
20 notify_thread_(notify_thread) {} 22 notify_thread_(notify_thread) {}
21 23
22 void ThreadNotifier::Notify(int type, 24 void ThreadNotifier::Notify(int type,
23 const content::NotificationDetails& details) { 25 const content::NotificationDetails& details) {
24 Notify(type, content::NotificationService::AllSources(), details); 26 Notify(type, content::NotificationService::AllSources(), details);
25 } 27 }
26 28
27 void ThreadNotifier::Notify(int type, 29 void ThreadNotifier::Notify(int type,
28 const content::NotificationSource& source, 30 const content::NotificationSource& source,
29 const content::NotificationDetails& details) { 31 const content::NotificationDetails& details) {
30 DCHECK_CURRENTLY_ON(BrowserThread::UI); 32 DCHECK_CURRENTLY_ON(BrowserThread::UI);
31 notify_thread_->message_loop()->PostTask( 33 notify_thread_->task_runner()->PostTask(
32 FROM_HERE, 34 FROM_HERE,
33 base::Bind(&ThreadNotifier::NotifyTask, this, type, source, details)); 35 base::Bind(&ThreadNotifier::NotifyTask, this, type, source, details));
34 done_event_.Wait(); 36 done_event_.Wait();
35 } 37 }
36 38
37 ThreadNotifier::~ThreadNotifier() {} 39 ThreadNotifier::~ThreadNotifier() {}
38 40
39 void ThreadNotifier::NotifyTask(int type, 41 void ThreadNotifier::NotifyTask(int type,
40 const content::NotificationSource& source, 42 const content::NotificationSource& source,
41 const content::NotificationDetails& details) { 43 const content::NotificationDetails& details) {
42 content::NotificationService::current()->Notify(type, source, details); 44 content::NotificationService::current()->Notify(type, source, details);
43 done_event_.Signal(); 45 done_event_.Signal();
44 } 46 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_unittest.cc ('k') | chrome/browser/sync/startup_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698