summaryrefslogtreecommitdiffstats
path: root/chrome/browser/printing/printer_query.h
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 18:12:55 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-28 18:12:55 +0000
commit13f383ff5fc8ff095501794d4ce758f0067ff9b5 (patch)
treeceb1d08f38759bf8805ede009924a990bae496e5 /chrome/browser/printing/printer_query.h
parentf61f331824ac9c98684a886be0d918aefe69d3ce (diff)
downloadchromium_src-13f383ff5fc8ff095501794d4ce758f0067ff9b5.zip
chromium_src-13f383ff5fc8ff095501794d4ce758f0067ff9b5.tar.gz
chromium_src-13f383ff5fc8ff095501794d4ce758f0067ff9b5.tar.bz2
Assert that thread-safe reference counting is used with
cross-thread NewRunnableMethod. This assertion caught such an error in VisitedLinkMaster! My approach, modify RunnableMethodTraits<T> to assert that when ReleaseCallee happens on a different thread from RetainCallee that the type supports thread-safe reference counting. I do this by adding a static method to both RefCounted<T> and RefCountedThreadSafe<T>. This results in a little ugliness in cases where people implement AddRef and Release by hand (to make the no-ops). There may be a nicer way to deal with those few cases. R=brettw BUG=none TEST=none Review URL: http://codereview.chromium.org/251012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27379 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/printing/printer_query.h')
-rw-r--r--chrome/browser/printing/printer_query.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h
index 6d6fd88..b0502c8 100644
--- a/chrome/browser/printing/printer_query.h
+++ b/chrome/browser/printing/printer_query.h
@@ -6,7 +6,6 @@
#define CHROME_BROWSER_PRINTING_PRINTER_QUERY_H_
#include "base/scoped_ptr.h"
-#include "base/ref_counted.h"
#include "chrome/browser/printing/print_job_worker_owner.h"
class CancelableTask;
@@ -21,8 +20,7 @@ namespace printing {
class PrintJobWorker;
// Query the printer for settings.
-class PrinterQuery : public base::RefCountedThreadSafe<PrinterQuery>,
- public PrintJobWorkerOwner {
+class PrinterQuery : public PrintJobWorkerOwner {
public:
// GetSettings() UI parameter.
enum GetSettingsAskParam {
@@ -34,12 +32,6 @@ class PrinterQuery : public base::RefCountedThreadSafe<PrinterQuery>,
virtual ~PrinterQuery();
// PrintJobWorkerOwner
- virtual void AddRef() {
- return base::RefCountedThreadSafe<PrinterQuery>::AddRef();
- }
- virtual void Release() {
- return base::RefCountedThreadSafe<PrinterQuery>::Release();
- }
virtual void GetSettingsDone(const PrintSettings& new_settings,
PrintingContext::Result result);
virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner);