Chromium Code Reviews| Index: webkit/fileapi/media/mtp_device_map_service.cc |
| diff --git a/webkit/fileapi/media/mtp_device_map_service.cc b/webkit/fileapi/media/mtp_device_map_service.cc |
| index 68bf3d47b3e144bf9c866c6ae5561c2d3e609cfe..05f2410d73f041e8c3e9cf0528e72452f845636b 100644 |
| --- a/webkit/fileapi/media/mtp_device_map_service.cc |
| +++ b/webkit/fileapi/media/mtp_device_map_service.cc |
| @@ -20,11 +20,10 @@ MTPDeviceMapService* MTPDeviceMapService::GetInstance() { |
| void MTPDeviceMapService::AddDelegate( |
| const FilePath::StringType& device_location, |
| - scoped_refptr<MTPDeviceDelegate> delegate) { |
| + MTPDeviceDelegate* delegate) { |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| - DCHECK(delegate.get()); |
| + DCHECK(delegate); |
| DCHECK(!device_location.empty()); |
| - |
| if (ContainsKey(delegate_map_, device_location)) |
| return; |
| @@ -36,11 +35,12 @@ void MTPDeviceMapService::RemoveDelegate( |
| DCHECK(thread_checker_.CalledOnValidThread()); |
| DelegateMap::iterator it = delegate_map_.find(device_location); |
| DCHECK(it != delegate_map_.end()); |
| + it->second->CancelPendingTasksAndDeleteDelegate(); |
| delegate_map_.erase(it); |
| } |
| -MTPDeviceDelegate* MTPDeviceMapService::GetMTPDeviceDelegate( |
| - const std::string& filesystem_id) { |
| +MTPDeviceDelegate* MTPDeviceMapService:: |
| + GetMTPDeviceDelegate(const std::string& filesystem_id) { |
|
kinuko
2012/11/15 10:23:39
nit: this new indentation looks a bit unusual...?
kmadhusu
2012/11/15 17:52:24
Fixed.
|
| DCHECK(thread_checker_.CalledOnValidThread()); |
| FilePath device_path; |
| if (!IsolatedContext::GetInstance()->GetRegisteredPath(filesystem_id, |
| @@ -53,7 +53,7 @@ MTPDeviceDelegate* MTPDeviceMapService::GetMTPDeviceDelegate( |
| DelegateMap::const_iterator it = delegate_map_.find(device_location); |
| DCHECK(it != delegate_map_.end()); |
| - return it->second.get(); |
| + return it->second; |
| } |
| MTPDeviceMapService::MTPDeviceMapService() { |