Chromium Code Reviews| Index: chrome/browser/system_monitor/removable_device_notifications_mac.mm |
| diff --git a/chrome/browser/system_monitor/removable_device_notifications_mac.mm b/chrome/browser/system_monitor/removable_device_notifications_mac.mm |
| index 185ae18ef727170cd51982aa4fd093ed6baea745..6793a80e09eedeeafa51fb3799e39424c19ae333 100644 |
| --- a/chrome/browser/system_monitor/removable_device_notifications_mac.mm |
| +++ b/chrome/browser/system_monitor/removable_device_notifications_mac.mm |
| @@ -14,7 +14,7 @@ static RemovableDeviceNotificationsMac* |
| g_removable_device_notifications_mac = NULL; |
| void GetDiskInfoAndUpdateOnFileThread( |
| - const base::WeakPtr<RemovableDeviceNotificationsMac>& notifications, |
| + const scoped_refptr<RemovableDeviceNotificationsMac>& notifications, |
| base::mac::ScopedCFTypeRef<CFDictionaryRef> dict, |
| RemovableDeviceNotificationsMac::UpdateType update_type) { |
| DiskInfoMac info = DiskInfoMac::BuildDiskInfoOnFileThread(dict); |
| @@ -31,7 +31,7 @@ void GetDiskInfoAndUpdateOnFileThread( |
| } |
| void GetDiskInfoAndUpdate( |
| - const base::WeakPtr<RemovableDeviceNotificationsMac>& notifications, |
| + const scoped_refptr<RemovableDeviceNotificationsMac>& notifications, |
| DADiskRef disk, |
| RemovableDeviceNotificationsMac::UpdateType update_type) { |
| base::mac::ScopedCFTypeRef<CFDictionaryRef> dict(DADiskCopyDescription(disk)); |
| @@ -147,7 +147,7 @@ void RemovableDeviceNotificationsMac::DiskAppearedCallback( |
| void* context) { |
| RemovableDeviceNotificationsMac* notifications = |
| static_cast<RemovableDeviceNotificationsMac*>(context); |
| - GetDiskInfoAndUpdate(notifications->AsWeakPtr(), |
| + GetDiskInfoAndUpdate(notifications, |
|
vandebo (ex-Chrome)
2012/09/18 22:41:56
Does this work? raw pointer passed to function tha
sail
2012/09/18 22:52:49
Yep! When the raw pointer is passed to GetDiskInfo
vandebo (ex-Chrome)
2012/09/18 23:03:47
What I meant is that maybe GetDiskInfoAndUpdate co
sail
2012/09/18 23:28:51
Ahh, I see what you mean.
I tried simply removing
|
| disk, |
| UPDATE_DEVICE_ADDED); |
| } |
| @@ -158,7 +158,7 @@ void RemovableDeviceNotificationsMac::DiskDisappearedCallback( |
| void* context) { |
| RemovableDeviceNotificationsMac* notifications = |
| static_cast<RemovableDeviceNotificationsMac*>(context); |
| - GetDiskInfoAndUpdate(notifications->AsWeakPtr(), |
| + GetDiskInfoAndUpdate(notifications, |
| disk, |
| UPDATE_DEVICE_REMOVED); |
| } |
| @@ -170,7 +170,7 @@ void RemovableDeviceNotificationsMac::DiskDescriptionChangedCallback( |
| void *context) { |
| RemovableDeviceNotificationsMac* notifications = |
| static_cast<RemovableDeviceNotificationsMac*>(context); |
| - GetDiskInfoAndUpdate(notifications->AsWeakPtr(), |
| + GetDiskInfoAndUpdate(notifications, |
| disk, |
| UPDATE_DEVICE_CHANGED); |
| } |