Index: chrome/browser/media_galleries/media_file_system_registry.cc |
diff --git a/chrome/browser/media_galleries/media_file_system_registry.cc b/chrome/browser/media_galleries/media_file_system_registry.cc |
index 534a6971dd0a9b8951ed8cce52978b8163c8d1cf..af2ddc38e03c7968e4d014382c529b628a2d3834 100644 |
--- a/chrome/browser/media_galleries/media_file_system_registry.cc |
+++ b/chrome/browser/media_galleries/media_file_system_registry.cc |
@@ -148,6 +148,8 @@ class RPHReferenceManager : public content::NotificationObserver { |
void OnRendererProcessTerminated(const RenderProcessHost* rph) { |
RPHRefCount::iterator rph_info = refs_.find(rph); |
+ // Will this crash if the RPH is navigated to a page on the same host |
vandebo (ex-Chrome)
2014/01/06 18:45:03
This this a debug comment?
Greg Billock
2014/01/07 16:50:55
I think this is a real hole. Filling.
|
+ // (triggering OWCDON()) and then the tab crashes? |
DCHECK(rph_info != refs_.end()); |
delete rph_info->second; |
refs_.erase(rph_info); |
@@ -287,9 +289,12 @@ class ExtensionGalleriesHost |
virtual ~ExtensionGalleriesHost() { |
DCHECK(rph_refs_.empty()); |
DCHECK(pref_id_map_.empty()); |
- |
} |
+ // It appears there's a shutdown race in some browser tests. If the RPHs shut |
+ // down first, there may still be Filter... calls pending which will then |
+ // invoke this method interleaved in the destruction callback sequence and |
+ // re-populate pref_id_map_. |
vandebo (ex-Chrome)
2014/01/06 18:45:03
So if rph_refs_ is empty, we know that we lost the
Greg Billock
2014/01/07 16:50:55
I also looked, and I agree this is a fine check. A
|
void GetMediaFileSystemsForAttachedDevices( |
const MediaStorageUtil::DeviceIdSet* attached_devices, |
const MediaGalleryPrefIdSet& galleries, |
@@ -510,6 +515,9 @@ class MediaFileSystemRegistry::MediaFileSystemContextImpl |
} |
virtual void RevokeFileSystem(const std::string& fsid) OVERRIDE { |
+ // Does this need to do something about non-imported, non-MTP filesystems? |
+ // It gets called during RPH shutdown, and may leave around local drive |
+ // FS trash. |
vandebo (ex-Chrome)
2014/01/06 18:45:03
What kind of trash do you mean?
Greg Billock
2014/01/07 16:50:55
Not exactly sure. Is there some cleanup that needs
|
ImportedMediaGalleryRegistry* imported_registry = |
ImportedMediaGalleryRegistry::GetInstance(); |
if (imported_registry->RevokeImportedFilesystemOnUIThread(fsid)) |