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

Side by Side Diff: base/system_monitor/system_monitor.h

Issue 10917243: Document bad pattern in base::SystemMonitor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ 5 #ifndef BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_
6 #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ 6 #define BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Must not be called from within a notification callback. 152 // Must not be called from within a notification callback.
153 void AddPowerObserver(PowerObserver* obs); 153 void AddPowerObserver(PowerObserver* obs);
154 void AddDevicesChangedObserver(DevicesChangedObserver* obs); 154 void AddDevicesChangedObserver(DevicesChangedObserver* obs);
155 155
156 // Remove an existing observer. 156 // Remove an existing observer.
157 // Can be called from any thread. 157 // Can be called from any thread.
158 // Must not be called from within a notification callback. 158 // Must not be called from within a notification callback.
159 void RemovePowerObserver(PowerObserver* obs); 159 void RemovePowerObserver(PowerObserver* obs);
160 void RemoveDevicesChangedObserver(DevicesChangedObserver* obs); 160 void RemoveDevicesChangedObserver(DevicesChangedObserver* obs);
161 161
162 // The ProcessFoo() style methods are a broken pattern and should not
163 // be copied. Any significant addition to this class is blocked on
164 // refactoring to improve the state of affairs. See http://crbug.com/149059
165
162 #if defined(OS_WIN) 166 #if defined(OS_WIN)
163 // Windows-specific handling of a WM_POWERBROADCAST message. 167 // Windows-specific handling of a WM_POWERBROADCAST message.
164 // Embedders of this API should hook their top-level window 168 // Embedders of this API should hook their top-level window
165 // message loop and forward WM_POWERBROADCAST through this call. 169 // message loop and forward WM_POWERBROADCAST through this call.
166 void ProcessWmPowerBroadcastMessage(int event_id); 170 void ProcessWmPowerBroadcastMessage(int event_id);
167 #endif 171 #endif
168 172
169 // Cross-platform handling of a power event. 173 // Cross-platform handling of a power event.
170 void ProcessPowerMessage(PowerEvent event_id); 174 void ProcessPowerMessage(PowerEvent event_id);
171 175
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 225
222 // Map of all the attached removable storage devices. 226 // Map of all the attached removable storage devices.
223 RemovableStorageMap removable_storage_map_; 227 RemovableStorageMap removable_storage_map_;
224 228
225 DISALLOW_COPY_AND_ASSIGN(SystemMonitor); 229 DISALLOW_COPY_AND_ASSIGN(SystemMonitor);
226 }; 230 };
227 231
228 } // namespace base 232 } // namespace base
229 233
230 #endif // BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_ 234 #endif // BASE_SYSTEM_MONITOR_SYSTEM_MONITOR_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698