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

Unified Diff: chrome/browser/media_galleries/media_file_system_registry.cc

Issue 86743002: [MediaGalleries] Enable iPhoto gallery (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Take out logging -- found race Created 6 years, 11 months 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
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))

Powered by Google App Engine
This is Rietveld 408576698