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> |
jam
2012/03/06 21:21:38
nit: no need. i understand you're adding it for IW
Lei Zhang
2012/03/06 21:36:50
Done.
|
+ |
#include "base/bind.h" |
#include "base/command_line.h" |
#include "base/debug/trace_event.h" |
@@ -54,6 +56,10 @@ |
#include "net/base/winsock_init.h" |
#endif |
+#if defined(OS_LINUX) |
+#include "content/browser/media_device_notifications_linux.h" |
+#endif |
+ |
#if defined(OS_LINUX) || defined(OS_OPENBSD) |
#include <glib-object.h> |
#endif |
@@ -204,7 +210,7 @@ |
return g_current_browser_main_loop->audio_manager_.get(); |
} |
-// BrowserMainLoop construction / destructione ============================= |
+// BrowserMainLoop construction / destruction ============================= |
BrowserMainLoop::BrowserMainLoop(const content::MainFunctionParams& parameters) |
: parameters_(parameters), |
@@ -587,6 +593,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"); |
+ media_device_notifications_linux_ = |
+ new MediaDeviceNotificationsLinux(kDefaultMtabPath); |
+ BrowserThread::PostTask( |
+ BrowserThread::FILE, FROM_HERE, |
jam
2012/03/06 21:21:38
nit: it's nicer if this class can do its thread in
Lei Zhang
2012/03/06 21:36:50
Done.
jam
2012/03/06 22:22:11
you have do it in in a separate method, i.e. after
Lei Zhang
2012/03/06 23:23:42
Oh thanks for reminding me about that. Fixed.
|
+ base::Bind(&MediaDeviceNotificationsLinux::InitOnFileThread, |
+ media_device_notifications_linux_.get())); |
+#endif |
} |
void BrowserMainLoop::InitializeToolkit() { |