| Index: chrome/renderer/user_script_idle_scheduler.cc
|
| diff --git a/chrome/renderer/user_script_idle_scheduler.cc b/chrome/renderer/user_script_idle_scheduler.cc
|
| index 2468bf13e4ded8254c356ba828c21fdef2ac788a..9336a9de147631cbc27a7b1ed7edd0899d5765ca 100644
|
| --- a/chrome/renderer/user_script_idle_scheduler.cc
|
| +++ b/chrome/renderer/user_script_idle_scheduler.cc
|
| @@ -37,11 +37,16 @@ void UserScriptIdleScheduler::Cancel() {
|
| }
|
|
|
| void UserScriptIdleScheduler::MaybeRun() {
|
| - if (!view_)
|
| + if (!view_ || has_run())
|
| return;
|
|
|
| + // Note: we must set this before calling OnUserScriptIdleTriggered, because
|
| + // that may result in a synchronous call back into MaybeRun if there is a
|
| + // pending task currently in the queue.
|
| + // http://code.google.com/p/chromium/issues/detail?id=29644
|
| + has_run_ = true;
|
| +
|
| DCHECK(frame_);
|
| view_->OnUserScriptIdleTriggered(frame_);
|
| Cancel();
|
| - has_run_ = true;
|
| }
|
|
|