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

Unified Diff: content/browser/browser_main_loop.cc

Issue 10824162: add device notification to Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed linux bots. Created 8 years, 4 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
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/device_monitor_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_main_loop.cc
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index 50ce699b4071e4071084393e21afc5b6564bac48..faed5fc5c27350c10c45ba7767c8ff593cf45967 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -68,6 +68,8 @@
#if defined(OS_LINUX)
#include "content/browser/device_monitor_linux.h"
+#elif defined(OS_MACOSX)
+#include "content/browser/device_monitor_mac.h"
#endif
#if defined(OS_CHROMEOS)
@@ -505,6 +507,17 @@ void BrowserMainLoop::ShutdownThreadsAndCleanUp() {
GamepadService::GetInstance()->Terminate();
+ // The device monitors are using |system_monitor_| as dependency, so delete
+ // them before |system_monitor_| goes away.
+ // On Mac and windows, the monitor needs to be destroyed on the same thread
+ // as they were created. On Linux, the monitor will be deleted when IO thread
+ // goes away.
+#if defined(OS_WIN)
+ system_message_window_.reset();
+#elif defined(OS_MACOSX)
+ device_monitor_mac_.reset();
+#endif
+
// Must be size_t so we can subtract from it.
for (size_t thread_id = BrowserThread::ID_COUNT - 1;
thread_id >= (BrowserThread::UI + 1);
@@ -619,6 +632,8 @@ void BrowserMainLoop::BrowserThreadsStarted() {
#if defined(OS_LINUX)
device_monitor_linux_.reset(new DeviceMonitorLinux());
+#elif defined(OS_MACOSX)
+ device_monitor_mac_.reset(new DeviceMonitorMac());
#endif
// RDH needs the IO thread to be created.
« no previous file with comments | « content/browser/browser_main_loop.h ('k') | content/browser/device_monitor_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698