Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(677)

Unified Diff: content/browser/power_save_blocker_linux.cc

Issue 10392152: RefCounted types should not have public destructors, Linux fixes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/power_save_blocker_linux.cc
diff --git a/content/browser/power_save_blocker_linux.cc b/content/browser/power_save_blocker_linux.cc
index 3d232da1905476211d49c049936eb3c4a68eec7b..b0c3ae072779f4e62b406923d0bfe79c511c0c8d 100644
--- a/content/browser/power_save_blocker_linux.cc
+++ b/content/browser/power_save_blocker_linux.cc
@@ -71,9 +71,14 @@ class DBusPowerSaveBlocker {
class Delegate : public base::RefCountedThreadSafe<Delegate> {
public:
Delegate() {}
- virtual ~Delegate() {}
virtual void ApplyBlock(PowerSaveBlocker::PowerSaveBlockerType type) = 0;
+
+ protected:
+ virtual ~Delegate() {}
+
private:
+ friend class base::RefCountedThreadSafe<Delegate>;
+
DISALLOW_COPY_AND_ASSIGN(Delegate);
};
@@ -120,7 +125,6 @@ class KDEPowerSaveBlocker : public DBusPowerSaveBlocker::Delegate {
pending_inhibit_call_(false),
postponed_uninhibit_call_(false) {
}
- ~KDEPowerSaveBlocker() {}
virtual void ApplyBlock(
PowerSaveBlocker::PowerSaveBlockerType type) OVERRIDE {
@@ -195,6 +199,9 @@ class KDEPowerSaveBlocker : public DBusPowerSaveBlocker::Delegate {
bus_callback);
}
+ protected:
+ virtual ~KDEPowerSaveBlocker() {}
+
private:
// Inhibit() response callback.
// Stores the cookie so we can use it later when calling UnInhibit().
@@ -258,7 +265,6 @@ class GnomePowerSaveBlocker : public DBusPowerSaveBlocker::Delegate {
: inhibit_cookie_(0),
pending_inhibit_calls_(0),
postponed_uninhibit_calls_(0) {}
- ~GnomePowerSaveBlocker() {}
virtual void ApplyBlock(
PowerSaveBlocker::PowerSaveBlockerType type) OVERRIDE {
@@ -368,6 +374,9 @@ class GnomePowerSaveBlocker : public DBusPowerSaveBlocker::Delegate {
bus_callback);
}
+ protected:
+ virtual ~GnomePowerSaveBlocker() {}
+
private:
// Inhibit() response callback.
// Stores the cookie so we can use it later when calling UnInhibit().

Powered by Google App Engine
This is Rietveld 408576698