Skip to content

Commit

Permalink
Use base::MessageLoop in more files.
Browse files Browse the repository at this point in the history
These are either missed in the first pass, or added after the first pass.

TBR=thestig@chromium.org
BUG=236029

Review URL: https://codereview.chromium.org/16092013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203259 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
xhwang@chromium.org committed May 30, 2013
1 parent e1bcc02 commit 9e71541
Show file tree
Hide file tree
Showing 62 changed files with 143 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AwFormDatabaseServiceTest : public Test {
// The path to the temporary directory used for the test operations.
base::ScopedTempDir temp_dir_;
// A message loop for UI thread.
MessageLoop message_loop_;
base::MessageLoop message_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread db_thread_;
JNIEnv* env_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ int GetInProcessRendererId() {

}

MessageLoop* InProcessRendererClient::OverrideCompositorMessageLoop() const {
MessageLoop* rv = content::BrowserThread::UnsafeGetMessageLoopForThread(
base::MessageLoop* InProcessRendererClient::OverrideCompositorMessageLoop()
const {
base::MessageLoop* rv = content::BrowserThread::UnsafeGetMessageLoopForThread(
content::BrowserThread::UI);
DCHECK(rv);
return rv;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ void InProcessViewRenderer::Invalidate() {

void InProcessViewRenderer::EnsureContinuousInvalidation() {
if (continuous_invalidate_ && !continuous_invalidate_task_pending_) {
MessageLoop::current()->PostTask(FROM_HERE,
base::MessageLoop::current()->PostTask(FROM_HERE,
base::Bind(&InProcessViewRenderer::Invalidate,
weak_factory_.GetWeakPtr()));
continuous_invalidate_task_pending_ = true;
Expand Down
2 changes: 1 addition & 1 deletion apps/shell_window_geometry_cache_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class ShellWindowGeometryCacheTest : public testing::Test {

protected:
TestingProfile profile_;
MessageLoopForUI ui_message_loop_;
base::MessageLoopForUI ui_message_loop_;
content::TestBrowserThread ui_thread_;
scoped_ptr<extensions::TestExtensionPrefs> prefs_;
scoped_ptr<ShellWindowGeometryCache> cache_;
Expand Down
2 changes: 1 addition & 1 deletion ash/system/web_notification/web_notification_tray.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void WebNotificationTray::OnMessageCenterTrayChanged() {
// consecutively, and calling Update in the middle of those events will show
// intermediate unread counts for a moment.
should_update_tray_content_ = true;
MessageLoop::current()->PostTask(
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&WebNotificationTray::UpdateTrayContent, AsWeakPtr()));
}
Expand Down
2 changes: 1 addition & 1 deletion ash/test/ash_test_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void AshTestHelper::TearDown() {

void AshTestHelper::RunAllPendingInMessageLoop() {
#if !defined(OS_MACOSX)
DCHECK(MessageLoopForUI::current() == message_loop_);
DCHECK(base::MessageLoopForUI::current() == message_loop_);
base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
run_loop.RunUntilIdle();
#endif
Expand Down
2 changes: 1 addition & 1 deletion base/deferred_sequenced_task_runner_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class DeferredSequencedTaskRunnerTest : public testing::Test,
new base::DeferredSequencedTaskRunner(loop_.message_loop_proxy())) {
}

MessageLoop loop_;
base::MessageLoop loop_;
scoped_refptr<base::DeferredSequencedTaskRunner> runner_;
mutable base::Lock lock_;
std::vector<int> executed_task_ids_;
Expand Down
2 changes: 1 addition & 1 deletion base/hi_res_timer_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#if defined(OS_WIN)
// http://crbug.com/114048
TEST(HiResTimerManagerTest, DISABLED_ToggleOnOff) {
MessageLoop loop;
base::MessageLoop loop;
scoped_ptr<base::PowerMonitor> power_monitor(new base::PowerMonitor());
HighResolutionTimerManager manager;

Expand Down
11 changes: 6 additions & 5 deletions base/mac/libdispatch_task_runner_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class LibDispatchTaskRunnerTest : public testing::Test {
void DispatchLastTask() {
dispatch_async(task_runner_->GetDispatchQueue(), ^{
(&message_loop_)->PostTask(FROM_HERE,
MessageLoop::QuitWhenIdleClosure());
base::MessageLoop::QuitWhenIdleClosure());
});
message_loop_.Run();
task_runner_->Shutdown();
Expand Down Expand Up @@ -52,7 +52,7 @@ class LibDispatchTaskRunnerTest : public testing::Test {
}

// The message loop for the test main thread.
MessageLoop message_loop_;
base::MessageLoop message_loop_;

// The task runner under test.
scoped_refptr<base::mac::LibDispatchTaskRunner> task_runner_;
Expand Down Expand Up @@ -117,7 +117,7 @@ TEST_F(LibDispatchTaskRunnerTest, PostTaskWithinTask) {
TEST_F(LibDispatchTaskRunnerTest, NoMessageLoop) {
task_runner_->PostTask(FROM_HERE, base::BindBlock(^{
TaskOrderMarker marker(this,
base::StringPrintf("MessageLoop = %p", MessageLoop::current()));
base::StringPrintf("MessageLoop = %p", base::MessageLoop::current()));
}));
DispatchLastTask();

Expand Down Expand Up @@ -158,7 +158,7 @@ TEST_F(LibDispatchTaskRunnerTest, NonNestable) {
task_runner_->PostNonNestableTask(FROM_HERE, base::BindBlock(^{
TaskOrderMarker marker(this, "Second NonNestable");
(&message_loop_)->PostTask(FROM_HERE,
MessageLoop::QuitWhenIdleClosure());
base::MessageLoop::QuitWhenIdleClosure());
}));
}));
message_loop_.Run();
Expand All @@ -183,7 +183,8 @@ TEST_F(LibDispatchTaskRunnerTest, PostDelayed) {
task_runner_->PostDelayedTask(FROM_HERE, base::BindBlock(^{
TaskOrderMarker marker(this, "Timed");
run_time = base::TimeTicks::Now();
(&message_loop_)->PostTask(FROM_HERE, MessageLoop::QuitWhenIdleClosure());
(&message_loop_)->PostTask(FROM_HERE,
base::MessageLoop::QuitWhenIdleClosure());
}), delta);
task_runner_->PostTask(FROM_HERE, BoundRecordTaskOrder(this, "Second"));
message_loop_.Run();
Expand Down
2 changes: 1 addition & 1 deletion base/message_loop_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,7 @@ void RunTest_RecursivePosts(MessageLoop::Type message_loop_type,

#if defined(OS_WIN)

class DispatcherImpl : public MessageLoopForUI::Dispatcher {
class DispatcherImpl : public base::MessageLoopForUI::Dispatcher {
public:
DispatcherImpl() : dispatch_count_(0) {}

Expand Down
2 changes: 1 addition & 1 deletion base/prefs/pref_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void PrefService::InitFromStorage(bool async) {
read_error_callback_.Run(user_pref_store_->ReadPrefs());
} else {
// Guarantee that initialization happens after this function returned.
MessageLoop::current()->PostTask(
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&PersistentPrefStore::ReadPrefsAsync,
user_pref_store_.get(),
Expand Down
8 changes: 5 additions & 3 deletions base/threading/thread_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ class CaptureToEventList : public Thread {

// Observer that writes a value into |event_list| when a message loop has been
// destroyed.
class CapturingDestructionObserver : public MessageLoop::DestructionObserver {
class CapturingDestructionObserver
: public base::MessageLoop::DestructionObserver {
public:
// |event_list| must remain valid throughout the observer's lifetime.
explicit CapturingDestructionObserver(EventList* event_list)
Expand All @@ -106,8 +107,9 @@ class CapturingDestructionObserver : public MessageLoop::DestructionObserver {
};

// Task that adds a destruction observer to the current message loop.
void RegisterDestructionObserver(MessageLoop::DestructionObserver* observer) {
MessageLoop::current()->AddDestructionObserver(observer);
void RegisterDestructionObserver(
base::MessageLoop::DestructionObserver* observer) {
base::MessageLoop::current()->AddDestructionObserver(observer);
}

} // namespace
Expand Down
Loading

0 comments on commit 9e71541

Please sign in to comment.