Skip to content

Commit

Permalink
Delete MessageLoop::Run()/RunUntilIdle().
Browse files Browse the repository at this point in the history
These methods are deprecated and no longer used in Chrome.
base::RunLoop must be used instead.

e.g.:

Replace
  message_loop.Run();
With
  base::RunLoop run_loop;
  // Pass |run_loop.QuitClosure()| to an object/task
  // that will quit the RunLoop when appropriate.
  run_loop.Run();

Replace
  message_loop.RunUntilIdle();
With
  base::RunLoop().RunUntilIdle();

BUG=616447

Review-Url: https://codereview.chromium.org/2356383003
Cr-Commit-Position: refs/heads/master@{#421068}
  • Loading branch information
fdoray authored and Commit bot committed Sep 27, 2016
1 parent 97270b3 commit 21ffea6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
12 changes: 0 additions & 12 deletions base/message_loop/message_loop.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,6 @@ void MessageLoop::RemoveNestingObserver(NestingObserver* observer) {
nesting_observers_.RemoveObserver(observer);
}

void MessageLoop::Run() {
DCHECK(pump_);
RunLoop run_loop;
run_loop.Run();
}

void MessageLoop::RunUntilIdle() {
DCHECK(pump_);
RunLoop run_loop;
run_loop.RunUntilIdle();
}

void MessageLoop::QuitWhenIdle() {
DCHECK_EQ(this, current());
if (run_loop_) {
Expand Down
23 changes: 0 additions & 23 deletions base/message_loop/message_loop.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,23 +178,6 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
void AddNestingObserver(NestingObserver* observer);
void RemoveNestingObserver(NestingObserver* observer);

#if defined(OS_MACOSX) && !defined(OS_IOS)
protected:
#endif // defined(OS_MACOSX) && !defined(OS_IOS)

// Deprecated: use RunLoop instead.
// Run the message loop.
void Run();

// Deprecated: use RunLoop instead.
// Process all pending tasks, windows messages, etc., but don't wait/sleep.
// Return as soon as all items that can be run are taken care of.
void RunUntilIdle();

#if defined(OS_MACOSX) && !defined(OS_IOS)
public:
#endif // defined(OS_MACOSX) && !defined(OS_IOS)

// Deprecated: use RunLoop instead.
//
// Signals the Run method to return when it becomes idle. It will continue to
Expand Down Expand Up @@ -506,9 +489,6 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
//
class BASE_EXPORT MessageLoopForUI : public MessageLoop {
public:
using MessageLoop::Run;
using MessageLoop::RunUntilIdle;

MessageLoopForUI() : MessageLoop(TYPE_UI) {
}

Expand Down Expand Up @@ -574,9 +554,6 @@ static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
//
class BASE_EXPORT MessageLoopForIO : public MessageLoop {
public:
using MessageLoop::Run;
using MessageLoop::RunUntilIdle;

MessageLoopForIO() : MessageLoop(TYPE_IO) {
}

Expand Down

0 comments on commit 21ffea6

Please sign in to comment.