summaryrefslogtreecommitdiffstats
path: root/base/system_monitor/system_monitor.h
diff options
context:
space:
mode:
authorjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-04 04:18:41 +0000
committerjeremy@chromium.org <jeremy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-04 04:18:41 +0000
commit7e15d35c1dbbec11794d2754ba80b0ff872d144b (patch)
tree0052e9a1223443bf45ad0a317963def153955132 /base/system_monitor/system_monitor.h
parentfa2601abcdde27adbdba2b5de8d849908ad41704 (diff)
downloadchromium_src-7e15d35c1dbbec11794d2754ba80b0ff872d144b.zip
chromium_src-7e15d35c1dbbec11794d2754ba80b0ff872d144b.tar.gz
chromium_src-7e15d35c1dbbec11794d2754ba80b0ff872d144b.tar.bz2
Mac: Split SystemMonitor initialization so it's not blocked by the Sandbox.
In OS X 10.7 Lion, the IO port we listen on to monitor system power events is blocked by the Sandbox. Move the allocation of the IO port so it happens early on during Chrome startup. BUG=83783 TEST=When putting a system to sleep with Chrome running, the browser shouldn't crash. Also, need to monitor crash logs to see that this crash goes away. Review URL: http://codereview.chromium.org/7235023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@91462 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor/system_monitor.h')
-rw-r--r--base/system_monitor/system_monitor.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h
index e2de14c..78ab50a 100644
--- a/base/system_monitor/system_monitor.h
+++ b/base/system_monitor/system_monitor.h
@@ -50,6 +50,14 @@ class BASE_API SystemMonitor {
// Get the application-wide SystemMonitor (if not present, returns NULL).
static SystemMonitor* Get();
+#if defined(OS_MACOSX)
+ // Allocate system resources needed by the SystemMonitor class.
+ //
+ // This function must be called before instantiating an instance of the class
+ // and before the Sandbox is initialized.
+ static void AllocateSystemIOPorts();
+#endif
+
//
// Power-related APIs
//
@@ -130,11 +138,6 @@ class BASE_API SystemMonitor {
base::OneShotTimer<SystemMonitor> delayed_battery_check_;
#endif
-#if defined(OS_MACOSX)
- IONotificationPortRef notification_port_ref_;
- io_object_t notifier_object_;
-#endif
-
DISALLOW_COPY_AND_ASSIGN(SystemMonitor);
};