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

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

Issue 10781014: Isolated FS for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 8 years, 5 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_gallery/media_file_system_registry.cc
diff --git a/chrome/browser/media_gallery/media_file_system_registry.cc b/chrome/browser/media_gallery/media_file_system_registry.cc
index c8194df038d2ebf706d2a3fdb61d6cbca2382645..af58831199594d5f585984c1c58d7a93d9d1d2b5 100644
--- a/chrome/browser/media_gallery/media_file_system_registry.cc
+++ b/chrome/browser/media_gallery/media_file_system_registry.cc
@@ -17,6 +17,13 @@
#include "content/public/browser/render_process_host.h"
#include "webkit/fileapi/file_system_types.h"
#include "webkit/fileapi/isolated_context.h"
+#include "webkit/fileapi/media/media_file_system_config.h"
+
+#if defined(SUPPORT_MEDIA_FILESYSTEM)
+#include "webkit/fileapi/media/media_device_map_service.h"
kinuko 2012/07/28 02:29:59 nit: maybe you could add the ifdef inside the head
kmadhusu 2012/07/28 23:15:30 As we discussed, this is a temporary code. Therefo
+
+using fileapi::MediaDeviceMapService;
+#endif
namespace chrome {
@@ -81,12 +88,19 @@ MediaFileSystemRegistry::GetMediaFileSystems(
return results;
}
-void MediaFileSystemRegistry::OnMediaDeviceDetached(const std::string& id) {
+void MediaFileSystemRegistry::OnMediaDeviceDetached(
+ const std::string& id,
+ const FilePath::StringType& location) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DeviceIdToMediaPathMap::iterator it = device_id_map_.find(id);
if (it == device_id_map_.end())
return;
+
+#if defined(SUPPORT_MEDIA_FILESYSTEM)
+ MediaDeviceMapService::GetInstance()->RemoveMediaDevice(location);
+#endif
+
RevokeMediaFileSystem(it->second);
device_id_map_.erase(it);
}

Powered by Google App Engine
This is Rietveld 408576698