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

Side by Side Diff: base/callback_handle.h

Issue 22877038: Add a CallbackRegistry class to base/ to manage callbacks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: List --> Registry, Closure --> Handle Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/power_monitor/power_monitor_device_source.h" 5 #ifndef BASE_CALLBACK_HANDLE_H_
6 #define BASE_CALLBACK_HANDLE_H_
6 7
7 namespace base { 8 namespace base {
8 9
9 bool PowerMonitorDeviceSource::IsOnBatteryPowerImpl() { 10 class CallbackHandle {
awong 2013/09/06 19:03:24 Are you expecting to forward declare this class?
Cait (Slow) 2013/09/06 19:18:37 I think it makes sense to have a top-level base-cl
awong 2013/09/06 19:31:02 Gotcha. I'd still move it back into callback_regi
Cait (Slow) 2013/09/06 20:18:31 I don't think moving it into callback_registry.h w
10 NOTIMPLEMENTED(); 11 public:
11 return false; 12 virtual ~CallbackHandle() {}
erikwright (departed) 2013/09/06 21:01:07 Add an '= 0' here to force this class to be derive
Bernhard Bauer 2013/09/06 21:08:58 That won't work. Every class needs to have a destr
awong 2013/09/06 23:49:30 I might be wrong, but I thought the pattern was to
erikwright (departed) 2013/09/09 16:09:38 You can define it but still mark it pure virtual:
Bernhard Bauer 2013/09/09 16:40:17 Oh, wow. TIL :)
12 } 13 };
13 14
14 } // namespace base 15 } // namespace base
16
17 #endif // BASE_CALLBACK_HANDLE_H_
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/callback_registry.h » ('j') | base/callback_registry.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698