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

Unified Diff: device/hid/hid_service.cc

Issue 542153004: Make the device::HidService destructor protected. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
« device/hid/hid_service.h ('K') | « device/hid/hid_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service.cc
diff --git a/device/hid/hid_service.cc b/device/hid/hid_service.cc
index c9ab2fc7ffc703b070a5351dd3e547bed2c1db9c..2dfdb896e91c3101e516f7e1f92865dff2f020b3 100644
--- a/device/hid/hid_service.cc
+++ b/device/hid/hid_service.cc
@@ -25,11 +25,13 @@ namespace {
HidService* g_service = NULL;
-class HidServiceDestroyer : public base::MessageLoop::DestructionObserver {
+} // namespace
+
+class HidService::Destroyer : public base::MessageLoop::DestructionObserver {
public:
- explicit HidServiceDestroyer(HidService* hid_service)
+ explicit Destroyer(HidService* hid_service)
: hid_service_(hid_service) {}
- virtual ~HidServiceDestroyer() {}
+ virtual ~Destroyer() {}
private:
// base::MessageLoop::DestructionObserver implementation.
@@ -43,8 +45,6 @@ class HidServiceDestroyer : public base::MessageLoop::DestructionObserver {
HidService* hid_service_;
};
-} // namespace
-
HidService* HidService::GetInstance(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
if (g_service == NULL) {
@@ -56,7 +56,7 @@ HidService* HidService::GetInstance(
g_service = new HidServiceWin();
#endif
if (g_service != NULL) {
- HidServiceDestroyer* destroyer = new HidServiceDestroyer(g_service);
+ Destroyer* destroyer = new Destroyer(g_service);
base::MessageLoop::current()->AddDestructionObserver(destroyer);
}
}
« device/hid/hid_service.h ('K') | « device/hid/hid_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698