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

Unified Diff: chrome/browser/extensions/system_info_event_router.h

Issue 10905171: Add systemInfo.cpu.onUpdated event implementation. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/system_info_event_router.h
diff --git a/chrome/browser/extensions/system_info_event_router.h b/chrome/browser/extensions/system_info_event_router.h
index a6e22a930f9bf03f91c77a55c10d241b41496f85..f239b1a34806353f095b8903f09314afb72ff5b6 100644
--- a/chrome/browser/extensions/system_info_event_router.h
+++ b/chrome/browser/extensions/system_info_event_router.h
@@ -13,6 +13,12 @@
namespace extensions {
+namespace api {
+namespace experimental_system_info_cpu {
benwells 2012/09/21 08:19:50 Nit: extra blank lines after each namespace statem
Hongbo Min 2012/09/21 09:00:23 Done.
+struct CpuUpdateInfo;
+}
+}
+
// Event router for systemInfo API. It is a singleton instance shared by
// multiple profiles.
// TODO(hongbo): It should derive from SystemMonitor::DevicesChangedObserver.
@@ -46,11 +52,15 @@ class SystemInfoEventRouter {
SystemInfoEventRouter();
virtual ~SystemInfoEventRouter();
- // Called on the UI thread to dispatch the systemInfo event to all extension
+ // Called from any thread to dispatch the systemInfo event to all extension
// processes cross multiple profiles.
void DispatchEvent(const std::string& event_name,
scoped_ptr<base::ListValue> args);
+ // The callback for CPU sampling cycle. Can be called from any thread.
benwells 2012/09/21 08:19:50 Is this just called from the FILE thread now?
Hongbo Min 2012/09/21 09:00:23 Yes.
benwells 2012/09/25 17:32:13 Can you updated the comment then?
+ void OnNextCpuSampling(
+ scoped_ptr<api::experimental_system_info_cpu::CpuUpdateInfo> info);
+
// Used to record the event names being watched.
std::multiset<std::string> watching_event_set_;

Powered by Google App Engine
This is Rietveld 408576698