Chromium Code Reviews| Index: chrome/browser/storage_monitor/storage_monitor_linux.cc |
| diff --git a/chrome/browser/storage_monitor/storage_monitor_linux.cc b/chrome/browser/storage_monitor/storage_monitor_linux.cc |
| index 64954bd7ff2ba6bbecbd03507f2c39dc382da9a1..1a41852922df877aa6e70df94485f597c96301f1 100644 |
| --- a/chrome/browser/storage_monitor/storage_monitor_linux.cc |
| +++ b/chrome/browser/storage_monitor/storage_monitor_linux.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/basictypes.h" |
| #include "base/bind.h" |
| +#include "base/command_line.h" |
| #include "base/files/file_path.h" |
| #include "base/metrics/histogram.h" |
| #include "base/stl_util.h" |
| @@ -21,8 +22,11 @@ |
| #include "base/utf_string_conversions.h" |
| #include "chrome/browser/storage_monitor/media_device_notifications_utils.h" |
| #include "chrome/browser/storage_monitor/media_storage_util.h" |
| +#include "chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux.h" |
| #include "chrome/browser/storage_monitor/removable_device_constants.h" |
| #include "chrome/browser/storage_monitor/udev_util_linux.h" |
| +#include "chrome/common/chrome_switches.h" |
| +#include "device/media_transfer_protocol/media_transfer_protocol_manager.h" |
| namespace chrome { |
| @@ -270,6 +274,9 @@ StorageMonitorLinux::StorageMonitorLinux(const base::FilePath& path, |
| StorageMonitorLinux::~StorageMonitorLinux() { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| + if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
| + device::MediaTransferProtocolManager::Shutdown(); |
| + } |
| } |
| void StorageMonitorLinux::Init() { |
| @@ -282,6 +289,17 @@ void StorageMonitorLinux::Init() { |
| BrowserThread::PostTask( |
| BrowserThread::FILE, FROM_HERE, |
| base::Bind(&StorageMonitorLinux::InitOnFileThread, this)); |
| + |
| + if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kTestType)) { |
| + scoped_refptr<base::MessageLoopProxy> loop_proxy; |
| + loop_proxy = content::BrowserThread::GetMessageLoopProxyForThread( |
| + content::BrowserThread::FILE); |
| + device::MediaTransferProtocolManager::Initialize(loop_proxy); |
|
Joao da Silva
2013/03/12 14:15:23
This DCHECKS on Linux at shutdown.
::Initialize c
Greg Billock
2013/03/12 21:15:29
Yes, we need to post back to the UI thread to shut
|
| + |
| + media_transfer_protocol_device_observer_.reset( |
| + new MediaTransferProtocolDeviceObserverLinux()); |
| + media_transfer_protocol_device_observer_->SetNotifications(receiver()); |
| + } |
| } |
| bool StorageMonitorLinux::GetStorageInfoForPath( |