summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorsverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 14:34:30 +0000
committersverrir@google.com <sverrir@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-09 14:34:30 +0000
commitbde7e14ca4870dcac91c9387f87b80e93d004822 (patch)
tree437b067a996a5fa02a1a3bf065a03b3f98a570e8 /chrome/browser/printing
parentdaee4970727d0bb40b9c4f29895e50253ba38d7e (diff)
downloadchromium_src-bde7e14ca4870dcac91c9387f87b80e93d004822.zip
chromium_src-bde7e14ca4870dcac91c9387f87b80e93d004822.tar.gz
chromium_src-bde7e14ca4870dcac91c9387f87b80e93d004822.tar.bz2
I've seen recently a race condition while debugging printing. The pages are not sent from the renderer quickly enough which causes the print thread to hang (no new page notifications are sent any more).
This change simply adds a poll every half a second for a new page. BUG=none TEST=none Review URL: http://codereview.chromium.org/149390 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20261 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/print_job_worker.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index d8c2d83..caf5ad3 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -166,7 +166,11 @@ void PrintJobWorker::OnNewPage() {
// Is the page available?
scoped_refptr<PrintedPage> page;
if (!document_->GetPage(page_number_.ToInt(), &page)) {
- // The page is implicitly requested.
+ // We need to wait for the page to be available.
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ NewRunnableMethod(this, &PrintJobWorker::OnNewPage),
+ 500);
break;
}
// The page is there, print it.