Index: chrome/browser/printing/print_job.h |
=================================================================== |
--- chrome/browser/printing/print_job.h (revision 27386) |
+++ chrome/browser/printing/print_job.h (working copy) |
@@ -8,6 +8,7 @@ |
#include "base/basictypes.h" |
#include "base/gfx/native_widget_types.h" |
#include "base/message_loop.h" |
+#include "base/ref_counted.h" |
#include "chrome/browser/printing/print_job_worker_owner.h" |
#include "chrome/common/notification_registrar.h" |
@@ -31,8 +32,9 @@ |
// any state change. While printing, the PrintJobManager instance keeps a |
// reference to the job to be sure it is kept alive. All the code in this class |
// runs in the UI thread. |
-class PrintJob : public PrintJobWorkerOwner, |
+class PrintJob : public base::RefCountedThreadSafe<PrintJob>, |
public NotificationObserver, |
+ public PrintJobWorkerOwner, |
public MessageLoop::DestructionObserver { |
public: |
// Create a empty PrintJob. When initializing with this constructor, |
@@ -50,6 +52,13 @@ |
const NotificationDetails& details); |
// PrintJobWorkerOwner |
+ virtual void AddRef() { |
+ return base::RefCountedThreadSafe<PrintJob>::AddRef(); |
+ } |
+ virtual void Release() { |
+ return base::RefCountedThreadSafe<PrintJob>::Release(); |
+ } |
+ |
virtual void GetSettingsDone(const PrintSettings& new_settings, |
PrintingContext::Result result); |
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner); |