summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 03:01:37 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-30 03:01:37 +0000
commitd8c9cd5cf3398125c80bd2effc402a732491e3d9 (patch)
tree0ac98ebd3c98fa23f175d28bce031fd55d5c845f /chrome/browser/printing
parentc05fcd65d017eef9a92272f8544013cc368356b3 (diff)
downloadchromium_src-d8c9cd5cf3398125c80bd2effc402a732491e3d9.zip
chromium_src-d8c9cd5cf3398125c80bd2effc402a732491e3d9.tar.gz
chromium_src-d8c9cd5cf3398125c80bd2effc402a732491e3d9.tar.bz2
Add a DCHECK for the thread PrinterQuery and PrintJobs get created on.
BUG=none TEST=none Review URL: http://codereview.chromium.org/5276011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67660 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r--chrome/browser/printing/print_job.cc10
-rw-r--r--chrome/browser/printing/print_job.h3
-rw-r--r--chrome/browser/printing/printer_query.cc9
3 files changed, 9 insertions, 13 deletions
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
index 245c01a..df9df0f 100644
--- a/chrome/browser/printing/print_job.cc
+++ b/chrome/browser/printing/print_job.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -11,10 +11,6 @@
#include "printing/printed_document.h"
#include "printing/printed_page.h"
-#ifdef _MSC_VER
-#pragma warning(disable:4355) // 'this' : used in base member initializer list
-#endif
-
using base::TimeDelta;
namespace printing {
@@ -28,6 +24,10 @@ PrintJob::PrintJob()
is_print_dialog_box_shown_(false),
is_canceling_(false) {
DCHECK(ui_message_loop_);
+ // This is normally a UI message loop, but in unit tests, the message loop is
+ // of the 'default' type.
+ DCHECK(ui_message_loop_->type() == MessageLoop::TYPE_UI ||
+ ui_message_loop_->type() == MessageLoop::TYPE_DEFAULT);
ui_message_loop_->AddDestructionObserver(this);
}
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h
index b4eeb97..e78f1a9 100644
--- a/chrome/browser/printing/print_job.h
+++ b/chrome/browser/printing/print_job.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,7 +12,6 @@
#include "chrome/browser/printing/print_job_worker_owner.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
-#include "gfx/native_widget_types.h"
class GURL;
class Thread;
diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc
index 9b5772fb..0b776e2 100644
--- a/chrome/browser/printing/printer_query.cc
+++ b/chrome/browser/printing/printer_query.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -7,18 +7,15 @@
#include "base/message_loop.h"
#include "chrome/browser/printing/print_job_worker.h"
-#ifdef _MSC_VER
-#pragma warning(disable:4355) // 'this' : used in base member initializer list
-#endif
-
namespace printing {
PrinterQuery::PrinterQuery()
: ui_message_loop_(MessageLoop::current()),
- worker_(new PrintJobWorker(this)),
+ ALLOW_THIS_IN_INITIALIZER_LIST(worker_(new PrintJobWorker(this))),
is_print_dialog_box_shown_(false),
cookie_(PrintSettings::NewCookie()),
last_status_(PrintingContext::FAILED) {
+ DCHECK_EQ(ui_message_loop_->type(), MessageLoop::TYPE_UI);
}
PrinterQuery::~PrinterQuery() {