Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: webkit/fileapi/media/mtp_device_map_service.cc

Issue 11358243: Redesigned and refactored ScopedMTPDeviceMapEntry, MTPDeviceMapService & MTPDeviceDelegate classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed GetFileInfoWorker Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/fileapi/media/mtp_device_map_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..e4284e14b95322c19f7f0015ad90350a3173f051 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,6 +35,7 @@ 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);
}
@@ -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() {
« no previous file with comments | « webkit/fileapi/media/mtp_device_map_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698