summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing/print_view_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/printing/print_view_manager.cc')
-rw-r--r--chrome/browser/printing/print_view_manager.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc
index 39e3bda..1157d64 100644
--- a/chrome/browser/printing/print_view_manager.cc
+++ b/chrome/browser/printing/print_view_manager.cc
@@ -492,12 +492,12 @@ bool PrintViewManager::RunInnerMessageLoop() {
// be cpu bound, the page overly complex/large or the system just
// memory-bound.
static const int kPrinterSettingsTimeout = 60000;
- MessageLoop::QuitTask timeout_task;
- Timer* timeout = MessageLoop::current()->timer_manager()->StartTimer(
- kPrinterSettingsTimeout,
- &timeout_task,
- false);
+ base::OneShotTimer<MessageLoop> quit_timer;
+ quit_timer.Start(TimeDelta::FromMilliseconds(kPrinterSettingsTimeout),
+ MessageLoop::current(), &MessageLoop::Quit);
+
inside_inner_message_loop_ = true;
+
// Need to enable recursive task.
bool old_state = MessageLoop::current()->NestableTasksAllowed();
MessageLoop::current()->SetNestableTasksAllowed(true);
@@ -512,11 +512,6 @@ bool PrintViewManager::RunInnerMessageLoop() {
success = false;
}
- if (timeout) {
- MessageLoop::current()->timer_manager()->StopTimer(timeout);
- delete timeout;
- timeout = NULL;
- }
return success;
}