Chromium Code Reviews| Index: content/browser/browser_main_loop.cc |
| =================================================================== |
| --- content/browser/browser_main_loop.cc (revision 124819) |
| +++ content/browser/browser_main_loop.cc (working copy) |
| @@ -4,6 +4,8 @@ |
| #include "content/browser/browser_main_loop.h" |
| +#include <string> |
| + |
| #include "base/bind.h" |
| #include "base/command_line.h" |
| #include "base/debug/trace_event.h" |
| @@ -54,6 +56,14 @@ |
| #include "net/base/winsock_init.h" |
| #endif |
| +#if defined(OS_LINUX) |
| +#include "content/browser/media_device_notifications_linux.h" |
| +#endif |
| + |
| +#if defined(OS_MACOSX) |
| +#include "content/browser/mac/media_device_notifications.h" |
| +#endif |
| + |
| #if defined(OS_LINUX) || defined(OS_OPENBSD) |
| #include <glib-object.h> |
| #endif |
| @@ -204,7 +214,7 @@ |
| return g_current_browser_main_loop->audio_manager_.get(); |
| } |
| -// BrowserMainLoop construction / destructione ============================= |
| +// BrowserMainLoop construction / destruction ============================= |
| BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
| : parameters_(parameters), |
| @@ -329,6 +339,8 @@ |
| #if defined(OS_WIN) |
| system_message_window_.reset(new SystemMessageWindowWin); |
| +#elif defined(OS_MACOSX) |
| + StartMediaDeviceNotifications(); |
| #endif |
| // Prior to any processing happening on the io thread, we create the |
| @@ -587,6 +599,17 @@ |
| void BrowserMainLoop::BrowserThreadsStarted() { |
| // RDH needs the IO thread to be created. |
| resource_dispatcher_host_.reset(new ResourceDispatcherHost()); |
| + |
| +#if defined(OS_LINUX) |
| + // MediaDeviceNotificationsLinux needs the File Thread. |
| + const FilePath kDefaultMtabPath("/etc/mtab"); |
|
vandebo (ex-Chrome)
2012/03/06 00:41:40
Random thought - does this work on CrOS? It shoul
Lei Zhang
2012/03/06 19:00:25
It should based on our observations on a Chromeboo
|
| + media_device_notifications_linux_ = |
| + new MediaDeviceNotificationsLinux(kDefaultMtabPath); |
| + BrowserThread::PostTask( |
| + BrowserThread::FILE, FROM_HERE, |
| + base::Bind(&MediaDeviceNotificationsLinux::InitOnFileThread, |
| + media_device_notifications_linux_.get())); |
| +#endif |
| } |
| void BrowserMainLoop::InitializeToolkit() { |