diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 01:55:48 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-06 01:55:48 +0000 |
commit | 7991a2336f3e5b975d5f31ffa24f129eb8bf32ad (patch) | |
tree | 52df10a63cfa787c42796566263fcb81c6517d4f /chrome/browser/printing | |
parent | 6e82c3c6c3860a1005c96f4f6c138aa79a56d685 (diff) | |
download | chromium_src-7991a2336f3e5b975d5f31ffa24f129eb8bf32ad.zip chromium_src-7991a2336f3e5b975d5f31ffa24f129eb8bf32ad.tar.gz chromium_src-7991a2336f3e5b975d5f31ffa24f129eb8bf32ad.tar.bz2 |
Seventh patch in making destructors of refcounted objects private.
BUG=26749
Review URL: http://codereview.chromium.org/371006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31192 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing')
-rw-r--r-- | chrome/browser/printing/print_job.h | 8 | ||||
-rw-r--r-- | chrome/browser/printing/print_job_unittest.cc | 2 | ||||
-rw-r--r-- | chrome/browser/printing/print_job_worker_owner.h | 7 | ||||
-rw-r--r-- | chrome/browser/printing/printer_query.h | 3 |
4 files changed, 14 insertions, 6 deletions
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h index 3d0353f..eec13db 100644 --- a/chrome/browser/printing/print_job.h +++ b/chrome/browser/printing/print_job.h @@ -38,7 +38,6 @@ class PrintJob : public PrintJobWorkerOwner, // Create a empty PrintJob. When initializing with this constructor, // post-constructor initialization must be done with Initialize(). PrintJob(); - virtual ~PrintJob(); // Grabs the ownership of the PrintJobWorker from another job, which is // usually a PrinterQuery. @@ -92,6 +91,8 @@ class PrintJob : public PrintJobWorkerOwner, // Access the current printed document. Warning: may be NULL. PrintedDocument* document() const; + protected: + virtual ~PrintJob(); private: // Updates document_ to a new instance. @@ -181,7 +182,6 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> { }; JobEventDetails(Type type, PrintedDocument* document, PrintedPage* page); - ~JobEventDetails(); // Getters. PrintedDocument* document() const; @@ -191,6 +191,10 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> { } private: + friend class base::RefCountedThreadSafe<JobEventDetails>; + + ~JobEventDetails(); + scoped_refptr<PrintedDocument> document_; scoped_refptr<PrintedPage> page_; const Type type_; diff --git a/chrome/browser/printing/print_job_unittest.cc b/chrome/browser/printing/print_job_unittest.cc index 8c79e6a..87d7efa 100644 --- a/chrome/browser/printing/print_job_unittest.cc +++ b/chrome/browser/printing/print_job_unittest.cc @@ -65,10 +65,10 @@ class TestPrintJob : public printing::PrintJob { public: explicit TestPrintJob(volatile bool* check) : check_(check) { } + private: ~TestPrintJob() { *check_ = true; } - private: volatile bool* check_; }; diff --git a/chrome/browser/printing/print_job_worker_owner.h b/chrome/browser/printing/print_job_worker_owner.h index e1ba719..510f15f 100644 --- a/chrome/browser/printing/print_job_worker_owner.h +++ b/chrome/browser/printing/print_job_worker_owner.h @@ -18,8 +18,6 @@ class PrintSettings; class PrintJobWorkerOwner : public base::RefCountedThreadSafe<PrintJobWorkerOwner> { public: - virtual ~PrintJobWorkerOwner() { - } // Finishes the initialization began by PrintJobWorker::Init(). Creates a // new PrintedDocument if necessary. Solely meant to be called by @@ -38,6 +36,11 @@ class PrintJobWorkerOwner : // Cookie uniquely identifying the PrintedDocument and/or loaded settings. virtual int cookie() const = 0; + + protected: + friend class base::RefCountedThreadSafe<PrintJobWorkerOwner>; + + virtual ~PrintJobWorkerOwner() {} }; } // namespace printing diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h index b4826ec..b9c2734 100644 --- a/chrome/browser/printing/printer_query.h +++ b/chrome/browser/printing/printer_query.h @@ -30,7 +30,6 @@ class PrinterQuery : public PrintJobWorkerOwner { }; PrinterQuery(); - virtual ~PrinterQuery(); // PrintJobWorkerOwner virtual void GetSettingsDone(const PrintSettings& new_settings, @@ -68,6 +67,8 @@ class PrinterQuery : public PrintJobWorkerOwner { bool is_valid() const; private: + virtual ~PrinterQuery(); + // Main message loop reference. Used to send notifications in the right // thread. MessageLoop* const ui_message_loop_; |