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

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

Issue 16158004: iTunes file util and data provider for media galleries (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Undo incorrect fix Created 7 years, 6 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 42ecc918809c726959db87beab5a627d66ddf5ef..cf582e9955ba8894a17cd9aac207f554955c9e00 100644
--- a/chrome/browser/media_galleries/media_file_system_registry.cc
+++ b/chrome/browser/media_galleries/media_file_system_registry.cc
@@ -337,7 +337,8 @@ class ExtensionGalleriesHost
DCHECK(mtp_device_host.get());
media_device_map_references_[pref_id] = mtp_device_host;
}
- DCHECK(!fsid.empty());
+ if (fsid.empty())
+ continue;
MediaFileSystemInfo new_entry(
MediaGalleriesDialogController::GetGalleryDisplayNameNoAttachment(
@@ -558,20 +559,22 @@ class MediaFileSystemRegistry::MediaFileSystemContextImpl
// Sanity checks for |path|.
CHECK(path.IsAbsolute());
CHECK(!path.ReferencesParent());
- std::string fs_name(extension_misc::kMediaFileSystemPathPart);
std::string fsid;
if (StorageInfo::IsITunesDevice(device_id)) {
- NOTIMPLEMENTED();
+ ImportedMediaGalleryRegistry* imported_registry =
+ ImportedMediaGalleryRegistry::GetInstance();
+ fsid = imported_registry->RegisterITunesFilesystemOnUIThread(path);
} else if (StorageInfo::IsPicasaDevice(device_id)) {
- fsid = ImportedMediaGalleryRegistry::RegisterPicasaFilesystemOnUIThread(
+ ImportedMediaGalleryRegistry* imported_registry =
+ ImportedMediaGalleryRegistry::GetInstance();
+ fsid = imported_registry->RegisterPicasaFilesystemOnUIThread(
path);
} else {
+ std::string fs_name(extension_misc::kMediaFileSystemPathPart);
fsid = IsolatedContext::GetInstance()->RegisterFileSystemForPath(
fileapi::kFileSystemTypeNativeMedia, path, &fs_name);
}
-
- CHECK(!fsid.empty());
return fsid;
}
@@ -594,6 +597,11 @@ class MediaFileSystemRegistry::MediaFileSystemContextImpl
}
virtual void RevokeFileSystem(const std::string& fsid) OVERRIDE {
+ ImportedMediaGalleryRegistry* imported_registry =
+ ImportedMediaGalleryRegistry::GetInstance();
+ if (imported_registry->RevokeImportedFilesystemOnUIThread(fsid))
+ return;
+
IsolatedContext::GetInstance()->RevokeFileSystem(fsid);
}

Powered by Google App Engine
This is Rietveld 408576698